Imported Upstream version 1.3.0 upstream/1.3.0
authorChanho Park <chanho61.park@samsung.com>
Tue, 6 Jan 2015 02:17:11 +0000 (11:17 +0900)
committerChanho Park <chanho61.park@samsung.com>
Tue, 6 Jan 2015 02:17:11 +0000 (11:17 +0900)
894 files changed:
AUTHORS
ChangeLog
HACKING
Makefile.am
Makefile.in
NEWS
README
acinclude.m4
aclocal.m4
augeas.pc.in
augeas.spec
augeas.spec.in
build/ac-aux/compile [new file with mode: 0755]
build/ac-aux/config.guess [moved from build/aux/config.guess with 62% similarity]
build/ac-aux/config.rpath [moved from build/aux/config.rpath with 99% similarity]
build/ac-aux/config.sub [moved from build/aux/config.sub with 73% similarity]
build/ac-aux/depcomp [moved from build/aux/depcomp with 50% similarity]
build/ac-aux/gitlog-to-changelog [new file with mode: 0755]
build/ac-aux/install-sh [moved from build/aux/install-sh with 94% similarity]
build/ac-aux/ltmain.sh [moved from build/aux/ltmain.sh with 99% similarity, mode: 0644]
build/ac-aux/missing [new file with mode: 0755]
build/ac-aux/move-if-change [moved from build/aux/move-if-change with 80% similarity]
build/ac-aux/snippet/_Noreturn.h [new file with mode: 0644]
build/ac-aux/snippet/arg-nonnull.h [moved from build/aux/arg-nonnull.h with 95% similarity]
build/ac-aux/snippet/c++defs.h [moved from build/aux/c++defs.h with 99% similarity]
build/ac-aux/snippet/unused-parameter.h [moved from build/aux/unused-parameter.h with 96% similarity]
build/ac-aux/snippet/warn-on-use.h [moved from build/aux/warn-on-use.h with 98% similarity]
build/ac-aux/test-driver [new file with mode: 0755]
build/ac-aux/ylwrap [new file with mode: 0755]
build/aux/gitlog-to-changelog [deleted file]
build/aux/missing [deleted file]
build/aux/ylwrap [deleted file]
config.h.in
configure
configure.ac
doc/Makefile.in
doc/lenses.tex
doc/naturaldocs/Makefile.in
doc/naturaldocs/conf/c_api/Menu.txt
doc/naturaldocs/conf/lenses/Menu.txt
doc/naturaldocs/conf/lenses/Menu_Backup.txt [new file with mode: 0644]
doc/syntax/augeas.vim
examples/Makefile.in
gnulib/lib/Makefile.am
gnulib/lib/Makefile.in
gnulib/lib/alloca.c
gnulib/lib/alloca.in.h
gnulib/lib/argz.c
gnulib/lib/argz.in.h
gnulib/lib/asnprintf.c
gnulib/lib/asprintf.c
gnulib/lib/btowc.c
gnulib/lib/canonicalize-lgpl.c
gnulib/lib/config.charset
gnulib/lib/ctype.in.h
gnulib/lib/dosname.h
gnulib/lib/errno.in.h
gnulib/lib/fcntl.in.h [moved from gnulib/tests/fcntl.in.h with 83% similarity]
gnulib/lib/float+.h
gnulib/lib/float.c [new file with mode: 0644]
gnulib/lib/float.in.h
gnulib/lib/fnmatch.c
gnulib/lib/fnmatch.in.h
gnulib/lib/fnmatch_loop.c
gnulib/lib/getdelim.c
gnulib/lib/getfilecon.c
gnulib/lib/getline.c
gnulib/lib/getopt.c
gnulib/lib/getopt.in.h
gnulib/lib/getopt1.c
gnulib/lib/getopt_int.h
gnulib/lib/gettext.h
gnulib/lib/gettimeofday.c [new file with mode: 0644]
gnulib/lib/isblank.c
gnulib/lib/itold.c [new file with mode: 0644]
gnulib/lib/langinfo.in.h
gnulib/lib/localcharset.c
gnulib/lib/localcharset.h
gnulib/lib/locale.in.h
gnulib/lib/localeconv.c [new file with mode: 0644]
gnulib/lib/lstat.c
gnulib/lib/malloc.c
gnulib/lib/malloca.c
gnulib/lib/malloca.h
gnulib/lib/mbrtowc.c
gnulib/lib/mbsinit.c
gnulib/lib/mbsrtowcs-impl.h
gnulib/lib/mbsrtowcs-state.c
gnulib/lib/mbsrtowcs.c
gnulib/lib/mbtowc-impl.h
gnulib/lib/mbtowc.c
gnulib/lib/memchr.c
gnulib/lib/mempcpy.c
gnulib/lib/mkstemp.c [new file with mode: 0644]
gnulib/lib/nl_langinfo.c
gnulib/lib/pathmax.h
gnulib/lib/printf-args.c
gnulib/lib/printf-args.h
gnulib/lib/printf-parse.c
gnulib/lib/printf-parse.h
gnulib/lib/rawmemchr.c [new file with mode: 0644]
gnulib/lib/rawmemchr.valgrind [new file with mode: 0644]
gnulib/lib/readlink.c
gnulib/lib/realloc.c
gnulib/lib/ref-add.sin
gnulib/lib/ref-del.sin
gnulib/lib/regcomp.c
gnulib/lib/regex.c
gnulib/lib/regex.h
gnulib/lib/regex_internal.c
gnulib/lib/regex_internal.h
gnulib/lib/regexec.c
gnulib/lib/safe-alloc.c
gnulib/lib/safe-alloc.h
gnulib/lib/se-selinux.in.h
gnulib/lib/size_max.h
gnulib/lib/stat.c
gnulib/lib/stdbool.in.h
gnulib/lib/stddef.in.h
gnulib/lib/stdint.in.h
gnulib/lib/stdio.in.h
gnulib/lib/stdlib.in.h
gnulib/lib/stpcpy.c
gnulib/lib/stpncpy.c
gnulib/lib/str-two-way.h
gnulib/lib/strchrnul.c [new file with mode: 0644]
gnulib/lib/strchrnul.valgrind [new file with mode: 0644]
gnulib/lib/streq.h
gnulib/lib/string.in.h
gnulib/lib/strndup.c
gnulib/lib/strnlen.c
gnulib/lib/strnlen1.c
gnulib/lib/strnlen1.h
gnulib/lib/strstr.c
gnulib/lib/sys_stat.in.h
gnulib/lib/sys_time.in.h [new file with mode: 0644]
gnulib/lib/sys_types.in.h [new file with mode: 0644]
gnulib/lib/sys_wait.in.h
gnulib/lib/tempname.c [new file with mode: 0644]
gnulib/lib/tempname.h [new file with mode: 0644]
gnulib/lib/time.in.h
gnulib/lib/unistd.in.h
gnulib/lib/vasnprintf.c
gnulib/lib/vasnprintf.h
gnulib/lib/vasprintf.c
gnulib/lib/verify.h
gnulib/lib/wchar.in.h
gnulib/lib/wcrtomb.c
gnulib/lib/wctype.in.h
gnulib/lib/xsize.h
gnulib/m4/00gnulib.m4
gnulib/m4/alloca.m4
gnulib/m4/argz.m4
gnulib/m4/btowc.m4
gnulib/m4/canonicalize.m4
gnulib/m4/close.m4 [new file with mode: 0644]
gnulib/m4/codeset.m4
gnulib/m4/configmake.m4
gnulib/m4/ctype.m4
gnulib/m4/double-slash-root.m4
gnulib/m4/dup2.m4
gnulib/m4/eealloc.m4
gnulib/m4/environ.m4
gnulib/m4/errno_h.m4
gnulib/m4/exponentd.m4 [new file with mode: 0644]
gnulib/m4/extensions.m4
gnulib/m4/fcntl-o.m4
gnulib/m4/fcntl_h.m4
gnulib/m4/fdopen.m4 [new file with mode: 0644]
gnulib/m4/float_h.m4
gnulib/m4/fnmatch.m4
gnulib/m4/fpieee.m4 [new file with mode: 0644]
gnulib/m4/fstat.m4 [new file with mode: 0644]
gnulib/m4/getcwd.m4 [new file with mode: 0644]
gnulib/m4/getdelim.m4
gnulib/m4/getline.m4
gnulib/m4/getopt.m4
gnulib/m4/getpagesize.m4
gnulib/m4/gettimeofday.m4 [new file with mode: 0644]
gnulib/m4/glibc21.m4
gnulib/m4/gnulib-common.m4
gnulib/m4/gnulib-comp.m4
gnulib/m4/include_next.m4
gnulib/m4/intlmacosx.m4
gnulib/m4/intmax_t.m4
gnulib/m4/inttypes-pri.m4 [new file with mode: 0644]
gnulib/m4/inttypes.m4 [new file with mode: 0644]
gnulib/m4/inttypes_h.m4
gnulib/m4/isblank.m4
gnulib/m4/langinfo_h.m4
gnulib/m4/largefile.m4 [new file with mode: 0644]
gnulib/m4/lcmessage.m4
gnulib/m4/lib-ld.m4
gnulib/m4/lib-link.m4
gnulib/m4/lib-prefix.m4
gnulib/m4/libtool.m4
gnulib/m4/localcharset.m4
gnulib/m4/locale-fr.m4
gnulib/m4/locale-ja.m4
gnulib/m4/locale-tr.m4
gnulib/m4/locale-zh.m4
gnulib/m4/locale_h.m4
gnulib/m4/localeconv.m4 [new file with mode: 0644]
gnulib/m4/localename.m4
gnulib/m4/lock.m4
gnulib/m4/longlong.m4
gnulib/m4/lstat.m4
gnulib/m4/ltoptions.m4
gnulib/m4/ltversion.m4
gnulib/m4/malloc.m4
gnulib/m4/malloca.m4
gnulib/m4/mbrtowc.m4
gnulib/m4/mbsinit.m4
gnulib/m4/mbsrtowcs.m4
gnulib/m4/mbstate_t.m4
gnulib/m4/mbtowc.m4
gnulib/m4/memchr.m4
gnulib/m4/mempcpy.m4
gnulib/m4/mkstemp.m4 [new file with mode: 0644]
gnulib/m4/mmap-anon.m4
gnulib/m4/mode_t.m4
gnulib/m4/msvc-inval.m4 [new file with mode: 0644]
gnulib/m4/msvc-nothrow.m4 [new file with mode: 0644]
gnulib/m4/multiarch.m4
gnulib/m4/nl_langinfo.m4
gnulib/m4/nocrash.m4 [new file with mode: 0644]
gnulib/m4/off_t.m4 [new file with mode: 0644]
gnulib/m4/onceonly.m4
gnulib/m4/open.m4
gnulib/m4/pathmax.m4
gnulib/m4/printf.m4
gnulib/m4/putenv.m4
gnulib/m4/rawmemchr.m4 [new file with mode: 0644]
gnulib/m4/readlink.m4
gnulib/m4/realloc.m4
gnulib/m4/regex.m4
gnulib/m4/safe-alloc.m4
gnulib/m4/selinux-context-h.m4
gnulib/m4/selinux-selinux-h.m4
gnulib/m4/setenv.m4
gnulib/m4/setlocale.m4
gnulib/m4/size_max.m4
gnulib/m4/ssize_t.m4
gnulib/m4/stat.m4
gnulib/m4/stdbool.m4
gnulib/m4/stddef_h.m4
gnulib/m4/stdint.m4
gnulib/m4/stdint_h.m4
gnulib/m4/stdio_h.m4
gnulib/m4/stdlib_h.m4
gnulib/m4/stpcpy.m4
gnulib/m4/stpncpy.m4
gnulib/m4/strchrnul.m4 [new file with mode: 0644]
gnulib/m4/string_h.m4
gnulib/m4/strndup.m4
gnulib/m4/strnlen.m4
gnulib/m4/strstr.m4
gnulib/m4/symlink.m4
gnulib/m4/sys_socket_h.m4 [new file with mode: 0644]
gnulib/m4/sys_stat_h.m4
gnulib/m4/sys_time_h.m4 [new file with mode: 0644]
gnulib/m4/sys_types_h.m4 [new file with mode: 0644]
gnulib/m4/sys_wait_h.m4
gnulib/m4/tempname.m4 [new file with mode: 0644]
gnulib/m4/thread.m4
gnulib/m4/threadlib.m4
gnulib/m4/time_h.m4
gnulib/m4/unistd_h.m4
gnulib/m4/vasnprintf.m4
gnulib/m4/vasprintf.m4
gnulib/m4/warn-on-use.m4
gnulib/m4/wchar_h.m4
gnulib/m4/wchar_t.m4
gnulib/m4/wcrtomb.m4
gnulib/m4/wctob.m4
gnulib/m4/wctomb.m4
gnulib/m4/wctype_h.m4
gnulib/m4/wint_t.m4
gnulib/m4/xsize.m4
gnulib/m4/yield.m4
gnulib/tests/Makefile.am
gnulib/tests/Makefile.in
gnulib/tests/binary-io.h
gnulib/tests/c-ctype.c
gnulib/tests/c-ctype.h
gnulib/tests/c-strcase.h
gnulib/tests/c-strcasecmp.c
gnulib/tests/c-strncasecmp.c
gnulib/tests/close.c [new file with mode: 0644]
gnulib/tests/dup2.c
gnulib/tests/fd-hook.c [new file with mode: 0644]
gnulib/tests/fd-hook.h [new file with mode: 0644]
gnulib/tests/fdopen.c [new file with mode: 0644]
gnulib/tests/fpucw.h [new file with mode: 0644]
gnulib/tests/fstat.c [new file with mode: 0644]
gnulib/tests/getcwd-lgpl.c [new file with mode: 0644]
gnulib/tests/getpagesize.c
gnulib/tests/glthread/lock.c
gnulib/tests/glthread/lock.h
gnulib/tests/glthread/thread.c
gnulib/tests/glthread/thread.h
gnulib/tests/glthread/threadlib.c
gnulib/tests/glthread/yield.h
gnulib/tests/ignore-value.h
gnulib/tests/init.sh
gnulib/tests/intprops.h
gnulib/tests/inttypes.in.h [new file with mode: 0644]
gnulib/tests/localename.c
gnulib/tests/localename.h
gnulib/tests/macros.h
gnulib/tests/msvc-inval.c [new file with mode: 0644]
gnulib/tests/msvc-inval.h [new file with mode: 0644]
gnulib/tests/msvc-nothrow.c [new file with mode: 0644]
gnulib/tests/msvc-nothrow.h [new file with mode: 0644]
gnulib/tests/open.c
gnulib/tests/putenv.c
gnulib/tests/same-inode.h
gnulib/tests/setenv.c
gnulib/tests/setlocale.c
gnulib/tests/signature.h
gnulib/tests/symlink.c
gnulib/tests/test-alloca-opt.c
gnulib/tests/test-binary-io.c
gnulib/tests/test-binary-io.sh
gnulib/tests/test-btowc.c
gnulib/tests/test-c-ctype.c
gnulib/tests/test-c-strcasecmp.c
gnulib/tests/test-c-strncasecmp.c
gnulib/tests/test-canonicalize-lgpl.c
gnulib/tests/test-close.c [new file with mode: 0644]
gnulib/tests/test-ctype.c
gnulib/tests/test-dup2.c
gnulib/tests/test-environ.c
gnulib/tests/test-errno.c
gnulib/tests/test-fcntl-h.c
gnulib/tests/test-fdopen.c [new file with mode: 0644]
gnulib/tests/test-fgetc.c [new file with mode: 0644]
gnulib/tests/test-float.c [new file with mode: 0644]
gnulib/tests/test-fnmatch.c
gnulib/tests/test-fputc.c [new file with mode: 0644]
gnulib/tests/test-fread.c [new file with mode: 0644]
gnulib/tests/test-fstat.c [new file with mode: 0644]
gnulib/tests/test-fwrite.c [new file with mode: 0644]
gnulib/tests/test-getcwd-lgpl.c [new file with mode: 0644]
gnulib/tests/test-getdelim.c
gnulib/tests/test-getline.c
gnulib/tests/test-getopt.c
gnulib/tests/test-getopt.h
gnulib/tests/test-getopt_long.h
gnulib/tests/test-gettimeofday.c [new file with mode: 0644]
gnulib/tests/test-ignore-value.c
gnulib/tests/test-init.sh [new file with mode: 0755]
gnulib/tests/test-intprops.c [new file with mode: 0644]
gnulib/tests/test-inttypes.c [new file with mode: 0644]
gnulib/tests/test-isblank.c
gnulib/tests/test-langinfo.c
gnulib/tests/test-locale.c
gnulib/tests/test-localeconv.c [new file with mode: 0644]
gnulib/tests/test-localename.c
gnulib/tests/test-lock.c
gnulib/tests/test-lstat.c
gnulib/tests/test-lstat.h
gnulib/tests/test-malloc-gnu.c
gnulib/tests/test-malloca.c
gnulib/tests/test-mbrtowc-w32.c
gnulib/tests/test-mbrtowc.c
gnulib/tests/test-mbsinit.c
gnulib/tests/test-mbsrtowcs.c
gnulib/tests/test-memchr.c
gnulib/tests/test-nl_langinfo.c
gnulib/tests/test-open.c
gnulib/tests/test-open.h
gnulib/tests/test-pathmax.c [new file with mode: 0644]
gnulib/tests/test-rawmemchr.c [new file with mode: 0644]
gnulib/tests/test-readlink.c
gnulib/tests/test-readlink.h
gnulib/tests/test-safe-alloc.c
gnulib/tests/test-setenv.c
gnulib/tests/test-setlocale1.c
gnulib/tests/test-setlocale2.c
gnulib/tests/test-setlocale2.sh
gnulib/tests/test-stat.c
gnulib/tests/test-stat.h
gnulib/tests/test-stdbool.c
gnulib/tests/test-stddef.c
gnulib/tests/test-stdint.c
gnulib/tests/test-stdio.c
gnulib/tests/test-stdlib.c
gnulib/tests/test-strchrnul.c [new file with mode: 0644]
gnulib/tests/test-string.c
gnulib/tests/test-strnlen.c
gnulib/tests/test-strstr.c
gnulib/tests/test-symlink.c
gnulib/tests/test-symlink.h
gnulib/tests/test-sys_stat.c
gnulib/tests/test-sys_time.c [new file with mode: 0644]
gnulib/tests/test-sys_types.c [new file with mode: 0644]
gnulib/tests/test-sys_wait.c
gnulib/tests/test-sys_wait.h
gnulib/tests/test-thread_create.c [new file with mode: 0644]
gnulib/tests/test-thread_self.c [new file with mode: 0644]
gnulib/tests/test-time.c
gnulib/tests/test-unistd.c
gnulib/tests/test-unsetenv.c
gnulib/tests/test-vasnprintf.c
gnulib/tests/test-vasprintf.c
gnulib/tests/test-verify.c
gnulib/tests/test-wchar.c
gnulib/tests/test-wcrtomb-w32.c
gnulib/tests/test-wcrtomb.c
gnulib/tests/test-wctype-h.c
gnulib/tests/unsetenv.c
gnulib/tests/wctob.c
gnulib/tests/wctomb-impl.h
gnulib/tests/wctomb.c
gnulib/tests/zerosize-ptr.h
lenses/access.aug
lenses/activemq_conf.aug [new file with mode: 0644]
lenses/activemq_xml.aug [new file with mode: 0644]
lenses/aliases.aug
lenses/anacron.aug [new file with mode: 0644]
lenses/approx.aug
lenses/apt_update_manager.aug [new file with mode: 0644]
lenses/aptcacherngsecurity.aug [new file with mode: 0644]
lenses/aptconf.aug
lenses/aptpreferences.aug
lenses/aptsources.aug
lenses/authorized_keys.aug [new file with mode: 0644]
lenses/automaster.aug [new file with mode: 0644]
lenses/automounter.aug [new file with mode: 0644]
lenses/avahi.aug [new file with mode: 0644]
lenses/backuppchosts.aug
lenses/bbhosts.aug
lenses/bootconf.aug [new file with mode: 0644]
lenses/build.aug
lenses/cachefilesd.aug [new file with mode: 0644]
lenses/carbon.aug [new file with mode: 0644]
lenses/cgconfig.aug
lenses/cgrules.aug
lenses/channels.aug [new file with mode: 0644]
lenses/chrony.aug [new file with mode: 0644]
lenses/cobblersettings.aug
lenses/collectd.aug [new file with mode: 0644]
lenses/cpanel.aug [new file with mode: 0644]
lenses/cron.aug
lenses/crypttab.aug
lenses/cups.aug [new file with mode: 0644]
lenses/cyrus_imapd.aug [new file with mode: 0644]
lenses/darkice.aug
lenses/debctrl.aug
lenses/desktop.aug
lenses/device_map.aug
lenses/dhclient.aug
lenses/dhcpd.aug
lenses/dnsmasq.aug
lenses/dovecot.aug [new file with mode: 0644]
lenses/dput.aug
lenses/erlang.aug [new file with mode: 0644]
lenses/exports.aug
lenses/fai_diskconfig.aug
lenses/fonts.aug [new file with mode: 0644]
lenses/fstab.aug
lenses/fuse.aug [new file with mode: 0644]
lenses/gdm.aug
lenses/group.aug
lenses/grub.aug
lenses/gshadow.aug [new file with mode: 0644]
lenses/gtkbookmarks.aug [new file with mode: 0644]
lenses/host_conf.aug
lenses/hostname.aug
lenses/hosts_access.aug
lenses/htpasswd.aug [new file with mode: 0644]
lenses/httpd.aug
lenses/inetd.aug
lenses/inifile.aug
lenses/inputrc.aug [new file with mode: 0644]
lenses/interfaces.aug
lenses/iproute2.aug [new file with mode: 0644]
lenses/iptables.aug
lenses/jaas.aug [new file with mode: 0644]
lenses/jettyrealm.aug [new file with mode: 0644]
lenses/jmxaccess.aug [new file with mode: 0644]
lenses/jmxpassword.aug [new file with mode: 0644]
lenses/json.aug
lenses/kdump.aug
lenses/keepalived.aug
lenses/known_hosts.aug [new file with mode: 0644]
lenses/koji.aug [new file with mode: 0644]
lenses/krb5.aug
lenses/ldif.aug [new file with mode: 0644]
lenses/ldso.aug [new file with mode: 0644]
lenses/lightdm.aug [new file with mode: 0644]
lenses/login_defs.aug
lenses/logrotate.aug
lenses/logwatch.aug [new file with mode: 0644]
lenses/lvm.aug [new file with mode: 0644]
lenses/mcollective.aug [new file with mode: 0644]
lenses/mdadm_conf.aug
lenses/memcached.aug [new file with mode: 0644]
lenses/mke2fs.aug
lenses/modprobe.aug
lenses/modules.aug
lenses/modules_conf.aug
lenses/mongodbserver.aug [new file with mode: 0644]
lenses/monit.aug
lenses/multipath.aug
lenses/mysql.aug
lenses/nagioscfg.aug
lenses/nagiosobjects.aug
lenses/netmasks.aug [new file with mode: 0644]
lenses/networkmanager.aug [new file with mode: 0644]
lenses/networks.aug
lenses/nginx.aug [new file with mode: 0644]
lenses/nrpe.aug
lenses/nsswitch.aug
lenses/ntp.aug
lenses/ntpd.aug [new file with mode: 0644]
lenses/openshift_config.aug [new file with mode: 0644]
lenses/openshift_http.aug [new file with mode: 0644]
lenses/openshift_quickstarts.aug [new file with mode: 0644]
lenses/openvpn.aug
lenses/pagekite.aug [new file with mode: 0644]
lenses/pam.aug
lenses/pamconf.aug [new file with mode: 0644]
lenses/passwd.aug
lenses/pbuilder.aug
lenses/pg_hba.aug
lenses/php.aug
lenses/phpvars.aug
lenses/postfix_main.aug
lenses/postfix_master.aug
lenses/postfix_transport.aug [new file with mode: 0644]
lenses/postfix_virtual.aug [new file with mode: 0644]
lenses/postgresql.aug [new file with mode: 0644]
lenses/properties.aug
lenses/protocols.aug [new file with mode: 0644]
lenses/puppet.aug
lenses/puppet_auth.aug [new file with mode: 0644]
lenses/puppetfileserver.aug
lenses/pythonpaste.aug [new file with mode: 0644]
lenses/qpid.aug [new file with mode: 0644]
lenses/quote.aug [new file with mode: 0644]
lenses/rabbitmq.aug [new file with mode: 0644]
lenses/redis.aug [new file with mode: 0644]
lenses/reprepro_uploaders.aug
lenses/resolv.aug
lenses/rmt.aug [new file with mode: 0644]
lenses/rsyslog.aug [new file with mode: 0644]
lenses/rx.aug
lenses/samba.aug
lenses/schroot.aug
lenses/sep.aug
lenses/services.aug
lenses/shadow.aug [new file with mode: 0644]
lenses/shells.aug
lenses/shellvars.aug
lenses/shellvars_list.aug
lenses/simplelines.aug [new file with mode: 0644]
lenses/simplevars.aug [new file with mode: 0644]
lenses/sip_conf.aug [new file with mode: 0644]
lenses/slapd.aug
lenses/smbusers.aug [new file with mode: 0644]
lenses/solaris_system.aug
lenses/soma.aug
lenses/spacevars.aug
lenses/splunk.aug [new file with mode: 0644]
lenses/squid.aug
lenses/ssh.aug
lenses/sshd.aug
lenses/sssd.aug [new file with mode: 0644]
lenses/stunnel.aug
lenses/subversion.aug [new file with mode: 0644]
lenses/sudoers.aug
lenses/sysconfig.aug
lenses/sysconfig_route.aug [new file with mode: 0644]
lenses/sysctl.aug
lenses/syslog.aug
lenses/systemd.aug [new file with mode: 0644]
lenses/tests/test_access.aug
lenses/tests/test_activemq_conf.aug [new file with mode: 0644]
lenses/tests/test_activemq_xml.aug [new file with mode: 0644]
lenses/tests/test_aliases.aug
lenses/tests/test_anacron.aug [new file with mode: 0644]
lenses/tests/test_apt_update_manager.aug [new file with mode: 0644]
lenses/tests/test_aptcacherngsecurity.aug [new file with mode: 0644]
lenses/tests/test_aptpreferences.aug
lenses/tests/test_authorized_keys.aug [new file with mode: 0644]
lenses/tests/test_automaster.aug [new file with mode: 0644]
lenses/tests/test_automounter.aug [new file with mode: 0644]
lenses/tests/test_avahi.aug [new file with mode: 0644]
lenses/tests/test_bbhosts.aug
lenses/tests/test_bootconf.aug [new file with mode: 0644]
lenses/tests/test_build.aug [new file with mode: 0644]
lenses/tests/test_cachefilesd.aug [new file with mode: 0644]
lenses/tests/test_carbon.aug [new file with mode: 0644]
lenses/tests/test_cgconfig.aug
lenses/tests/test_channels.aug [new file with mode: 0644]
lenses/tests/test_chrony.aug [new file with mode: 0644]
lenses/tests/test_collectd.aug [new file with mode: 0644]
lenses/tests/test_cpanel.aug [new file with mode: 0644]
lenses/tests/test_cups.aug [new file with mode: 0644]
lenses/tests/test_cyrus_imapd.aug [new file with mode: 0644]
lenses/tests/test_debctrl.aug
lenses/tests/test_desktop.aug
lenses/tests/test_device_map.aug
lenses/tests/test_dhclient.aug
lenses/tests/test_dhcpd.aug
lenses/tests/test_dovecot.aug [new file with mode: 0644]
lenses/tests/test_erlang.aug [new file with mode: 0644]
lenses/tests/test_exports.aug
lenses/tests/test_fonts.aug [new file with mode: 0644]
lenses/tests/test_fstab.aug
lenses/tests/test_fuse.aug [new file with mode: 0644]
lenses/tests/test_group.aug
lenses/tests/test_grub.aug
lenses/tests/test_gshadow.aug [new file with mode: 0644]
lenses/tests/test_gtkbookmarks.aug [new file with mode: 0644]
lenses/tests/test_hosts_access.aug
lenses/tests/test_htpasswd.aug [new file with mode: 0644]
lenses/tests/test_httpd.aug
lenses/tests/test_inetd.aug
lenses/tests/test_inifile.aug
lenses/tests/test_inputrc.aug [new file with mode: 0644]
lenses/tests/test_interfaces.aug
lenses/tests/test_iproute2.aug [new file with mode: 0644]
lenses/tests/test_iptables.aug
lenses/tests/test_jaas.aug [new file with mode: 0644]
lenses/tests/test_jettyrealm.aug [new file with mode: 0644]
lenses/tests/test_jmxaccess.aug [new file with mode: 0644]
lenses/tests/test_jmxpassword.aug [new file with mode: 0644]
lenses/tests/test_json.aug
lenses/tests/test_kdump.aug
lenses/tests/test_keepalived.aug
lenses/tests/test_known_hosts.aug [new file with mode: 0644]
lenses/tests/test_koji.aug [new file with mode: 0644]
lenses/tests/test_krb5.aug
lenses/tests/test_ldif.aug [new file with mode: 0644]
lenses/tests/test_ldso.aug [new file with mode: 0644]
lenses/tests/test_lightdm.aug [new file with mode: 0644]
lenses/tests/test_logrotate.aug
lenses/tests/test_logwatch.aug [new file with mode: 0644]
lenses/tests/test_lvm.aug [new file with mode: 0644]
lenses/tests/test_mcollective.aug [new file with mode: 0644]
lenses/tests/test_memcached.aug [new file with mode: 0644]
lenses/tests/test_mke2fs.aug
lenses/tests/test_modprobe.aug
lenses/tests/test_mongodbserver.aug [new file with mode: 0644]
lenses/tests/test_multipath.aug
lenses/tests/test_mysql.aug
lenses/tests/test_nagioscfg.aug
lenses/tests/test_nagiosobjects.aug
lenses/tests/test_netmasks.aug [new file with mode: 0644]
lenses/tests/test_networkmanager.aug [new file with mode: 0644]
lenses/tests/test_networks.aug
lenses/tests/test_nginx.aug [new file with mode: 0644]
lenses/tests/test_ntp.aug
lenses/tests/test_ntpd.aug [new file with mode: 0644]
lenses/tests/test_odbc.aug
lenses/tests/test_openshift_config.aug [new file with mode: 0644]
lenses/tests/test_openshift_http.aug [new file with mode: 0644]
lenses/tests/test_openshift_quickstarts.aug [new file with mode: 0644]
lenses/tests/test_openvpn.aug
lenses/tests/test_pagekite.aug [new file with mode: 0644]
lenses/tests/test_pam.aug
lenses/tests/test_pamconf.aug [new file with mode: 0644]
lenses/tests/test_passwd.aug
lenses/tests/test_pg_hba.aug
lenses/tests/test_php.aug
lenses/tests/test_phpvars.aug
lenses/tests/test_postfix_main.aug
lenses/tests/test_postfix_master.aug
lenses/tests/test_postfix_transport.aug [new file with mode: 0644]
lenses/tests/test_postfix_virtual.aug [new file with mode: 0644]
lenses/tests/test_postgresql.aug [new file with mode: 0644]
lenses/tests/test_properties.aug
lenses/tests/test_protocols.aug [new file with mode: 0644]
lenses/tests/test_puppet_auth.aug [new file with mode: 0644]
lenses/tests/test_pythonpaste.aug [new file with mode: 0644]
lenses/tests/test_qpid.aug [new file with mode: 0644]
lenses/tests/test_quote.aug [new file with mode: 0644]
lenses/tests/test_rabbitmq.aug [new file with mode: 0644]
lenses/tests/test_redis.aug [new file with mode: 0644]
lenses/tests/test_resolv.aug
lenses/tests/test_rmt.aug [new file with mode: 0644]
lenses/tests/test_rsyslog.aug [new file with mode: 0644]
lenses/tests/test_rx.aug
lenses/tests/test_samba.aug
lenses/tests/test_services.aug
lenses/tests/test_shadow.aug [new file with mode: 0644]
lenses/tests/test_shells.aug
lenses/tests/test_shellvars.aug
lenses/tests/test_shellvars_list.aug
lenses/tests/test_simplelines.aug [new file with mode: 0644]
lenses/tests/test_simplevars.aug [new file with mode: 0644]
lenses/tests/test_sip_conf.aug [new file with mode: 0644]
lenses/tests/test_slapd.aug
lenses/tests/test_smbusers.aug [new file with mode: 0644]
lenses/tests/test_splunk.aug [new file with mode: 0644]
lenses/tests/test_ssh.aug
lenses/tests/test_sshd.aug
lenses/tests/test_sssd.aug [new file with mode: 0644]
lenses/tests/test_subversion.aug [new file with mode: 0644]
lenses/tests/test_sudoers.aug
lenses/tests/test_sysconfig.aug
lenses/tests/test_sysconfig_route.aug [new file with mode: 0644]
lenses/tests/test_sysctl.aug
lenses/tests/test_syslog.aug
lenses/tests/test_systemd.aug [new file with mode: 0644]
lenses/tests/test_thttpd.aug [new file with mode: 0644]
lenses/tests/test_tuned.aug [new file with mode: 0644]
lenses/tests/test_up2date.aug [new file with mode: 0644]
lenses/tests/test_updatedb.aug [new file with mode: 0644]
lenses/tests/test_vfstab.aug [new file with mode: 0644]
lenses/tests/test_vmware_config.aug [new file with mode: 0644]
lenses/tests/test_xinetd.aug
lenses/tests/test_xml.aug
lenses/tests/test_xorg.aug
lenses/tests/test_xymon.aug [new file with mode: 0644]
lenses/tests/test_xymon_alerting.aug [new file with mode: 0644]
lenses/tests/test_yum.aug
lenses/thttpd.aug [new file with mode: 0644]
lenses/tuned.aug [new file with mode: 0644]
lenses/up2date.aug [new file with mode: 0644]
lenses/updatedb.aug [new file with mode: 0644]
lenses/util.aug
lenses/vfstab.aug [new file with mode: 0644]
lenses/vmware_config.aug [new file with mode: 0644]
lenses/vsftpd.aug
lenses/webmin.aug
lenses/xendconfsxp.aug
lenses/xinetd.aug
lenses/xml.aug
lenses/xorg.aug
lenses/xymon.aug [new file with mode: 0644]
lenses/xymon_alerting.aug [new file with mode: 0644]
lenses/yum.aug
man/Makefile.in
man/augparse.1
man/augparse.pod
man/augtool.1
man/augtool.pod
src/Makefile.am
src/Makefile.in
src/augeas.c
src/augeas.h
src/augeas_sym.version
src/augparse.c
src/augrun.c
src/augtool.c
src/builtin.c
src/errcode.h
src/fa.c
src/fa.h
src/fa_sym.version
src/get.c
src/internal.c
src/internal.h
src/jmt.c
src/lens.c
src/lens.h
src/parser.c
src/parser.h
src/pathx.c
src/put.c
src/regexp.c
src/syntax.c
src/syntax.h
src/transform.c
src/transform.h
src/try
tests/Makefile.am
tests/Makefile.in
tests/cutest.c
tests/cutest.h
tests/fatest.c
tests/leak.c [new file with mode: 0644]
tests/lens-activemq_conf.sh [new file with mode: 0755]
tests/lens-activemq_xml.sh [new file with mode: 0755]
tests/lens-anacron.sh [new file with mode: 0755]
tests/lens-apt_update_manager.sh [new file with mode: 0755]
tests/lens-aptcacherngsecurity.sh [new file with mode: 0755]
tests/lens-authorized_keys.sh [new file with mode: 0755]
tests/lens-automaster.sh [new file with mode: 0755]
tests/lens-automounter.sh [new file with mode: 0755]
tests/lens-avahi.sh [new file with mode: 0755]
tests/lens-bootconf.sh [new file with mode: 0755]
tests/lens-build.sh [new file with mode: 0755]
tests/lens-cachefilesd.sh [new file with mode: 0755]
tests/lens-carbon.sh [new file with mode: 0755]
tests/lens-channels.sh [new file with mode: 0755]
tests/lens-chrony.sh [new file with mode: 0755]
tests/lens-collectd.sh [new file with mode: 0755]
tests/lens-cpanel.sh [new file with mode: 0755]
tests/lens-cups.sh [new file with mode: 0755]
tests/lens-cyrus_imapd.sh [new file with mode: 0755]
tests/lens-dovecot.sh [new file with mode: 0755]
tests/lens-erlang.sh [new file with mode: 0755]
tests/lens-fonts.sh [new file with mode: 0755]
tests/lens-fuse.sh [new file with mode: 0755]
tests/lens-gshadow.sh [new file with mode: 0755]
tests/lens-gtkbookmarks.sh [new file with mode: 0755]
tests/lens-htpasswd.sh [new file with mode: 0755]
tests/lens-inputrc.sh [new file with mode: 0755]
tests/lens-iproute2.sh [new file with mode: 0755]
tests/lens-jaas.sh [new file with mode: 0755]
tests/lens-jettyrealm.sh [new file with mode: 0755]
tests/lens-jmxaccess.sh [new file with mode: 0755]
tests/lens-jmxpassword.sh [new file with mode: 0755]
tests/lens-known_hosts.sh [new file with mode: 0755]
tests/lens-koji.sh [new file with mode: 0755]
tests/lens-ldif.sh [new file with mode: 0755]
tests/lens-ldso.sh [new file with mode: 0755]
tests/lens-lightdm.sh [new file with mode: 0755]
tests/lens-logwatch.sh [new file with mode: 0755]
tests/lens-lvm.sh [new file with mode: 0755]
tests/lens-mcollective.sh [new file with mode: 0755]
tests/lens-memcached.sh [new file with mode: 0755]
tests/lens-mongodbserver.sh [new file with mode: 0755]
tests/lens-netmasks.sh [new file with mode: 0755]
tests/lens-networkmanager.sh [new file with mode: 0755]
tests/lens-nginx.sh [new file with mode: 0755]
tests/lens-ntpd.sh [new file with mode: 0755]
tests/lens-openshift_config.sh [new file with mode: 0755]
tests/lens-openshift_http.sh [new file with mode: 0755]
tests/lens-openshift_quickstarts.sh [new file with mode: 0755]
tests/lens-pagekite.sh [new file with mode: 0755]
tests/lens-pamconf.sh [new file with mode: 0755]
tests/lens-postfix_transport.sh [new file with mode: 0755]
tests/lens-postfix_virtual.sh [new file with mode: 0755]
tests/lens-postgresql.sh [new file with mode: 0755]
tests/lens-protocols.sh [new file with mode: 0755]
tests/lens-puppet_auth.sh [new file with mode: 0755]
tests/lens-pythonpaste.sh [new file with mode: 0755]
tests/lens-qpid.sh [new file with mode: 0755]
tests/lens-quote.sh [new file with mode: 0755]
tests/lens-rabbitmq.sh [new file with mode: 0755]
tests/lens-redis.sh [new file with mode: 0755]
tests/lens-rmt.sh [new file with mode: 0755]
tests/lens-rsyslog.sh [new file with mode: 0755]
tests/lens-shadow.sh [new file with mode: 0755]
tests/lens-simplelines.sh [new file with mode: 0755]
tests/lens-simplevars.sh [new file with mode: 0755]
tests/lens-sip_conf.sh [new file with mode: 0755]
tests/lens-smbusers.sh [new file with mode: 0755]
tests/lens-splunk.sh [new file with mode: 0755]
tests/lens-sssd.sh [new file with mode: 0755]
tests/lens-subversion.sh [new file with mode: 0755]
tests/lens-sysconfig_route.sh [new file with mode: 0755]
tests/lens-systemd.sh [new file with mode: 0755]
tests/lens-thttpd.sh [new file with mode: 0755]
tests/lens-tuned.sh [new file with mode: 0755]
tests/lens-up2date.sh [new file with mode: 0755]
tests/lens-updatedb.sh [new file with mode: 0755]
tests/lens-vfstab.sh [new file with mode: 0755]
tests/lens-vmware_config.sh [new file with mode: 0755]
tests/lens-xymon.sh [new file with mode: 0755]
tests/lens-xymon_alerting.sh [new file with mode: 0755]
tests/modules/fail_shadow_union.aug
tests/modules/fail_square_consistency.aug [new file with mode: 0644]
tests/modules/fail_square_consistency_del.aug [new file with mode: 0644]
tests/modules/fail_square_dup_key.aug [new file with mode: 0644]
tests/modules/fail_square_lens_type.aug [new file with mode: 0644]
tests/modules/pass_compose_func.aug
tests/modules/pass_nocase.aug
tests/modules/pass_square.aug
tests/modules/pass_square_rec.aug [new file with mode: 0644]
tests/root/etc/crontab [deleted file]
tests/root/etc/gshadow [new file with mode: 0644]
tests/root/etc/shadow [new file with mode: 0644]
tests/root/etc/squirrelmail/config.php [deleted file]
tests/root/etc/sysconfig/network-scripts/ifcfg-Auto-ALICE-WLAN38_(automatisch) [new file with mode: 0644]
tests/root/etc/sysconfig/network-scripts/ifcfg-Auto_FRITZ!Box_Fon_WLAN_7112 [new file with mode: 0644]
tests/root/etc/sysconfig/network-scripts/ifcfg-lo.rpmsave [new file with mode: 0644]
tests/root/etc/sysconfig/network-scripts/ifcfg-weird [!] (used to fail) [new file with mode: 0644]
tests/root/lvm.conf~ [new file with mode: 0644]
tests/run.tests
tests/test-api.c
tests/test-augtool-modify-root.sh
tests/test-augtool.sh
tests/test-events-saved.sh
tests/test-load.c
tests/test-preserve.sh
tests/test-put-mount-augnew.sh [new file with mode: 0755]
tests/test-put-mount-augsave.sh [new file with mode: 0755]
tests/test-put-mount.sh [new file with mode: 0755]
tests/test-put-symlink-augnew.sh [new file with mode: 0755]
tests/test-put-symlink-augsave.sh [new file with mode: 0755]
tests/test-put-symlink-augtemp.sh [new file with mode: 0755]
tests/test-put-symlink.sh
tests/test-run.c
tests/test-save-empty.sh
tests/test-save.c
tests/test-xpath.c
tests/xpath.tests

diff --git a/AUTHORS b/AUTHORS
index df63f95..28c68e3 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -10,47 +10,110 @@ Committers:
   Michael Chapman             <mike@very.puzzling.org>
   Dominic Cleal               <dcleal@redhat.com>
   Francis Giraldeau           <francis.giraldeau@revolutionlinux.com>
-  Raphael Pinson              <raphink@gmail.com>
+  Raphaël Pinson              <raphael.pinson@camptocamp.com>
 
 Contributions by:
 
+  Jasper Lievisse Adriaanse   <jasper@humppa.nl>
   Partha Aji                  <paji@redhat.com>
+  Erik B. Andersen            <erik.b.andersen@gmail.com>
   Sebastien Aperghis-Tramoni  <sebastien@aperghis.net>
   Mathieu Arnold              <mat@FreeBSD.org>
   Sergio Ballestrero
   Sylvain Baubeau             <bob@glumol.com>
   Oliver Beattie              <oliver@obeattie com>
+  Tim Bishop                  <tim@bishnet.net>
   Anders F Björklund          <afb@users.sourceforge.net>
   Aurelien Bompard            <aurelien@bompard.org>
   Lorenzo Dalrio              <lorenzo.dalrio@gmail.com>
   Francois Deppierraz         <francois.deppierraz@camptocamp.com>
+  Luc Didry                   <luc@didry.org>
   Dominique Dumont            <dominique.dumont@hp.com>
   Craig Dunn                  <craig@craigdunn.org>
   Free Ekanayaka              <free@64studio.com>
+  Michal Filka                <michal.filka@suse.cz>
+  Freakin                     <brendanaye@gmail.com>
   Marc Fournier               <marc.fournier@camptocamp.com>
+  Davide Guerri               <davide.guerri@gmail.com>
+  Andy Grimm                  <agrimm@redhat.com>
+  Travis Groth                <tgroth@gmail.com>
   Adam Helms                  <helms.adam@gmail.com>
   Harald Hoyer                <harald@redhat.com>
   Shannon Hughes              <shughes@redhat.com>
   Richard W.M. Jones          <rjones@redhat.com>
   Simon Josi                  <josi@puzzle.ch>
   Bryan Kearney               <bkearney@redhat.com>
+  Jason Kincl                 <jkincl@gmail.com>
+  Francois Lebel              <francoislebel@gmail.com>
   Frédéric Lespez             <frederic.lespez@free.fr>
+  Jasper Lievisse Adriaanse   <jasper@humppa.nl>
   Tom Limoncelli              <tal@whatexit.org>
   Erinn Looney-Triggs         <erinn.looneytriggs@gmail.com>
+  Duncan Mac-Vicar P.         <dmacvicar@suse.de>
+  Jeroen van Meeuwen          <vanmeeuwen@kolabsys.com>
   Jim Meyering                <meyering@redhat.com>
   Sean Millichamp             <sean@bruenor.org>
+  Tim Mooney                  <Tim.Mooney@ndsu.edu>
   Joel Nimety                 <jnimety@perimeterusa.com>
+  Matthaus Owens              <matthaus@puppetlabs.com>
   Matt Palmer                 <matt@anchor.net.au>
   Bill Pemberton              <wfp5p@virginia.edu>
+  Dan Prince                  <dprince@redhat.com>
   Alan Pevec                  <apevec@redhat.com>
+  Brett Porter                <brett@apache.org>
   Robin Lee Powell            <rlpowell@digitalkingdom.org>
+  Michael Pimmer              <blubb@fonfon.at>
+  Branan Purvine-Riley        <branan@puppetlabs.com>
+  Andrew Replogle             <areplogl@redhat.com>
+  Pat Riehecky                <riehecky@fnal.gov>
+  Lubomir Rintel              <lubo.rintel@gooddata.com>
   Roman Rakus                 <rrakus@redhat.com>
+  David Salmen                <dsalmen@dsalmen.com>
+  Carlos Sanchez              <csanchez@maestrodev.com>
   Satoru SATOH                <satoru.satoh@gmail.com>
   Nicolas Valcárcel Scerpella <nvalcarcel@ubuntu.com>
+  Gonzalo Servat              <gservat@gmail.com>
   Nahum Shalman               <nshalman elys com>
   Tim Stoop                   <tim.stoop@gmail.com>
   Laine Stump                 <laine@laine.org>
   Jiri Suchomel               <jsuchome@suse.cz>
   Ivana Hutarova Varekova     <varekova@redhat.com>
+  Simon Vocella               <voxsim@gmail.com>
   Frederik Wagner             <wagner@lrz.de>
   Dean Wilson                 <dwilson@blueowl.it>
+  Igor Pashev                 <pashev.igor@gmail.com>
+  Micah Anderson              <micah@riseup.net>
+  Domen Kožar                 <domen@dev.si>
+  Filip Andres                <filip.andres@gooddata.com>
+  Josh Kayse                  <jokajak@gmail.com>
+  Jacob M. McCann             <jacob.m.mccann@usps.gov>
+  Danny Yates                 <danny@codeaholics.org>
+  Terence Haddock             <thaddock@tripi.com>
+  Athir Nuaimi                <athir@nuaimi.com>
+  Ian Berry                   <iberry@barracuda.com>
+  Gabriel de Perthuis          <g2p.code+augeas@gmail.com>
+  Brian Harrington            <bharrington@redhat.com>
+  Mathieu Alorent             <malorent@kumy.net>
+  Rob Tucker                  <rtucker@mozilla.com>
+  Stephen P. Schaefer
+  Pascal Lalonde              <plalonde@google.com>
+  Tom Hendrikx                <tom@whyscream.net>
+  Yanis Guenane               <yguenane@gmail.com>
+  Esteve Fernandez            <esteve.fernandez@gmail.com>
+  Dietmar Kling               <baldur@email.de>
+  Michael Haslgrübler         <work-michael@haslgruebler.eu>
+  Andrew N Golovkov           <a.golovkov@dwteam.ru>
+  Matteo Cerutti              <matteo.cerutti@hotmail.co.uk>
+  Tomas Hoger                 <thoger@redhat.com>
+  Tomas Klouda                <tomas.klouda@gooddata.com>
+  Kaarle Ritvanen             <kaarle.ritvanen@datakunkku.fi>
+  François Maillard           <fmaillard@gmail.com>
+  Mykola Nikishov             <mn@mn.com.ua>
+  Robert Drake                <rdrake@direcpath.com>
+  Simon Séhier                <simon.sehier@camptocamp.com>
+  Vincent Brillault           <vincent.brillault@cern.ch>
+  Mike Latimer                <mlatimer@suse.com>
+  Lorenzo M. Catucci          <lorenzo@sancho.ccd.uniroma2.it>
+  Joel Loudermilk             <joel@loudermilk.org>
+  Frank Grötzner              <frank@unforgotten.de>
+  Pino Toscano                <ptoscano@redhat.com>
index a7764d4..f0685aa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2014-10-31  Chris Hollowell  <hollowec@bnl.gov>
+
+       Cgconfig: permit quoted spaces in parameter values
+       Allow quoted spaces in controller parameter value assignments, making valid
+       statements such as the following permissible:
+
+         blkio.throttle.read_iops_device="8:0 50";
+
+2014-10-30  Kenaniah Cerny  <kenaniah@users.noreply.github.com>
+
+       Added config.d files to the filter
+       Used by systems running Red Hat or a variant
+
+2014-10-28  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Build: remove unused indent definition
+
+2014-10-22  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Update NEWS
+
+       Httpd: Allow comparison operators in tags (GH #154)
+
+2014-10-17  Tomáš Chvátal  <tomas.chvatal@gmail.com>
+
+       Add more possible SUSE extensions to read from multipath config.
+
+2014-10-17  Alastair Lynn  <arplynn@gmail.com>
+
+       Inifile: allow single-character keys
+
+2014-10-17  Yanis Guenane  <yguenane@gmail.com>
+
+       xml.aug: Allow nmotoken rather than plain word after !DOCTYPE
+       Currently, the lens only accepts a word after the !DOCTYPE word.
+
+       A - valid - Doctype can have the following form :
+       <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> making the xml
+       file invalid with the current lens. This commits aims for the lens
+       to accept nmtoken rather than strict word after the DOCTYPE string.
+
+2014-10-17  fonfon  <blubb@fonfon.at>
+
+       Pagekite: new lens and tests
+
+2014-09-23  Dominic Cleal  <dcleal@redhat.com>
+
+       Iptables: parse /etc/sysconfig/iptables.save
+       Fixes RHBZ#1144651
+
+2014-09-23  Pino Toscano  <ptoscano@redhat.com>
+
+       LVM: handle also /etc/lvm/lvm.conf
+       The syntax should be the same, so use the lvm lens also for the main
+       lvm2 configuration file.
+
+       LVM: support negative numbers
+       Use Rx.relinteger instead of Rx.integer so negative numbers as values
+       can be read.
+
+2014-09-18  Dominic Cleal  <dcleal@redhat.com>
+
+       Systemd: parse environment variables where only value is quoted
+       Fixes regression introduced in 5226ae7, which added support to parse fully
+       quoted "NAME=value" environment vars.  To support both, this commit stores
+       the quotes in the value if it's only the value quoted.
+
+       Fixes RHBZ#1138508
+
+2014-09-12  Dominic Cleal  <dcleal@redhat.com>
+
+       Dhclient: parse hash statements with dhcp-eval strings
+
+       Systemd: parse semicolons inside entry values, not as EOL comments
+       Fixes RHBZ#1139498
+
+2014-09-09  Dominic Cleal  <dcleal@redhat.com>
+
+       Kdump: parse new options, permit EOL comments, refactor
+       Fixes RHBZ#1139298
+
+       Test_Kdump: fix test of complete config file
+
+2014-09-05  Dominic Cleal  <dcleal@redhat.com>
+
+       Xml: enable CDATA parsing
+       Fixes GitHub #80
+
+2014-09-04  Dominic Cleal  <dcleal@redhat.com>
+
+       * src/augeas.c (unlink_removed_files): ensure aug_save returns non-zero result   when unable to delete files
+       Fixes RHBZ#1091143
+
+2014-09-03  Dominic Cleal  <dcleal@redhat.com>
+
+       Syslog: permit IPv6 loghost addresses
+       Fixes RHBZ#1129388
+
+       Aliases: permit missing whitespace between colon and recipients
+
+2014-07-24  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       NEWS
+
+       Xml: Allow backslash in #attribute values
+
+2014-07-21  Dominic Cleal  <dcleal@redhat.com>
+
+       Services: permit colons in service name
+       Fixes RHBZ#1121263
+
+2014-07-09  Dominic Cleal  <dcleal@redhat.com>
+
+       Rmt: new lens to parse /etc/default/rmt
+       Fixes RHBZ#1100549
+
+       Systemd: parse /etc/sysconfig/*.systemd as used in 389-ds
+       Fixes RHBZ#1083022
+
+       Shellvars: support $(( .. )) arithmetic expansion in variable assignment
+       Fixes RHBZ#1100550
+
+       Systemd: allow quoted Environment key=value pairs
+       Fixes RHBZ#1100547
+
+2014-06-30  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Simplevars: Support empty values
+
+2014-06-26  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Sshd: support doseol and standardize code
+
+       Sshd: Use Build.opt_list
+
+       Sshd: Also make Host entries case-insensitive
+
+       Ssh: support case-insensitive entries everywhere
+
+2014-06-24  Andy Grimm  <agrimm@redhat.com>
+
+       Add other valid controllers to cgconfig lens
+
+2014-06-19  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Xymon_Alerting: refactor lens (GH issue #89)
+
+2014-06-11  Nick  <npiace@mars.asu.edu>
+
+       Sudoers: Allow quoted string in default str/bool parameters
+         Made string or bool parameters able to be quoted strings like non-bool strings.
+         Also added "mailfrom" parameter to the list of string/bool parameters
+         and removed duplicates from that list.
+
+2014-06-06  Frank Grötzner  <frank@unforgotten.de>
+
+       add support for mtu relevant parameters fragment and mssfix
+
+2014-06-05  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Update NEWS and AUTHORS
+
+2014-06-05  fonk  <frank@unforgotten.de>
+
+       OpenVPN/ Add support for setting script-security
+       Setting script security is especially needed when using learn-address,
+       which we can already set via augeas but is useless without script-security.
+
+2014-06-04  Dominic Cleal  <dcleal@redhat.com>
+
+       * man/augtool.pod: fix description of 'move' alias
+
+2014-06-03  Dominic Cleal  <dcleal@redhat.com>
+
+       * src/augrun.c: remove unused "filename" argument from dump-xml command
+       Fixes RHBZ#1100106
+
+       * man/augtool.pod: update man page with --span option
+
+2014-06-02  Raphaël Pinson  <raphink@gmail.com>
+
+       Update AUTHORS and NEWS
+
+2014-06-02  Joel Loudermilk  <joel@loudermilk.org>
+
+       Multipath: add support for rr_min_io_rq
+
+2014-06-02  Dominic Cleal  <dcleal@redhat.com>
+
+       * man/augtool.pod: update man page with new commands
+       Fixes RHBZ#1100077
+
+       * src/augtool.c: add command aliases to autocomplete
+       Fixes RHBZ#1100184
+
+       Ldso: handle "hwcap" lines
+       Fixes #100
+
+       Rsyslog: parse property filters and file actions with complex templates
+       Fixes RHBZ#1083016
+
+2014-06-02  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Update NEWS
+
+2014-06-02  Pat Riehecky  <riehecky@fnal.gov>
+
+       Added tuned lense
+
+2014-06-02  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Update NEWS and AUTHORS
+
+2014-06-02  Lorenzo M. Catucci  <lorenzo@sancho.ccd.uniroma2.it>
+
+       Add a little bit of ducumentation
+       for both the shadow and the gshadow lenses
+
+2014-06-02  Lorenzo M. Catucci  <lorenzo@sancho.ccd.uniroma2.it>
+
+       Add a lens for /etc/gshadow file format
+       and wire-up its test to the runner's list in Makefile.am
+
+       Also add a mock /etc/gshadow in tests/root
+
+2014-06-02  Lorenzo M. Catucci  <lorenzo@sancho.ccd.uniroma2.it>
+
+       Add a lens for /etc/shadow file format
+       and wire-up its test to the runner's list in Makefile.am
+
+       Also add a mock /etc/shadow in tests/root
+
+2014-06-02  Lorenzo M. Catucci  <lorenzo@sancho.ccd.uniroma2.it>
+
+       Refactor and document
+        - import already defined lenses from the respective modules
+          instead of defining them internally
+
+        - add a missing \r to the excluded chars in sto_to_col
+
+        - add some documentation
+
+2014-05-14  Michael Tiernan  <michael.tiernan@gmail.com>
+
+       * HACKING: fix git repository URL
+
+2014-05-11  Mike Latimer  <mlatimer@suse.com>
+
+       Device_map: Parse all device.map files under /boot
+
+2014-05-08  Raphaël Pinson  <raphink@gmail.com>
+
+       CPanel: Allow colons in keys
+
+       CPanel: New lens to parse cpanel.config files
+
+2014-05-05  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Simplevars: Support flags
+
+2014-04-24  Raphaël Pinson  <raphink@gmail.com>
+
+       Shellvars: Allow any kind of quoted values in block conditions (GH issue #118)
+
+2014-04-17  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Sssd: Allow ; for comments
+
+2014-04-15  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Allow empty quoted values (GH issue #115)
+
+       Allow continued lines inside quoted value (GH issue #104)
+
+2014-04-12  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Update NEWS and AUTHORS
+
+2014-04-12  Robert Drake  <rdrake@direcpath.com>
+
+       syslog, support for "# !" style comments
+       This makes it so if a comment begins with "# " then +, -, or ! it's
+       treated as a comment and won't have a special meaning.
+
+       fixes #65
+
+2014-04-12  Robert Drake  <rdrake@direcpath.com>
+
+       dhclient, add support for option modifiers
+       This adds basic support for append|prepend|supercede|default
+
+       I believe it has the same limitations as the existing "option" support.
+       Any arguments supplied to the option can't have a space.
+
+       fixes #95
+
+2014-04-12  Vincent Brillault  <vincent.brillault@cern.ch>
+
+       pam: partial support of arguments enclosed in [ .. ]
+       Pam.conf(5) manual page states 'module-arguments are a space separated list
+       of tokens that can be used to modify the specific behavior of the given PAM.
+       Such arguments will be documented for each individual module. Note, if you
+       wish to include spaces in an argument, you should surround that argument with
+       square brackets.', but such arguments are not supported by the pam lenses, as
+       expressed in the comments 'This isn't entirely right: arguments enclosed in
+       [ .. ] are allowed and should be parsed as one'.
+
+       This commit add basic support of such arguments via the regex:
+       '/(\[[^]#\n]+\]|[^[#\n \t][^#\n \t]*)/'
+
+       It is only a partial support as some corner cases are not covered:
+       - Multi line arguments (lines ending with '\')
+       - Arguments containing a '[' (escaped via '\')
+
+2014-04-12  Robert Drake  <rdrake@direcpath.com>
+
+       added seq to vim syntax highlight
+
+2014-04-03  Simon Séhier  <simon.sehier@camptocamp.com>
+
+       add missing } in file path for nagios/icinga objects
+
+2014-03-13  Raphaël Pinson  <raphink@gmail.com>
+
+       UpdateDB: Update tests to ensure spaces around = are OK
+
+       Update NEWS
+
+       UpdateDB: New lens to parse /etc/updatedb.conf
+
+2014-03-13  Dominic Cleal  <dcleal@redhat.com>
+
+       * augeas.spec.in: improve augeas-libs description
+
+2014-03-12  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Httpd: Add unit test for comment on next line
+
+       Httpd: Define an eol_comment in section to allow for \n before comment
+
+2014-03-11  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Httpd: Allow eol comments after section tags
+
+2014-03-06  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Rx: Add iso_8601 simple regex
+
+       Update NEWS
+
+       Update AUTHORS and NEWS
+
+2014-03-06  Robert Drake  <rdrake@direcpath.com>
+
+       dhcpd, style and test changes suggested by raphink
+       I also updated the NEWS entry to note the incompatible change
+
+       dhcpd, fix for put on dhcp option records
+       Type cannot be blank.  I fixed this by making it use record instead of
+       nesting through "type"
+
+       dhcpd, fix for key block puts
+       I discovered this after thinking I was done.  It actually was a problem
+       before I started messing with the code but I didn't notice it because
+       there was never any test for keys.
+
+       dhcpd, removed unused variable and reformatted
+       stmt_subclass was a little too cluttered so I changed it to multiple
+       lines for readability.  I had also introduced an unused lens sep_to_ncl
+       which I removed.
+
+2014-03-06  Robert Drake  <rdrake@direcpath.net>
+
+       dhcpd, changing quotes on stmt_block_arg
+       This patch can break users parsers.
+
+       Fixes failover-peer, shared-network, class, host, zone, group, and "on" to
+       handle quoted values properly.
+
+       It also allows optional semicolon at the end of key {} block.
+
+2014-03-06  Robert Drake  <rdrake@direcpath.net>
+
+       dhcpd, adding support for "on" statement
+       For things like:
+
+       on commit {
+             set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
+             set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
+       }
+
+2014-03-06  Robert Drake  <rdrake@direcpath.net>
+
+       dhcpd, added fddi to stmt_hardware
+       getting pretty obscure..
+
+2014-03-06  Robert Drake  <rdrake@direcpath.net>
+
+       dhcpd, adding support for set command
+       This allows you to define variables in your dhcp configuration.  They
+       can be arbitrarily complicated.
+
+       Things like this:
+
+             set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
+             set ClientMac = binary-to-ascii(16, 8, ":" , substring(hardware, 1, 6));
+
+       I also added most of the rest of the functions from dhcp-eval and listed
+       the limitations of the current parser.  I don't think I'm going to be
+       able to fix most of it but I think I'm getting into obscure features
+       that most people don't bother using.
+
+       At this point if they need to do very strange class maps they could put
+       them in an include file and not have augeas parse it.
+
+2014-03-06  Robert Drake  <rdrake@direcpath.net>
+
+       dhcpd, added support for match if suffix|option
+       I also relaxed the rules on matching quoted and unquoted values.
+
+       Things like:
+           match if suffix (option vendor-class-identifier,6)="123456";
+       or
+           match if option vendor-class-identifier="Brave, Warrior Pidgins";
+
+       work now.
+
+2014-03-06  Robert Drake  <rdrake@direcpath.net>
+
+       dhcpd fix to allow subclasses values to be quoted
+       DHCP subclass values can have spaces in them.
+
+       Here is an example:
+       subclass "consoles" "Xbox 360";
+       subclass "consoles" "Nintendo 3DS";
+       subclass "consoles" Wii;
+       subclass "consoles" NintendoDS;
+
+2014-03-06  Robert Drake  <rdrake@direcpath.net>
+
+       dhcpd known-clients allows spaces in it's value
+       This is a fix for lines like these:
+
+          deny unknown clients;
+          deny known clients;
+          allow known clients;
+          allow unknown clients;
+
+2014-03-06  Robert Drake  <rdrake@direcpath.net>
+
+       dhcpd, fix for quoted characters in members of
+       Some of my "allow members of" statements have more complicated names
+       that include things like parenthesis.  This change makes it so semicolon
+       and space are the only things not allowed in barewords, and quotes and
+       newlines are the only thing not allowed in quoted things.
+
+2014-03-06  Robert Drake  <rdrake@direcpath.net>
+
+       dhcpd, fix whitespace problems with blocks
+       Most blocks should support braces at the end of a line or
+       on the next line.
+
+       Like this:
+
+       class "test class"
+       {
+
+       }
+
+       or
+
+       class testclass {}
+
+2014-03-06  Robert Drake  <rdrake@direcpath.net>
+
+       dhcpd, expanding support for user-defined-options
+       This incorporates changes suggested by raphink.
+
+       It should be able to parse all of the following DHCP options now:
+
+           option name-service-search code 117 = array of unsigned integer 16;
+           option domain-search code 119 = string;
+           option sip-servers code 120 = string;
+           option classless-static-route code 121 = string;
+           option space cable-labs;
+           option cable-labs.tsp-primary-dhcp-server code 1 = ip-address;
+           option cable-labs.tsp-secondary-dhcp-server code 2 = ip-address;
+           option cable-labs.tsp-provisioning-server code 3 = string;
+           option cable-labs.tsp-as-backoff-retry code 4 = { unsigned integer 32, unsigned integer 32, unsigned integer 32 };
+           option cable-labs.tsp-ap-backoff-retry code 5 = { unsigned integer 32, unsigned integer 32, unsigned integer 32 };
+           option cable-labs.tsp-kerberos-realm-name code 6 = string;
+           option cable-labs.tsp-ticket-granting-server-utilization code 7 = boolean;
+           option cable-labs.tsp-provisioning-timer code 8 = unsigned integer 8;
+           option cable-labs-encapsulation code 122 = encapsulate cable-labs;
+           option tftp-server-address code 150 = array of ip-address;
+           option ip-telephone code 176 = string;
+           option wpad-url code 252 = text;
+
+2014-03-06  Robert Drake  <rdrake@direcpath.net>
+
+       dhcpd, add support for omapi-key statement
+       You can use this along with omapi-port to specify a secure way to talk
+       to your DHCP server.
+
+       key myspecialkey {
+           algorithm hmac-md5;
+           secret "base64string==";
+       }
+
+       omapi-key myspecialkey;
+       omapi-port 7911;
+
+2014-03-06  Robert Drake  <rdrake@direcpath.net>
+
+       dhcpd, add support for named groups
+       Things like group Special_users {
+
+       }
+
+2014-03-04  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Update NEWS
+
+       Desktop: Allow @ in keys (GH issue #92)
+
+2014-03-03  KaMichael  <KaMichael@users.noreply.github.com>
+
+       Group: Dropped nisentry (not valid here)
+
+       group: Testcase for NIS default
+
+2014-03-03  KaMichael  <KaMichael@gmail.com>
+
+       Update group.aug
+
+       Update group.aug to parse NIS entries
+
+2014-02-28  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Update NEWS
+
+2014-02-28  Pat Riehecky  <riehecky@fnal.gov>
+
+       Added chrony lense
+
+2014-02-25  Dominic Cleal  <dcleal@redhat.com>
+
+       Krb5: permit braces in values when not in sub-section
+       Fixes RHBZ#1066419
+
+2014-02-21  Dominic Cleal  <dcleal@redhat.com>
+
+       Keepalived: add more virtual/real server settings and checks
+       Fixes RHBZ#1064388
+
+2014-02-21  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       NetworkManager: Use the Quote module, support # in values (no eol comments)
+
+2014-02-20  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       AptPreferences: Support spaces in origin fields
+
+       Remove mercurial legacy files
+
+       Sshd: Allow all types of issues in Match groups (GH issue #75)
+
+       Update NEWS
+
+       Add cp to manpage (issue #78)
+
+       Update AUTHORS and NEWS
+
+2014-02-20  Mykola Nikishov  <mn@mn.com.ua>
+
+       Support configuration file for Squid 3
+
+2014-02-12  Dominic Cleal  <dcleal@redhat.com>
+
+       IPRoute2: handle "/" in protocol names, swap ID and name fields
+       This is an incompatible change.
+
+       Fixes RHBZ#1063968
+
+2014-02-12  Dominic Cleal  <dcleal@redhat.com>
+
+       IPRoute2: handle hex IDs and hyphens in names, as present in rt_dsfield
+       Fixes RHBZ#1063961
+
+2014-02-10  Dominic Cleal  <dcleal@redhat.com>
+
+       Shellvars: handle case statements with same-line ;; tokens
+       Fixes RHBZ#1033799
+
+2014-02-08  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Update NEWS
+
+       Fix release date for 1.2.0 in NEWS
+
+       Add Known_Hosts lens
+
+2014-01-30  Miguel Armas  <kuko@canarytek.com>
+
+       Grub: handle "foreground" option
+       Fixes RHBZ#1059383
+
+2014-01-27  David Lutterkort  <lutter@watzmann.net>
+
+       Version 1.2.0
+
+2014-01-27  Raphaël Pinson  <raphink@gmail.com>
+
+       Update NEWS with span info in XML dump
+
+2014-01-27  Dominic Cleal  <dcleal@redhat.com>
+
+       Add %check to RPM spec, fix download URL
+         * augeas.spec.in: add %check to run `make check` during build, skipping
+           SELinux tests which don't work in a mock environment
+
+       Original %check patch from Richard Jones <rjones@redhat.com>
+
+2014-01-27  Raphaël Pinson  <raphink@gmail.com>
+
+       Add span info to XML dump
+       For a node, add span information for the label, value, and node overall if
+       it is present in the tree. The resulting XML looks like
+
+         <node label="..." file="..." path="...">
+           <span for="label" start="..." end="..."/>
+           <span for="value" start="..." end="..."/>
+           <span for="node" start="..." end="..."/>
+           <value>...</value>
+         </node>
+
+2014-01-27  David Lutterkort  <lutter@watzmann.net>
+
+       Rename build/aux to build/ac-aux
+       The directory name 'aux' is special on Windows, and using it keeps the
+       build from working.
+
+       You will need to rerun autogen.sh after this change
+
+2014-01-23  Raphaël Pinson  <raphink@gmail.com>
+
+       Update NEWS
+
+       Sshd: let all special keys be case-insensitive
+
+       Update NEWS
+
+       Sshd: Support Ciphers and KexAlgorithms groups, GH issue #69
+
+       Update NEWS
+
+       Grub: Add 'verbose' option, GH issue #73
+
+       Update NEWS
+
+       Shellvars_list: Allow end-of-line values, bug #342
+
+       Fix xymonalerting into xymon_alerting in tests/Makefile.am
+
+       Add Xymon_Alerting lens to NEWS, update AUTHORS
+
+       Rename XymonAlerting lens as Xymon_Alerting
+
+       Fix NaturalDocs comments in XymonAlerting lens
+
+2014-01-23  Francois Maillard  <fmaillard@gmail.com>
+
+       Add NaturalDocs documentation to the xymonalerting lens and its tests
+
+       add basic doc
+
+       Add the test lens to the Makefile
+
+       New lens for xymon alerting rules
+
+2014-01-23  Raphaël Pinson  <raphink@gmail.com>
+
+       Update NEWS with Authorized_Keys change
+
+2014-01-23  Jasper Lievisse Adriaanse  <jasper@humppa.nl>
+
+       Allow 'ssh-ed25519' as a valid authorized_key type
+
+2014-01-23  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Update NEWS and AUTHORS
+
+2014-01-13  Kaarle Ritvanen  <kaarle.ritvanen@datakunkku.fi>
+
+       Interfaces: map bond-slaves and bridge-ports options to arrays
+       This is a backwards incompatible change, as these would previously show up
+       as strings in the tree
+
+2014-01-13  Tomas Klouda  <tomas.klouda@gooddata.com>
+
+       Fix MongoDB Server lens - MongoDB doesn't accept quoted values
+       This lens worked for already defined values, but once you wanted to
+       add new value, it was created with quotes and MongoDB failed to start
+
+2014-01-13  Dominic Cleal  <dcleal@redhat.com>
+
+       Fix umask handling when creating new files
+         * src/transform.c (transform_save): faulty umask arithmetic would cause
+           overly-open file modes when the umask contains "7", as the umask was
+           incorrectly subtracted from the target file mode
+
+       Fixes CVE-2013-6412, RHBZ#1034261
+
+2014-01-13  Freakin  <brendanaye@gmail.com>
+
+       OpenVPN: additional config options
+       Support
+         1) daemon
+         2) client-config-dir
+         3) route
+         4) management
+
+2014-01-13  David Lutterkort  <lutter@watzmann.net>
+
+       * NEWS: describe Slapd changes in last few commits
+
+2014-01-13  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Slapd: move by/who to the value of by
+
+       Slapd: Allow any allowed combination of who/access/control in by field
+
+       Slapd: support smart quotes in database entry
+
+       Slapd: remove duplicate entry in database_re
+
+       Slapd: rename by parameters
+       * Rename by/what as by/access (as per official doc)
+       * Allow access to be absent (as per official doc)
+
+2014-01-07  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Slapd: Add unit test for by/control
+
+2013-12-18  Dominic Cleal  <dcleal@redhat.com>
+
+       Shellvars, Sysconfig: map "bare" export and unset lines using seq to handle multiple variables
+       Fixes RHBZ#1033795
+
+2013-12-18  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Shellvars.lns: Actually test continued lines and fix support
+
+       Shellvars.lns: add unit test for continued lines in double quoted values
+
+2013-12-16  Dominic Cleal  <dcleal@redhat.com>
+
+       Sysconfig: permit empty comments after comment lines
+       Fixes RHBZ#1043636
+
+2013-12-05  Dominic Cleal  <dcleal@redhat.com>
+
+       Shellvars: fix syntax error in filter
+
+2013-12-04  David Lutterkort  <lutter@watzmann.net>
+
+       Shellvars: exclude /etc/sysconfig/ip*tables.save files
+
+2013-12-03  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Sudoers.lns: Allow uppercase characters in user names (ticket #376)
+
+       Build: Add combine_three_ord and combine_three
+
+       Build: Add combine_two_ord and combine_two
+
+       Yum.lns: split excludes as lists (ticket #275)
+
+       Build: Add combinatorics group
+
+       Yum.lns: simplify code for combinatory logic of list_entry elements
+
+2013-12-02  Tomas Hoger  <thoger@redhat.com>
+
+       Corrections for CVE-2012-0786 tests
+       - test-put-symlink-augsave.sh - variable $HOSTS_AUGNEW was used to check if
+         file was still symlink, while it wasn't set before.  Fix to use
+         $HOSTS_AUGSAVE.
+       - test-put-symlink-augnew.sh, test-put-symlink-augsave.sh - 'test -f'
+         dereferences symlink and hence can not be used to check if file is regular
+         file or symlink to a regular file.  Use 'test -h' instead.
+
+2013-12-02  Tomas Hoger  <thoger@redhat.com>
+
+       Correct locations table for transform_save()
+       Commit 16387744 introduced a table with locations of temporary, destination and
+       backup file in various modes as part of the comment for transform_save().  This
+       corrects two incorrectly listed temporary file locations.
+
+       Note that PATH_canon is somewhat misleading, as canonicalized path is always
+       used when not using NEWFILE save flag, while it is meant to indicate whether
+       file is created in a directory that contains symlink, or a directory that
+       contains symlink's target.
+
+2013-12-02  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Desktop.lns: Support square brackets in keys
+
+2013-11-19  Dominic Cleal  <dcleal@redhat.com>
+
+       * src/transform.c (filter_matches): wrap fnmatch to ensure that an incl   pattern containing "//" matches file paths
+       Fixes RHBZ#1031084
+
+2013-11-09  Sean Millichamp  <sean.millichamp@secure-24.com>
+
+       Enhance Nagiosobjects lens
+       This adds support and tests for three additional Nagios
+       supported behaviors:
+       - An optional space between the object name and the {
+          Example: "define host{"
+       - An optional indent prior to the closing }
+          Example: "    }"
+       - Whole-line comments that start with ;
+          Example: "; This is a comment"
+
+       It does not add support for end-of-line comments with ;
+
+2013-11-09  Yanis Guenane  <yguenane@gmail.com>
+
+       Dhcpd: support a wider variety of DHCP allow/deny/ignore statement
+       The Dhcpd.aug was missing a part of the allow/deny/ignore possible
+       statement. This commit updates the lense so it supports the list
+       of options available here
+
+       http://www.ipamworldwide.com/declarations-topological/declarations-allowdenyignore.html
+
+       Also this bug was preventing a Foreman user to parse the dhcpd.conf
+       generated by theforeman/dhcp puppet module
+
+2013-11-09  Dominic Cleal  <dcleal@redhat.com>
+
+       Yum: permit spaces after equals sign in list options
+       Fixes GitHub issue #45
+
+2013-11-08  Matteo Cerutti  <matteo.cerutti@hotmail.co.uk>
+
+       Sudoers: permit underscores in group names
+       Fixes ticket #370
+
+2013-11-01  Andrew N Golovkov  <a.golovkov@dwteam.ru>
+
+       include only *.repo files from yum.repos.d;
+
+2013-10-24  Michael Haslgrübler  <work-michael@haslgruebler.eu>
+
+       Use Quote module in dovecot
+       * use Quote.dquote_spaces for quoting
+
+       dovecot enchancement and bug fixes
+       * add mailbox to block_names
+       * fix for block_args in quotes
+       * fix for block's brackets upon write
+       * fixes broken tests for mailbox
+       * fixes indention
+       * test case for block_args with "
+       * fixes broken indention
+
+2013-10-17  Dominic Cleal  <dcleal@redhat.com>
+
+       Shellvars_list: handle backtick variable assignments
+       Fixes ticket #368
+
+2013-10-08  Yanis Guenane  <yguenane@gmail.com>
+
+       Update NEWS
+
+2013-10-07  Dietmar Kling  <baldur@email.de>
+
+       Cyrus_Imapd: create new entries without space before separator
+       Fixes RHBZ#1014974
+
+2013-10-05  Dominic Cleal  <dcleal@redhat.com>
+
+       Exports: permit colons for IPv6 client addresses
+       Fixes ticket #366
+
+2013-09-20  Esteve Fernandez  <esteve.fernandez@gmail.com>
+
+       Added dhclient.conf path for Debian/Ubuntu
+
+2013-09-09  Yanis Guenane  <yguenane@gmail.com>
+
+       Fix Trac#364. Syslog lense accept UDP(@) and TCP(@@) protocol
+       Currently the syslog lense only accept sending log to another host
+       via UDP - a single @ -, and was discarding TCP - a double @ -. This
+       PR fixes that.
+
+       Fix test_rsyslog.aug
+
+       Remove unused variable at
+
+2013-09-07  Yanis Guenane  <yguenane@gmail.com>
+
+       Fix NagiosCfg lense so /etc/nagios/nrpe.cfg is parsed by Nrpe and not NagiosCfg
+       Currently NagiosCfg lense is in charge of parsing all files under /etc/nagios/*.cfg
+       but /etc/nagios/commands.cfg. /etc/nagios/nrpe.cfg should be also added as an exception
+       since it needs to be parsed by the Nrpe lense. This issue currently causes the following
+       error : "Lenses @NagiosCfg and @Nrpe could be used to load this file"
+
+2013-09-02  Dominic Cleal  <dcleal@redhat.com>
+
+       * tests/test-load.c (testPermsErrorReported): skip permissions test when root
+
+2013-08-27  Tom Hendrikx  <tom@whyscream.net>
+
+       Postfix_virtual: allow '+' and '=' in email addresses
+       + ('plus') and = ('equals') are valid characters in email addresses.
+       Example is from postfix docs, see:
+       http://www.postfix.org/MULTI_INSTANCE_README.html#quick
+
+2013-08-27  Raphaël Pinson  <raphink@gmail.com>
+
+       Add aug_cp and the cp and copy commands
+
+2013-08-27  Dominic Cleal  <dcleal@redhat.com>
+
+       Grub: handle makeactive menu command
+       Fixes ticket #340
+
+       Postfix_Main: handle stray whitespace at end of multiline lines
+       Fixes ticket #348
+
+2013-08-27  Pat Riehecky  <riehecky@fnal.gov>
+
+       Koji: new lens to parse Koji configs
+
+2013-08-27  Dominic Cleal  <dcleal@redhat.com>
+
+       Access: support DOMAIN\user syntax for users and groups
+       Fixes ticket #353
+
+       Samba: permit asterisk in key name
+       Fixes ticket #354
+
+       Shellvars: support all types of quoted strings in arrays
+       Patch from webmeister.  Fixes ticket #357.
+
+2013-08-27  Pat Riehecky  <prieheck@iwu.edu>
+
+       Yum: add yum-cron*.conf files
+
+2013-08-27  Pascal Lalonde  <plalonde@google.com>
+
+       Interfaces: allow numeric characters in stanza options
+
+2013-08-27  David Lutterkort  <lutter@watzmann.net>
+
+       Shellvars: read /etc/firewalld/firewalld.conf
+       Fixes https://fedorahosted.org/augeas/ticket/363
+
+2013-08-27  Matthew Booth  <mbooth@redhat.com>
+
+       Grub: support the 'lock' directive
+
+       Grub: NFC fix whitespace errors introduced by 4e09d15
+       Kill tabs!
+
+       Grub: support the 'setkey' directive
+
+2013-08-27  Michael Wisheu  <wisheu@google.com>
+
+       Interfaces: add /etc/network/interfaces.d/* as another commonly used location
+
+2013-08-06  Raphaël Pinson  <raphink@gmail.com>
+
+       Update NEWS
+
+       Fix NaturalDocs comments in lenses
+
+2013-08-06  Stephen P. Schaefer  <sschaefer@acm.org>
+
+       Allow augeas to deal with one variant of /etc/sysconfig/network-scripts/route-*
+
+2013-08-01  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Update NEWS
+
+       Properties: Support multiline starting with an empty string, GH issue #19
+
+       Dhcpd: support conditionals, GH issue #34
+
+       Update NEWS
+
+       PHP: Allow php-fpm syntax (GH issue #35)
+
+2013-08-01  Patrick Adair  <padair@he.net>
+
+       Interfaces: add in support for the source stanza in /etc/network/interfaces files
+
+2013-07-30  Dominic Cleal  <dcleal@redhat.com>
+
+       Simplevars: adopt /etc/selinux/semanage.conf due to spaces around delimiters
+
+2013-07-30  Michael Scherer  <misc@zarb.org>
+
+       Shellvars: add /etc/selinux/semanage.conf
+
+2013-07-30  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Start new NEWS section
+
+       Fix documentation links in c_api naturaldocs menu
+
+2013-07-24  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Sshd: also indent comments by 2 spaces by default in Match groups
+
+       Sshd: Indent Match entries by 2 spaces by default
+
+2013-06-27  Jan Vansteenkiste  <jan@vstone.eu>
+
+       Fixes #27: Automounter lens does not handle hostnames with dashes in them
+
+2013-06-24  Jasper Lievisse Adriaanse  <jasper@humppa.nl>
+
+       Fix my name
+
+2013-06-14  David Lutterkort  <lutter@watzmann.net>
+
+       Version 1.1.0
+
+       Make tree_unlink safer to use
+       tree_unlink used to only remove nodes from the tree, leaving the
+       possibilities of dangling references from variables stored in the
+       symtab. The new incarnation is safer in that it cleans up the symtab first.
+
+2013-06-14  David Lutterkort  <lutter@watzmann.net>
+
+       Do not interpret file names as path exprs during load
+       We used to interpret file names as path expressions at various points in
+       the process of loading the tree. That lead to nasty failures if the file
+       names contained characters that have a special meaning in path expressions,
+       like '!', '[' etc.
+
+       When the loading code now creates nodes or looks them up based on filenames
+       (e.g. to create the file's top level node in /files or the info node in
+       /augeas/files), we now use tree_fpath/tree_fpath_cr to do that.
+
+       The workaround introduced into shellvars.aug to fix tiecket #246 is also no
+       longer needed.
+
+       Fixes https://fedorahosted.org/augeas/ticket/343
+       Fixes https://fedorahosted.org/augeas/ticket/333
+       Improves on the fix for https://fedorahosted.org/augeas/ticket/246
+
+2013-06-14  David Lutterkort  <lutter@watzmann.net>
+
+       * src/transform.c (xfm_error): do not segfault when msg is NULL
+
+       * src/try: make 'try gdb' work with emacs-24 and gdb-7.5.1
+
+2013-06-11  David Lutterkort  <lutter@watzmann.net>
+
+       LVM: fix handling of quoted strings that contain quotes
+       Fixes https://github.com/hercules-team/augeas-do-not-use/issues/28 reported
+       by brianredbeard
+
+2013-06-11  Erik B. Andersen  <erik.b.andersen@gmail.com>
+
+       AptCacherNGSecurity: new lens for /etc/apt-cacher-ng/security.conf
+
+2013-06-11  brian redbeard  <brian@dead-city.org>
+
+       Added node config for OpenShift
+       When the intial lens was developed there was a missing transform
+       on /etc/openshift/node.conf
+
+       This is a fix for bug hercules-team/augeas#22
+
+2013-06-04  David Lutterkort  <lutter@watzmann.net>
+
+       Xorg: allow 'Screen' in Device section
+       Patch from merkela
+
+       Fixes bug https://fedorahosted.org/augeas/ticket/344
+
+2013-06-03  David Lutterkort  <lutter@watzmann.net>
+
+       Xorg: support extmod section
+       Patch by merkela
+
+       Partial fix for https://fedorahosted.org/augeas/ticket/344
+
+2013-05-30  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Yum: optimize regexp substractions
+
+       Nrpe: optimize regexp substractions
+
+       Mdadm_Conf: optimize regexp substractions
+
+       Fai_Diskconfig: Optimize regexp substractions
+
+       Shellvars: Optimize regexp substraction
+
+2013-05-28  Dominic Cleal  <dcleal@redhat.com>
+
+       Automaster: accept spaces between options
+
+2013-05-24  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Update NEWS
+
+       Add Rob Tucker to AUTHORS
+
+       Add README as a symlink to README.md to make autogen relax
+
+2013-05-24  Rob Tucker  <rtucker11@gmail.com>
+
+       Added augeas lens and test for the asterisk sip.conf file
+
+2013-05-22  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       postfix_master: Allow [] in words (ticket #345)
+
+2013-05-17  David Lutterkort  <github@watzmann.net>
+
+       Update README.md
+       Reformat as GH-flavored markdown; add a License section
+
+       Rename README to README.md
+
+2013-05-17  David Lutterkort  <lutter@watzmann.net>
+
+       * tests/test-run.c (load_module): do not downcase the lensdir
+       We should not touch the lensdir, since it is user provided; we only want to
+       downcase the module name.
+
+       Patch by aponomarenko
+
+       Fixes bug #332
+
+2013-05-17  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Add --echo alias to augtool manpage
+
+       Add -t option to augtool manpage
+
+2013-05-17  Enrico Stahn  <mail@enricostahn.com>
+
+       PHPFPM Support
+
+2013-05-16  Francis Giraldeau  <francis.giraldeau@gmail.com>
+
+       Add Splunk lens
+       Lens to parse Splunk configuration. Based on IniFile lens, with few differences:
+
+       * Accepts empty value in entry
+       * Entries without parent section are children of .anon node
+
+       Thanks to Tim Brigham for this contribution.
+
+2013-05-16  Francis Giraldeau  <francis.giraldeau@gmail.com>
+
+       Add CR as a white space char in RX.space_in
+       CR is used in the IniFile lens as of EOL. To avoid concat ambig between
+       IniFile.store_to_eol and IniFile.eol, CR has to be added to Rx.space_in. This
+       change do not break any existing lens in the repository.
+
+2013-05-16  Davide Guerri  <davide.guerri@gmail.com>
+
+       adds support for iptoute2 configuration files (/etc/iproute2/*)
+
+2013-05-16  Simon Vocella  <voxsim@gmail.com>
+
+       JaaS: lens for the Java Authentication and Authorization Service
+
+2013-05-15  David Lutterkort  <lutter@redhat.com>
+
+       Function composition: fix the typing of the generated lambda
+       When f and g are functions, 'f ; g' gets translated into
+         lambda x: g (f x)
+
+       The resulting function wasn't typed right, which led to an internal error.
+
+       This fixes bug #328
+
+2013-05-08  Raphaël Pinson  <raphink@gmail.com>
+
+       Update AUTHORS
+
+2013-05-08  Brian Harrington  <bharrington@redhat.com>
+
+       Added support for OpenShift
+       Added a series of lenses to support the corresponding configuration
+       formats including conf, JSON, & HTTP.
+
+2013-05-08  Brian Harrington  <bharrington@redhat.com>
+
+       Add support for MongoDB Server
+       A basic lens and test to support the configuration of MongoDB
+
+       Added infrastructure components for MongoDB
+
+       Included references to MongoDBServer to handle the auto testing of
+       lenses on build & mention of lens in for autodoc generation.
+
+       fixes hercules-team/augeas/#25
+
+       Improved documentation on MongoDBServer filter
+
+       Added improved reference and usage information for the lens
+
+       Mistyped port path in MongoDBServer lens usage
+
+       The port component was missing from the set command
+
+       fixes herclues/team-augeas/#25
+
+2013-05-08  Brian Harrington  <bharrington@redhat.com>
+
+       Added support for ActiveMQ / Red Hat JBoss A-MQ
+       Added a series of lenses to support the file formats utilized with
+       the project ActiveMQ / Red Hat JBoss A-MQ.
+
+       ActiveMQ is a standards-based, open source messaging platform
+       shipped by Red Hat (Formerly Fuse Source).
+
+       http://activemq.apache.org/
+       http://www.redhat.com/products/jbossenterprisemiddleware/amq/
+
+2013-04-30  Mathieu Alorent  <malorent@kumy.net>
+
+       Add more flags
+       add other flags, and use regexp to check
+
+2013-04-30  Mathieu Alorent  <malorent@kumy.net>
+
+       implement Downtime feature
+       As seen in this thread, there is a downtime feature that is not
+       parsed by Augeas.
+
+       http://lists.xymon.com/archive/2011-March/030998.html
+
+2013-04-20  Dominic Cleal  <dcleal@redhat.com>
+
+       Rsyslog: support :omusrmsg: list of users in actions
+
+2013-04-15  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Passwd: allow period in user names in spec (fixes #337)
+
+       Passwd: allow overrides in nisentry
+
+2013-03-31  Gonzalo Servat  <gservat@gmail.com>
+
+       Nrpe: accept any config option, remove predefined list
+
+2013-03-30  Branan Purvine-Riley  <branan@puppetlabs.com>
+
+       Add support for port ranges to /etc/services lens
+       The `/etc/services` file on AIX can contain entries with ranges of ports. This change allows Augeas to parse such files.
+
+       Example from an AIX /etc/services file:
+       Â  Â  x11 Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â 6000-6063/tcp Â # X Window System
+       Â  Â  x11 Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â 6000-6063/udp Â # X Window System
+
+2013-03-21  Dominic Cleal  <dcleal@redhat.com>
+
+       Shellvars: reinstate /etc/sysconfig/network
+       Fixes #330, RHBZ#904222, RHBZ#920609
+
+2013-03-14  Gabriel  <g2p.code@gmail.com>
+
+       Add some autodoc comments.
+
+       Add a lens for LVM metadata.
+
+2013-03-11  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Update NEWS
+
+2013-03-11  Serge Smetana  <smetana@pluron.com>
+
+       Added lens for Dovecot config files
+
+2013-03-01  Dominic Cleal  <dcleal@redhat.com>
+
+       * src/augtool.c (usage): fix spelling error
+
+2013-02-07  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Krb5: Improve performances
+
+2013-02-07  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       IniFile: Support dos eol
+         Subversion: Support dos eol
+         Desktop: Support dos eol
+         MySQL: Support dos eol
+         Samba: Support dos eol
+         Yum: Support dos eol
+         Krb5: Support dos eol
+
+         IniFile: Add empty_generic_nocomment
+         Rx: make no_spaces compatible with doseol
+         Schroot: Use empty_generic_nocomment
+
+2013-02-07  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       IniFile: Allow quotes inside bare values
+
+       IniFile: Multiline values can begin with a single newline
+
+       IniFile: Add empty_generic and empty_noindent
+         Subversion: Use IniFile.empty_noindent
+
+       IniFile: Add entry_generic and entry_multiline_generic
+       Subversion: Use IniFile.entry_multiline_generic
+
+       IniFile: Allow spaces in entry_multiline* values
+
+2013-02-07  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       IniFile: Use Util.comment_generic and Util.empty
+         Add put test for ace
+
+         Lightdm: empty comments are mapped as empty
+         PHP: empty comments are mapped as empty
+         Odbc: empty comments are mapped as empty
+         Samba: empty comments are mapped as empty
+         Krb5: Fix tests for new IniFile.empty
+         MySQL: Support smart quotes and empty comments
+         Yum: Use Util.empty instead of IniFile.empty
+         Subversion: Adapt to new IniFile.empty definition
+         Systemd: Fix tests for new IniFile.empty
+
+2013-02-07  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       IniFile: Support smart quotes
+         Add support for smart quotes in IniFile lenses.
+         Fix PHP lens to support smart quotes.
+         Subversion: Adapt to smart quotes but allow ; in values
+         Schroot: Support smart quotes
+
+       IniFile: Add ready-to-use lns_loose and lns_loose_multiline lenses
+
+2013-02-06  Andrew Anderson  <andrew@lirn.net>
+
+       Krb5: fix parse error with IPA generated krb5.conf
+
+2013-02-06  Igor Pashev  <pashev.igor@gmail.com>
+
+       * configure.ac: better detection of how to pass version script to linker
+       This now also works on Illumos when using GNU ld
+
+       Fixes https://fedorahosted.org/augeas/ticket/289
+
+2013-02-06  Jan Pokorný  <jpokorny@redhat.com>
+
+       lenses.tex: fix typos, single-quote cleanup
+
+2013-01-23  Dominic Cleal  <dcleal@redhat.com>
+
+       Shellvars: ignore network configs with brackets in their name
+       SSIDs containing brackets would cause aug_init failures, as the characters are
+       parsed in path expressions.
+
+       Fixes ticket #246
+
+2013-01-23  David Lutterkort  <lutter@redhat.com>
+
+       augparse: add --trace option
+       Using --trace will print the filenames of all modules that are loaded.
+
+       Shellvars: ignore network configs with ! in their name
+       NetworkManager would write such files, but that leads to problems during
+       aug_init, as the attempt to create the node
+       /augeas/files/etc/sysconfig/network-scripts/FILE!NAME will fail as that is
+       not a valid path expression
+
+       * .gitignore: ignore test result files (*.trs)
+
+       * acinclude.m4: only turn on FORTIFY_SOURCE if it won't anger gcc
+       Following libvirt commits cf9bced0 and 1c2edf0f
+
+2013-01-10  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Quote: Allow multiple spaces in quote_spaces
+
+2013-01-10  Jasper Lievisse Adriaanse  <jasper@humppa.nl>
+
+       Add two files found on OpenBSD to the simplevars lens.
+
+2013-01-08  Jasper Lievisse Adriaanse  <jasper@humppa.nl>
+
+       The nagios filters work for Icinga too
+
+       Modify the Nagios lens to handle resources.cfg too.
+       Fixes ticket #312
+
+2013-01-04  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       AptPreferences: adjust a little bit to simplified lens
+
+       AptPreferences: Simplify/Standardize the module
+
+2013-01-04  Jasper Lievisse Adriaanse  <jasper@humppa.nl>
+
+       Make sure the usage shows up properly formated.
+
+       sync another comment with ND definition
+
+       Sync View comment with actual definition.
+
+       Properly document this lens.
+
+       Basic documentation for final apt lenses and sync Menu.txt
+
+       regen Menu.txt after recent changes.
+
+       Move the 'coding' comment to the end of the file to fix the menu entry.
+
+       Fix some more broken module names
+
+       Small fixes to improve documentation:
+       - Declare a module name in test_yum, so that gets taken instead of Yum.lns
+       - Filter is a view, not a variable in ntpd.aug
+       - Properly declare the module name nginx.aug
+
+       Correctly set the module name, and let it actually test the Lightdm lens.
+
+2013-01-04  David Lutterkort  <lutter@redhat.com>
+
+       Xml test (input1): modify to mildly check handling DOS line endings
+
+2013-01-04  Jasper Lievisse Adriaanse  <jasper@humppa.nl>
+
+       Add support for handling the "client-output-buffer-limit" to the Redis lens.
+
+2013-01-03  Jasper Lievisse Adriaanse  <jasper@humppa.nl>
+
+       Some small Rx tweaks: include regexes for octal and hex and simplify ipv4 matching.
+       Fixes ticket #327
+
+       Add a lens for OpenNTPD's config file (ntpd.conf).
+       Extend rx.aug with some helpful regexes while here.
+       Fixes ticket #324
+
+       Adjust the fonts lens' exclusion rule to ignore all README files
+       Fixes ticket #323
+
+2013-01-03  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Quote: improve lens usage
+
+       Quote: lens usage
+
+       Quote: Improve documentation for functions
+
+       Xorg: Fix filter
+
+2013-01-03  Jasper Lievisse Adriaanse  <jasper@humppa.nl>
+
+       Also handle /etc/monitrc
+       Fixes ticket #326
+
+2013-01-03  Jasper Lievisse Adriaanse  <jasper@humppa.nl>
+
+       Remove bogus use of Util.stdexcl.
+       It should only be used for wildcard includes.
+       Add an exclude to Util.stdexcl for "#*#" while here.
+
+       Fixes ticket #325
+
+2013-01-03  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Erlang and Quote are generic lenses
+
+2013-01-02  Jasper Lievisse Adriaanse  <jasper@humppa.nl>
+
+       Add a new lens for OpenBSD's /etc/boot.conf.
+       Fixes ticket #322
+
+2013-01-02  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Networks: networks can have weird submasks, too
+
+       Sysctl: exclude /etc/sysctl.d/README.sysctl
+
+       Sudoers: Allow user aliases in specs
+
+       Systemd: Allow backslashes inside values
+
+       Systemd: Simplify expression
+
+       Systemd: Don't use multiple negates in regexps
+
+2012-12-30  Jasper Lievisse Adriaanse  <jasper@humppa.nl>
+
+       * tests/cutest.c: include sys/wait.h for WIFEXITED and WEXITSTATUS.
+       Fixes ticket #321
+
+2012-12-30  Dominic Cleal  <dcleal@redhat.com>
+
+       Inetd: support IPv6 addresses
+       Fixes ticket #320
+
+2012-12-30  Jasper Lievisse Adriaanse  <jasper@humppa.nl>
+
+       Shellvars: parse /etc/rc.conf.local which is found on OpenBSD.
+       Fixes ticket #320
+
+       Dhclient: on OpenBSD dhclient.conf lives in /etc/dhclient.conf
+       Fixes ticket #320
+
+       Resolv: Add two new views (family and lookup)
+       Fixes ticket #320
+
+2012-12-29  Dominic Cleal  <dcleal@redhat.com>
+
+       * src/augrun.c: fix spelling in defnode help
+
+2012-12-28  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       AptPreferences: Add "n" to pin keys
+
+2012-12-23  Dominic Cleal  <dcleal@redhat.com>
+
+       Xinetd: handle missing values in lists
+       Fixes ticket #307
+
+2012-12-22  Dominic Cleal  <dcleal@redhat.com>
+
+       Update NEWS and AUTHORS
+
+2012-12-21  David Lutterkort  <lutter@redhat.com>
+
+       Version 1.0.0
+
+2012-12-21  Dominic Cleal  <dcleal@redhat.com>
+
+       Krb5: support semicolon comments, allow empty lines within subsections
+       Fixes ticket #288
+
+2012-12-21  Pat Riehecky  <riehecky@fnal.gov>
+
+       Krb5: support host { } subsections inside v4_name_convert, handle multiple arguments to *_enctypes settings, support ticket_lifetime
+       Contains a minor incompatible lens change for permitted_enctypes,
+       default_tgs_enctypes and default_tkt_enctypes settings, where labels are now
+       lower-cased.
+
+       Fixes ticket #274
+
+2012-12-21  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Update NEWS and AUTHORS
+
+       Merge branch 'master' of ssh://git.fedorahosted.org/git/augeas into dev/nginx
+
+       Add Nginx lens to parse /etc/nginx/nginx.conf, bug #319
+
+2012-12-21  David Lutterkort  <lutter@redhat.com>
+
+       * src/Makefile.am: add $(top_builddir)/gnulib/lib to GNULIB_CFLAGS
+       Needed for building under IllumOS
+
+       Fixes https://fedorahosted.org/augeas/ticket/270
+
+2012-12-19  Matthaus Owens  <matthaus@puppetlabs.com>
+
+       Add /etc/puppetlabs/puppet path to puppet lenses
+       In Puppet Enterprise, puppet is rooted in /etc/puppetlabs/puppet instead of
+       /etc/puppet, so that is also a valid location for puppet.conf, fileserver.conf,
+       and auth.conf. This commit also adds /usr/local/etc/puppet/auth.conf as a
+       filter for the puppet auth lens.
+
+2012-12-17  Marc Fournier  <marc.fournier@camptocamp.com>
+
+       Redis: new lens and tests
+
+2012-12-17  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Quote: Add tests for *_nil entries
+
+2012-12-17  Marc Fournier  <marc.fournier@camptocamp.com>
+
+       Add Quote.*quote_opt_nil variables and functions
+       ... which are exactly the same as  Quote.*quote_opt, except they don't
+       set quotes by default.
+
+       This patch also completes a couple of existing comments.
+
+2012-12-17  Marc Fournier  <marc.fournier@camptocamp.com>
+
+       augeas.vim: added a couple of keywords recently introduced.
+
+2012-12-17  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Dhcpd: force double quotes for filename attribute, bug #311
+
+2012-12-16  Marc Fournier  <marc.fournier@camptocamp.com>
+
+       Postgresql: properly support quotes
+       Fixes trac#317
+
+2012-12-14  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Postfix_Transport: allow host:port and [host]:port syntaxes, bug #303
+
+       Really test Avahi.lns in test_avahi.aug
+
+       Update NEWS
+
+2012-12-14  Athir Nuaimi  <athir@nuaimi.com>
+
+       Add new Avahi lens to manage /etc/avahi/avahi-daemon.conf
+
+2012-12-14  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Merge branch 'trac#281' of git://github.com/mfournier/augeas into review/pr4
+
+2012-12-14  Marc Fournier  <marc.fournier@camptocamp.com>
+
+       Add a path to pg_hba.aug, fixes Trac ticket #281.
+
+       Htpasswd: new lens and tests
+
+2012-12-13  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Update NEWS
+
+       src/augtool.c: honor --echo in run_args
+
+       src/augtool.c: print_aug_error when run_args fails
+
+       src/augtool.c: run_args is successful if code >= 0, bug #316
+
+2012-12-12  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Update AUTHORS
+
+       Prepare NEWS for 1.0 release
+
+       Add Quote.dquote_spaces and Quote.squote_spaces
+
+       Use Quote.quote_spaces in pg_hba.aug
+
+       Add Quote.quote_spaces
+
+       Automagically manage quotes in pg_hba.aug
+
+2012-12-11  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       pg_hba.aug: Support multiple options (ticket #313)
+
+       Add test for ticket 313
+
+       pg_hba.aug: fix method to avoid clashing with hostname
+
+2012-12-11  Andreas Ntaflos  <daff@pseudoterminal.org>
+
+       Support hostnames/FQDNs and FQDN suffixes in pg_hba.conf
+       In pg_hba.conf the "address" column may also be a hostname, FQDN or part
+       of an FQDN starting with a dot, in addition to IP addresses. This adds
+       support for such hostnames and hostname suffixes.
+
+2012-12-09  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Merge branch 'master' of ssh://git.fedorahosted.org/git/augeas into dev/shellvars_newlines
+
+2012-12-09  Dominic Cleal  <dcleal@redhat.com>
+
+       Shellvars: add locale.conf, vconsole.conf systemd configs
+       Fixes BZ#881841
+
+2012-12-09  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Fix support for empty comments after comments
+
+       shellvars.aug: Fix newlines after comments being mapped as Util.empty
+
+2012-12-06  Dominic Cleal  <dcleal@redhat.com>
+
+       Shellvars: add locale.conf, vconsole.conf systemd configs
+       Fixes BZ#881841
+
+2012-12-03  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Add rsyslog.aug
+
+2012-11-29  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       No need for comment in rabbitmq.aug (managed in erlang.aug)
+
+       Support comments in erlang.aug and rabbitmq.aug
+
+2012-11-28  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Add rabbitmq.aug
+
+       Add erlang.aug
+
+2012-11-22  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Add /etc/audit/auditd.conf to simplevars.aug
+
+2012-11-20  Domen Kožar  <domen@dev.si>
+
+       correctly parse escaped string literals in vim syntax file
+
+2012-11-20  Francois Lebel  <francoislebel@gmail.com>
+
+       Add a lens for logwatch.
+
+2012-11-20  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Add tests for regexp builtin with flag
+
+       Add support for an 'i' flag in regexp builtin function
+
+2012-11-20  David Lutterkort  <lutter@redhat.com>
+
+       * src/pathx.c: pass the number of actual arguments to the func implementation
+
+       * src/pathx.c: match functions by name and arity
+       This makes it possible to have different numbers of arguments for the same
+       function, e.g. count() and count(nodeset)
+
+       * src/pathx.c: disallow ',' in names in path expressions
+       Note that this breaks backwards compatibility, since, when searching for a
+       node 'a,b' you now must write "match a\,b" rather than "match a,b"
+
+2012-11-14  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Add Puppet_Auth lens
+
+2012-11-09  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Add aug_label to retrieve the label from a path.
+
+2012-11-09  David Lutterkort  <lutter@redhat.com>
+
+       Sysconfig: handle end of line comments and semicolons; strip quotes
+       Fixes RHBZ #761246
+
+       square lens: correctly process skeletons during put
+       The current code would identify a L_SQUARE skeleton to match even when it
+       did not, meaning we would not trigger a create in all instances where it
+       was needed.
+
+       Shellvars: add tests for semicolon handling
+
+       * lenses/tests/test_sysconfig.aug: use a variable 'lns' for Sysconfig.lns
+
+       * lenses/tests/test_sysconfig.aug: use a variable 'lns' for Shellvars.lns
+
+       * tests/Makefile.am (lens_tests): add quote test
+
+2012-10-29  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Use the Quote module in dhcpd.aug
+
+       Use the Quote module in openvpn.aug
+
+       Add quote.aug to easily manage quotes
+
+2012-10-27  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       vmware_config: use square lens to manage quotes
+
+2012-10-26  David Lutterkort  <lutter@redhat.com>
+
+       square: properly handle first lens matching empty string
+       The rewriting of the ctype of (square l1 l2 l3) introduced in commit
+       1484afc3 was not correct when the ctype of l1 matched the empty string: the
+       rewritten ctype did not match the empty string any more.
+
+       This patch fixes that by making sure that fa_enumerate includes the empty
+       word if the language contains it.
+
+2012-10-26  Marc Fournier  <marc.fournier@camptocamp.com>
+
+       improved documentation for carbon/mcollective/memcached/thttpd lenses.
+
+2012-10-26  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       VMware_Config accepts values without quotes
+
+2012-10-23  Francis Giraldeau  <francis.giraldeau@gmail.com>
+
+       Xml: support single _and_ double quoted attribute values
+       Fixes RHBZ #799885
+       Fixes ticket #258
+
+2012-10-23  David Lutterkort  <lutter@redhat.com>
+
+       Use precise ctype of a square lens if it is indeed regular
+
+       libfa (fa_enumerate): new function
+       Function to enumerate FA's with a finite language, given a preset limit of
+       words.
+
+       * src/syntax.c (compile_test): print which test failed when missing exception
+       Tests which should produce an exception, but produce a regular value didn't
+       print their line info when they failed.
+
+       * tests/modules/fail_shadow_union.aug: fix unintended test failure
+
+2012-10-19  David Lutterkort  <lutter@redhat.com>
+
+       Gdm: also read /etc/gdm/custom.conf by default
+
+2012-10-19  Filip Andres  <filip.andres@gooddata.com>
+
+       cgconfig.aug adds space between group and id
+
+2012-10-19  David Lutterkort  <lutter@redhat.com>
+
+       Lightdm: new lens and tests
+       Fixes ticket #302
+       Contributed by David Salmen
+
+2012-10-19  jmccann  <jacob.m.mccann@usps.gov>
+
+       Ntp: add tos directive
+       Fixes ticket #297
+
+2012-10-19  David Lutterkort  <lutter@redhat.com>
+
+       Phpvars: support classes and public/var values
+       Fixes ticket #299
+
+       Patch by aheahe
+
+2012-10-19  Marc Fournier  <marc.fournier@camptocamp.com>
+
+       Memcached: new lens and tests
+
+       Thttpd: new lens and tests
+
+       Carbon: new lens and tests for Carbon cache.
+
+       MCollective: new lens and tests
+
+2012-09-24  Dominic Cleal  <dcleal@redhat.com>
+
+       Revert f04d7dfb3fe7c54b0be650e68aa7778eaf02ea66
+       This was a subtle feature which uses counters named after the setting key to
+       index the values beneath it, over all instances of the setting key.  This allows
+       for path expressions such as /files/etc/ssh/sshd/AllowEnv/10 to map to the
+       tenth value, irrespective of how many setting lines they are split over.
+
+       Modprobe: revert inner lens name change, fixes Modules_conf
+       Modules: define own entry regexp as referenced Modprobe inner lens doesn't
+       match file format
+
+2012-09-21  Dominic Cleal  <dcleal@redhat.com>
+
+       Modprobe: support multiline split commands
+       Fixes Ubuntu bug #1054306
+
+2012-09-17  Dominic Cleal  <dcleal@redhat.com>
+
+       Sshd: reset seq counter for each array setting
+
+2012-09-13  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Fix test_syslog.aug
+
+       Capital letters are allowed in tokens in syslog.aug
+
+       Add collectd.aug and associated test
+
+2012-09-10  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Add postfix_virtual.aug and associated test
+
+       Remove /etc/postfix/virtual from postfix_transport.aug
+
+2012-09-04  Dominic Cleal  <dcleal@redhat.com>
+
+       Sshd: permit hyphens in subsystem names
+
+2012-09-03  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Add apt_update_manager.aug and test
+
+       Add vmware_config.aug and test
+
+       Allow empty lines in gtkbookmarks.aug
+
+       Use label instead of seq in gtkbookmarks.aug
+
+       Add gtkbookmarks.aug and test
+
+2012-08-27  Pat Riehecky  <riehecky@fnal.gov>
+
+       Cachefilesd: new lens for /etc/cachefilesd.conf
+
+2012-08-23  jmccann  <jacob.m.mccann@usps.gov>
+
+       fixes #278 multipath: allow devices to override defaults
+
+2012-08-22  Michal Filka  <mfilka@suse.cz>
+
+       Fixed logrotate.aug.
+           Logrotate accepts integers prefixed by a sign. Added real world
+           ntp config file example from SLES into test_logrotate.aug.
+
+2012-08-21  Jeroen van Meeuwen (Kolab Systems)  <vanmeeuwen@kolabsys.com>
+
+       Add a lens for Cyrus IMAP configuration file /etc/imapd.conf (includes /etc/imap/*.conf)
+       Fixes ticket #296
+
+2012-08-14  Francis Giraldeau  <francis.giraldeau@gmail.com>
+
+       Generic square lens v4
+       Lens square now takes lenses instead of regular expressions as arguments, as follow:
+
+         square left body right
+
+       The left and right lenses must accept the same language. The left lens can be
+       either key or del, while the right lens must be del.
+
+       This patch changes the semantic of the square lens and is thus not backward
+       compatible. Modules must be updated accordingly. The definition of the square
+       lens should now be definitive, and later addition may add support for
+       additionnal lenses for left and right sides.
+
+         * builtin.c: change definition of the square lens.
+         * get.c: use the AST to recover the left and right strings matched by the
+           square lens.Regular lenses are handled with regexp registers.
+         * put.c: the variable state->override is used to indicate to a del part of a
+           square lens that it should use the provided value instead of the saved
+           string in the skel or the default value.
+         * lens.c: change the lns_make_square to match the new structure.
+
+       Update square lens test to use lens arguments instead of regexp. The change
+       consists to replace "square re lens" into "square right lens left", where right
+       and left are lenses. Hence, legacy lens is converted this way:
+
+       Legacy:
+         let x = square re body
+
+       New definition:
+         let x =
+               let right = key re in
+               let left = del re "" in
+               square right body left
+
+       This patch splits pass_square.aug into regular and recursive tests. Other tests
+       are added to verify constraints on the square lens arguments and typechecking.
+
+       Finally, this patch updates httpd and xml lens according to square args
+
+       Changes in v2:
+         * protect arg with parenthesis in child_first and child_last macros
+         * drop flag in_square, avoid lens copy, drop square_left/right strings
+           replaced by ast for rec lens and regs for regular lens. This
+           processing is more general than the previous approach, and thus
+           will help to extends the square lens more in the future.
+       Changed in v3:
+         * Split the patch into smaller units
+       Changed in v4:
+         * Rejoin patches to avoid breaking make check
+
+2012-08-14  Francis Giraldeau  <francis.giraldeau@gmail.com>
+
+       Build AST while visiting the parse v2
+       The AST records the structure of the parse according to the lens tree. The
+       indices of the text matched is recorded for later use.
+
+       Changed in v2:
+         * Additional checks for correctness
+         * Create the root node in rec_process()
+         * Merge ast_add_child() and ast_append()
+
+2012-08-14  Francis Giraldeau  <francis.giraldeau@gmail.com>
+
+       Fix memory leak in dbg_visit
+       dbg_visit() calls format_lens() to display the lens information. The caller of
+       format_lens() must free the memory allocated, just do it.
+
+       Ignore Eclipse settings directory
+
+2012-08-12  Dominic Cleal  <dcleal@redhat.com>
+
+       Simplevars: use to parse /etc/default/grub_installdevice
+       Ticket #290
+
+       Hosts_Access: add hosts_options(5) support
+       Fixes ticket #256
+
+2012-08-12  Dominic Cleal  <dcleal@redhat.com>
+
+       Hosts_Access: permit more client list formats
+         * whitespace separated lists
+         * @netgroups
+         * IPv6 hosts, inc. zone indices
+         * paths to lists of clients
+         * wildcards
+
+       Mostly fixes ticket #256
+
+2012-08-11  Dominic Cleal  <dcleal@redhat.com>
+
+       Fix regression in permissions of created files
+       Commit 16387744 changed temporary file creation to use mkstemp, resulting in
+       new files being created with 0600 permissions.  For brand new files created
+       through Augeas, their permissions stayed at 0600 rather than being set by the
+       umask as before.
+
+         * src/transform.c (transform_save): chmod after creating new files to
+           permissions implied by the umask
+
+2012-08-11  Dominic Cleal  <dcleal@redhat.com>
+
+       Fix issues reported by clang static analyser
+         * src/transform.c (text_retrieve): initialise variable before use
+         * src/transform.c (filter_generate): remove duplicate variable assignment
+         * src/jmt.c (parse_add_item): ensure return is defined on goto error
+
+       Fix augtool --transform documentation
+         * src/augtool.c (usage): -t syntax is now same as 'transform' command
+         * src/augrun.c (cmd_transform_def): improve description
+
+       Arrange commands into groups for better help
+         * src/augrun.c: create group definitions, move commands into arrays per
+           group, update help output to iterate over and announce each group
+
+       Ldif: new lens to read LDIF files per RFC2849
+
+       * src/augtool.c (add_transforms): move free() to prevent free(NULL) and run on   each iteration
+
+2012-08-10  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Add a way to specify explict transforms
+       Allow specifying transforms in three different ways:
+        - an aug_transform API call
+        - a transform command for aug_srun
+        - a -t|--transform option to augtool
+
+2012-08-10  David Lutterkort  <lutter@redhat.com>
+
+       * src/augeas.c: use constants for "lens", "incl" and "excl"
+
+2012-08-10  Francis Giraldeau  <francis.giraldeau@gmail.com>
+
+       Fix typo in previous commit
+       Adjust comment and remove duplicated test case for primary statement in
+       dhcpd.conf lens.
+
+       Fix bug #293 primary statement in dhcpd.conf
+       The "primary" statement does not support any arguments, while it should when
+       it's used in the "zone" block statement. The solution is to add the primary
+       statement in the statements that requires a string argument. The primary
+       statement can thus take a value or not, and thus do not cause any ambiguity in
+       the put direction.
+
+2012-08-08  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Add entry_list and entry_list_nocomment to inifile.aug Use entry_list_nocomment in subversion.aug
+
+2012-08-07  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Add aug_rename to rename node labels without moving them in the tree.
+
+2012-08-07  Francis Giraldeau  <francis.giraldeau@gmail.com>
+
+       Escape double quotes when dumping regexp
+       Graphviz DOT is using double quotes to quotes the string of a label. Escape
+       double quotes to avoid parsing errors with graphviz when the regexp of the lens
+       includes double quotes.
+
+2012-08-02  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Update doc/naturaldocs/conf/lenses/Menu.txt
+
+2012-08-01  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Update email address for Raphaël Pinson in AUTHORS
+
+2012-07-31  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Make get_square case insensitive on the ending key.
+
+2012-07-29  Dominic Cleal  <dcleal@redhat.com>
+
+       * src/augrun.c (cmd_retrieve_help): tidy line wrapping
+
+       NetworkManager: support semicolons in values, spaces and brackets in entry names
+
+       * src/transform.c (xread_file): catch failed fopen, e.g. EACCES
+
+       Fix Valgrind memcheck errors
+         * src/augtool.c (main_loop): free memory allocated by readline
+         * src/augrun.c (aug_srun): free command opts after use
+
+2012-07-27  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Notify #augeas channel
+
+       Add valgrind test in .travis.yml
+
+       Add Travis CI file
+
+       Shellvars.aug fix empty comments
+
+       Shellvars.aug: Allow double quotes around variables in case statements
+
+       Shellvars.aug: Add shift and exit builtins, with optional args
+
+       Shellvars.aug: Fix empty lines after comments
+
+       Shellvars.aug: Support matching keys in var_action (ticket #290)
+
+       Shellvars.aug: Add dbquot for double bquoted values
+
+       Shellvars.aug: eol_comments must begin with a space char can contain #
+
+       Shellvars.aug: Add bquot and dollar-assigned tests
+
+       shellvars.aug: Allow semi-colons in bquot and dollar_assign Fix wrong test using bquot and eol_comment
+
+       Allow newlines in quoted values
+
+       Add lns_norec to shellvars.aug and fix ambiguities in the lens.
+
+       Fix ambiguity in shellvars.aug by making semi-colons illegal in bquot and arrays.
+
+2012-07-26  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Allow end of line comments in fstab.aug
+
+2012-07-23  Michal Filka  <mfilka@suse.cz>
+
+       Cron: records can be prefixed by '-'.
+
+2012-07-19  Danny Yates  <danny@codeaholics.org>
+
+       vsftpd.aug: Add require_ssl_reuse option
+
+2012-07-19  David Lutterkort  <lutter@redhat.com>
+
+       * augeas.spec.in: add bundled(gnulib) provides
+       Fixes BZ 821745
+
+2012-07-19  Dominic Cleal  <dcleal@redhat.com>
+
+       Prevent cross-mountpoint attacks via .augsave during saving
+       Previously Augeas would open PATH.augsave for writing if a rename from PATH to
+       PATH.augsave failed, then write the file contents in.  Now if the rename fails,
+       it tries to unlink PATH.augsave and open it with O_EXCL first.
+
+       Mountpoints remain permitted at either PATH or PATH.augnew provided
+       /augeas/save/copy_if_rename_fails exists.
+
+       * src/transform.c (clone_file):
+           add argument to perform unlink and O_EXCL on destination filename after a
+           rename failure to prevent PATH.augsave being a mountpoint
+       * src/transform.c (transform_save, remove_file):
+           always try to unlink PATH.augsave if rename fails, only allowing PATH to be
+           a mountpoint; allow PATH or PATH.augnew to be mountpoints
+       * tests/
+           test-put-mount: check PATH being a mountpoint is supported
+           test-put-mount-augnew.sh: check PATH.augnew being a mountpoint is supported
+           test-put-mount-augsave.sh: check unlink error when PATH.augsave is a mount
+
+       Fixes BZ 772261
+
+2012-07-19  Dominic Cleal  <dcleal@redhat.com>
+
+       Prevent symlink attacks via .augnew during saving
+       Instead of saving into a predictable PATH.augnew file, save into a securely
+       created PATH.augnew.XXXXXX
+
+       * src/transform.c (transform_save):
+           write changes to a temporary file in the same directory as the destination
+           (either the file's canonical path or the path of .augnew), before renaming
+
+       * src/transform.c (transfer_file_attrs):
+           use fchown, fchmod etc. on the same file handles to ensure consistent
+           permission changes
+
+       * bootstrap: add mkstemp gnulib module
+       * tests/
+           test-put-symlink-augnew.sh: test symlink attack when writing .augnew
+           test-put-symlink-augsave.sh: test symlink attack when writing .augsave
+           test-put-symlink-augtemp.sh: test symlink attack via temp .augnew
+           test-put-symlink.sh: also test file modification
+
+       Fixes BZ 772257
+
+2012-07-18  Dan Prince  <dprince@redhat.com>
+
+       Pythonpaste: new lens for Python Paste configs.
+       Added a new lense file for Python Paste configs. This is useful
+       for editing a variety of Openstack config files including,
+       Nova api-paste.ini, Glance *.ini files, keystone.conf, and the
+       swift config files.
+
+2012-07-18  David Lutterkort  <lutter@redhat.com>
+
+       Xinetd: slight formatting improvements
+
+       Case-insensitive regexps: fix a problem with number of groups
+       When we expand a regexp to a case-sensitive regexp in regexp_expand_nocase,
+       it is possible that the number of groups in that regexp changes,
+       e.g. /(a)|(b)/i becomes /[AaBb]/. That confuses the parser when that regexp
+       is used in a union or concatenation, since it expects the match following
+       the match for this regexp to be in group 3, not group 1.
+
+       * src/regexp.c (regexp_union_n, regexp_concat_n): fix bad memory access
+       Avoid calling strlen on a possibly unintialized string (since we overwrite
+       the trailing '\0' with a '(' just before calling REALLOC
+
+2012-07-18  Michal Filka  <mfilka@suse.cz>
+
+       made xinetd.aug case insensitive on attribute names
+
+2012-07-18  David Lutterkort  <lutter@redhat.com>
+
+       Update gnulib to commit cabce6b8
+
+2012-07-18  David Lutterkort  <lutter@redhat.com>
+
+       * src/builtin.c (pr_tree): new primitive print_tree
+       Useful in 'put' tests, as in
+
+         test lns put ".." after
+           set .. ;
+           print_tree;
+           set ..
+         = ?
+
+2012-07-17  David Lutterkort  <lutter@redhat.com>
+
+       aug_text_store, aug_text_retrieve: fix segfault when passed in node was NULL
+       When the node existed, but had a NULL value, we segfaulted instead of
+       reporting an error. We now report ENOMATCH.
+
+       Fixes https://fedorahosted.org/augeas/ticket/283
+
+2012-07-15  Dominic Cleal  <dcleal@redhat.com>
+
+       Fstab: options field is optional
+
+2012-07-13  Dominic Cleal  <dcleal@redhat.com>
+
+       Authorized_Keys: add more tests
+
+2012-07-13  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Add authorized_keys.aug and associated test.
+
+2012-07-04  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       simplevars.aug: Add /etc/zabbix/*.conf to includes
+
+       simplevars.aug: Allow quotes in variables that do not begin with a quote
+
+2012-06-28  Dominic Cleal  <dcleal@redhat.com>
+
+       Shellvars: exclude directories from /etc/sysconfig/* wildcard
+       This prevents a bug where Augeas maps a directory such as
+       /etc/sysconfig/network-scripts to a lens via a matching transform and fails
+       to save if the user edits /etc/sysconfig/network-scripts/ifcfg-eth0.
+
+2012-06-19  Micah Anderson  <micah@riseup.net>
+
+       escape all possible regular expressions before they are sent to sed
+
+2012-06-12  David Lutterkort  <lutter@redhat.com>
+
+       Modprobe: allow spaces around '=' in option
+       Fixes https://bugzilla.redhat.com/show_bug.cgi?id=826752
+
+2012-06-05  David Lutterkort  <lutter@redhat.com>
+
+       * man/augtool.pod: update mentions of default load path
+
+2012-06-01  Luc Didry  <luc@didry.org>
+
+       Add su logrotate.conf option in logrotate.aug
+
+2012-05-31  David Lutterkort  <lutter@redhat.com>
+
+       Tests for aug_text_store and aug_text_retrieve
+
+       aug_text_store, aug_text_retrieve: expose in augtool and aug_srun
+
+       aug_text_store, aug_text_retrieve: new API functions
+
+       * src/transform.c (text_retrieve): new function to turn tree into text
+
+       * src/transform.c (text_store): new function to write string to tree
+
+       * tests/test-run.c: allow loading of a module with 'use'
+
+2012-05-31  David Lutterkort  <lutter@redhat.com>
+
+       Allow running individual tests with test-run
+       Invoking 'test-run t1 t2 t3' will only run tests t1, t2 and t3
+
+         * tests/test-xpath.c: move checking if a test is mentioned in argv to
+           cutest
+         * tests/cutest.c, tests/cutest.h: add should_run
+         * Makefile.am: test-xpath now uses cutest.[ch]
+         * tests/test-run.c (run_tests): check if tests is mentioned on cmd line
+
+2012-05-31  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Add postgresql lens
+
+       Allow eol comments in simplevars.aug
+
+       Add lens for cups
+
+       Add lens for samba's smbusers
+
+2012-05-21  David Lutterkort  <lutter@redhat.com>
+
+       * src/augrun.c (cmd_span): better synopsis
+
+       * tests/run.tests: fix lines with trailing whitespace
+
+       * tests/test-run.c (errtokens): bring in sync with actual error codes
+
+2012-05-17  David Lutterkort  <lutter@redhat.com>
+
+       * src/transform.c (load_file): remove unused variable file
+
+2012-05-16  David Lutterkort  <lutter@redhat.com>
+
+       Fix behavior of set with empty strings
+         * src/augrun.c (cmd_set, cmd_setm): distinguish between empty string and
+           NULL value
+         * tests/run.tests (set-args): adapt to new behavior
+
+2012-05-12  Dominic Cleal  <dcleal@redhat.com>
+
+       * src/try: don't overwrite gdbcmds.txt if it exists
+
+2012-05-11  Dominic Cleal  <dcleal@redhat.com>
+
+       Fstab: handle options with empty values ("password=")
+
+2012-05-06  Tim Bishop  <tim@bishnet.net>
+
+       Puppet, PuppetFileserver: add /usr/local/etc/puppet paths
+
+2012-04-26  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Shellvars: various edge cases in case entries
+
+       AptPreferences: #comments are accepted within entries
+
+       NagiosCfg: /etc/nagios3/commands.cfg and /etc/nagios3/resource.cfg have their own syntax, allow spaces in values.
+
+       /etc/default/whoopsie is an IniFile
+
+       Merge branch 'master' of ssh://git.fedorahosted.org/git/augeas
+
+       Mke2fs: Add support for default_mntopts, enable_periodic_fsck, and auto_64-bit_support.
+
+2012-04-26  Dominic Cleal  <dcleal@redhat.com>
+
+       Make creating NULL value nodes more intuitive
+       * src/augrun.c: add "touch" command to create node if it doesn't exist, make
+         <VALUE> argument to "set" and "setm" optional
+
+       Fixes ticket #276
+
+2012-04-23  David Lutterkort  <lutter@redhat.com>
+
+       * src/augeas.h: include 'extern "C"' wrapper for C++
+       Fixes https://fedorahosted.org/augeas/ticket/272
+
+       Patch from Igor Pashev
+
+2012-04-22  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Use Sys.getenv("HOME") in dput.aug
+
+2012-04-19  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       PHPVars: map arrays with @arraykey subnodes to make working paths
+
+2012-04-12  Michal Filka  <michal.filka@suse.cz>
+
+       Shellvars: handle bash's implicit concatenation of quoted strings
+
+2012-04-12  Josh  <jokajak@gmail.com>
+
+       Grub: add /boot/grub/grub.conf to transform
+
+2012-04-12  Luc Didry  <luc@didry.org>
+
+       Use Sys.getenv('HOME') in filter instead of ~ since it's not expanded
+
+2012-04-12  Brett Porter  <brett@apache.org>
+
+       Properties: improve handling of whitespace, empty props, and underscores in keys
+       This brings the lens closer to the Java specification
+
+       With help from Carlos Sanchez <csanchez@maestrodev.com> and Dominic Cleal
+       <dcleal@redhat.com>
+
+2012-04-11  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       Use a more standard way of writing LGPL v2+ in lens headers
+
+2012-04-10  Raphaël Pinson  <raphael.pinson@camptocamp.com>
+
+       postfix_transport.aug also applies to virtual (5)
+
+       Add postfix_transport.aug and associated test.
+
+       Add subversion lens and associated test.
+
+       Add networkmanager lens to tests and doc
+
+       Add networkmanager.aug and associated test file.
+
+2012-04-09  Dominic Cleal  <dcleal@redhat.com>
+
+       Sudoers: allow quoted strings in Defaults parameters
+       Fixes bug #263
+
+2012-04-08  Dominic Cleal  <dcleal@redhat.com>
+
+       Debctrl: allow control extensions for Python packages
+       Fixes bug #267
+
+       Debctrl: fixed package paragraph keywords, allow variables for version numbers in dependency lists, allow DM-Upload-Allowed keyword
+       Fixes Debian bug #650887
+
+2012-04-06  Dominic Cleal  <dcleal@redhat.com>
+
+       AUTHORS: updated from recent commits
+
+2012-04-06  Jason Kincl  <jkincl@gmail.com>
+
+       Xymon: new lens for Xymon config files
+       Fixes ticket #266
+
+2012-04-06  Jim Meyering  <meyering@redhat.com>
+
+       compile_exp: don't return an uninitialized pointer upon failure
+       As a result of its improved flow analysis gcc-4.7.0 20111202 reported:
+
+         syntax.c: In function 'compile_exp':
+         syntax.c:1694:5: warning: 'v' may be used uninitialized in this \
+         function [-Wmaybe-uninitialized]
+
+       However, compile_exp calls many functions that return values that are
+       then assigned to "v".  Only two of those had a problem: in each there
+       is an error path by which the returned pointer is not initialized.
+       * src/syntax.c (compile_concat): Initialize "v".
+       (compile_minus): Likewise.
+
+2012-04-04  Duncan Mac-Vicar P  <dmacvicar@suse.de>
+
+       bootloader is also present in shellvars_list, exclude from shellvars.
+
+2012-04-01  Dominic Cleal  <dcleal@redhat.com>
+
+       Sudoers: allow "!" as a type of Defaults entry
+       Fixes Debian bug #650079
+
+       Modprobe: support softdep command
+       Fixes Debian bug #641813
+
+2012-03-29  Dominic Cleal  <dcleal@redhat.com>
+
+       * src/augrun.c (nexttoken): support \t and \n in aug_srun tokens
+       Fixes bug #265
+
+2012-03-23  Raphaël Pinson  <raphink@gmail.com>
+
+       Add netmask to hosts_access.aug
+
+2012-03-18  Dominic Cleal  <dcleal@redhat.com>
+
+       Shellvars: add systemd's /etc/os-release file
+
+       Systemd: new lens to parse systemd unit files
+
+       * src/augeas.c (aug_save): remove loop that added a second iteration around   children of /files, causing multiple saves in newfile and noop modes when   editing under /files/boot
+       Fixes ticket #264
+
+2012-03-17  Dominic Cleal  <dcleal@redhat.com>
+
+       Qpid: new lens to read Apache Qpid daemon/client configs
+       Contributed by Andrew Replogle.
+
+2012-03-12  David Lutterkort  <lutter@redhat.com>
+
+       Make sure reloading discards changes after save with mode 'newfile'
+
+2012-03-10  Dominic Cleal  <dcleal@redhat.com>
+
+       Util: add *.bak and *.old to stdexcl, to match files in /etc/sysconfig
+
+       Fix excl filters that only specify a filename or wildcard
+         * src/transform.c (transform_validate): only normalise excl paths with
+           directory separators into absolute paths
+         * src/transform.c (filter_generate): don't apply root prefix to excl filter
+           values when only comparing the base filename
+
+       Shellvars: exclude non-shell files in tests/root/etc/sysconfig
+
+       Shellvars: add /etc/selinux/config
+
+2012-03-06  Dominic Cleal  <dcleal@redhat.com>
+
+       Shellvars: include /etc/{default,sysconfig}/* and list exceptions instead
+
+2012-03-03  Tim Mooney  <Tim.Mooney@ndsu.edu>
+
+       src/augtool.c: rename echo to echo_commands to fix differing types reported with Solaris linker
+       Fixes ticket #262
+
+2012-02-24  Dominic Cleal  <dcleal@redhat.com>
+
+       Up2date: change tree to distinguish between empty values and empty lists
+
+       Up2date: change tree to fix ambiguity during put, remove list of known config options and separation of possible values
+
+2012-02-22  Dominic Cleal  <dcleal@redhat.com>
+
+       Protocols: change tree to support protocols named "a/n" and "tp++"
+
+       Shellvars: remove non-shell files, up2date now has a lens, move updatedb.conf to Simplevars
+       Fonts: exclude README
+
+       Sep: add semicolon
+
+       Ntp: allow deprecated 'authenticate' setting
+
+2012-02-21  Raphaël Pinson  <raphink@gmail.com>
+
+       Add up2date.aug and associated test file
+
+2012-02-17  Raphaël Pinson  <raphink@gmail.com>
+
+       Support \r in httpd.aug
+
+       Support \r in comments in util.aug
+
+       Support \r\n in xml.aug
+
+       Do not allow \r in comment_or_eol
+
+       Add Util.doseol
+
+2012-02-13  David Lutterkort  <lutter@redhat.com>
+
+       * src/transform.c (clone_file): do not leak from_fp
+
+2012-02-13  Raphaël Pinson  <raphink@gmail.com>
+
+       Allow commands without full path if they begin with a lowcase letter in sudoers.aug
+
+       Allow = in commands in sudoers.aug (but force ! or / as first character if not an alias)
+
+       Use Build.opt_list in sudoers.aug
+
+2012-02-13  Dominic Cleal  <dcleal@redhat.com>
+
+       Shellvars: add BSD's /etc/rc.conf
+       Fixes ticket #255
+
+2012-02-12  Dominic Cleal  <dcleal@redhat.com>
+
+       Improve aug_srun quoting to permit concatenation and better detect bad quoting
+       * src/augrun.c (nexttoken): permit shell-like concatenation of quoted and
+         unquoted strings, detect unmatched quotes and raise AUG_ECMDRUN.
+       * tests/run.tests: add lots of tests to cover quoting mismatches, single and
+         double quote combinations, courtesy of David Schmitt
+
+       Passwd: allow asterisk in password field
+       Fixes ticket #255
+
+       Pam: exclude /etc/pam.d/README
+       Fixes ticket #255
+
+2012-02-10  Raphaël Pinson  <raphink@gmail.com>
+
+       Simplify Sudoers.sto_to_com_user to improve performance. Use more standard constructs.
+
+       Add continued lines to rx.aug and sep.aug
+
+2012-02-09  Raphaël Pinson  <raphink@gmail.com>
+
+       Improve grub.aug's performances slightly
+
+       Improve keepalived.aug: cut typechecking time and resident size by 2.
+
+       Use Cron.shellvar in anacron.aug
+
+       Simplify Cron.key_re to improve typechecking of cron.aug
+
+       Allow # and ; in quoted values in inifile.aug (Fix ticket #243)
+
+2012-02-08  Terence Haddock  <thaddock@tripi.com>
+
+       * lenses/tests/test_iptables.aug: test that we accept blank lines
+
+2012-02-08  Francis Giraldeau  <francis.giraldeau@gmail.com>
+
+       Allocate exception instead of static const value
+       The static const value returned by exn_error() may cause SIGSEGV in case
+       the value is further changed. To avoid this situation, the structure is
+       allocated early in aug_init instead and released in aug_close, and is
+       accessible via aug->error->exn. The resulting exception value can be
+       modified without adverse effect.
+
+2012-02-08  Duncan Mac-Vicar P  <dmacvicar@suse.de>
+
+       Shellvars: autoload some SuSe and RHN specific files
+
+2012-02-07  David Lutterkort  <lutter@redhat.com>
+
+       Add very simplistic leak test
+
+       Fix some memory leaks
+         * src/augeas.c (tree_from_transform): do not do unneeded strdups which
+           lead to leaks
+         * src/lens.h: any lens can carry a jmt when it is recursive; this was a
+           pretty serious issue which could have lead to memory corruptions, since
+           struct lens was not right for that
+         * src/lens.c (free_lens, lens_release): call jmt_free for all lenses
+
+2012-02-07  Raphaël Pinson  <raphink@gmail.com>
+
+       Fix test-save by allowing (empty | comment)* in yum.aug.
+
+2012-02-07  Dominic Cleal  <dcleal@redhat.com>
+
+       CronAllow: remove accompanying test, moved into Simplelines test earlier
+
+2012-02-06  David Lutterkort  <lutter@redhat.com>
+
+       * src/transform.c (transform_save): different errors for parse and put failure
+
+2012-02-06  David Lutterkort  <lutter@redhat.com>
+
+       Graphviz: remove since it can not be typechecked
+       Typechecking for the Graphviz lens requires too much memory right now,
+       which makes it impossible to run 'mke check' on a reasonably sized machine
+       (6GB memory)
+
+       Backing out the lens until we can figure out a way to fix it so that 'make
+       check' works with it in practice.
+
+2012-02-06  Raphaël Pinson  <raphink@gmail.com>
+
+       Disable recursive mode in graphviz.aug since it fails in the put direction.
+
+       Pass Util.empty with entry in Build.block_generic. Fix ambiguity with Util.empty in graphviz.aug.
+
+2012-02-03  Raphaël Pinson  <raphink@gmail.com>
+
+       graphviz.aug: space is optional before options
+
+       graphviz.aug: names can be empty
+
+       Support crazy example in graphviz.aug
+
+       Add a simple graphviz.aug and associated test
+
+       Use Build.block_newlines in keepalived.aug
+
+       Build.block_newlines takes a comment parameter, newline is optional
+
+       Add variables for default delimiters and regexps in build.aug
+
+2012-02-02  David Lutterkort  <lutter@redhat.com>
+
+       * src/transform.c (filter_generate): take root into account for excludes
+       When matching an exclude pattern against a path, only try to match against
+       the part of path after the root. The paths found by globbing include
+       patterns contain the root.
+
+       Fixes bug #252
+
+2012-02-02  Raphaël Pinson  <raphink@gmail.com>
+
+       Improve logrotate, use Build, Rx, Sep
+
+       Add lbracket and rbracket to sep.aug
+
+       Add tests for build.aug
+
+       Add Build.block_newlines and use it in xinetd.aug
+
+       Rewrite xinetd.aug with Build, Sep, Rx
+
+       Allow to set lbracket_re and rbracket_re in Build.block_generic
+
+       Add Util.delim and use it in Sep.space_equal
+
+       Add Build.block_setdefault
+
+       Add default_lbracket and default_rbracket to Build.block_generic
+
+       Add blocks to build.aug, add comment_noindent to util.aug Add test_build.aug
+
+2012-02-01  Raphaël Pinson  <raphink@gmail.com>
+
+       Support dollar assignment ($(bar)) in shellvars.aug
+
+       Parse functions in shellvars.aug
+
+       Shellvars.aug allows multiple elif statements
+
+       Add test_fonts.aug
+
+2012-01-31  Dominic Cleal  <dcleal@redhat.com>
+
+       CronAllow: remove lens, add files to the Simplelines lens
+
+2012-01-31  Raphaël Pinson  <raphink@gmail.com>
+
+       Add fonts.aug
+
+       Add ldso.aug and test
+
+       Fix author
+
+       Add /etc/sysctl.d to sysctl.aug, improve lens and add it to docs.
+
+       Add protocols.aug and associated test
+
+       Add /etc/wgetrc to simplevars.aug
+
+       Add simplelines.aug and test
+
+       Add simplevars.aug and associated test
+
+       Add inputrc.aug and associated test
+
+       Add anacron.aug and associated test
+
+       cowpoke.conf
+
+2012-01-30  Raphaël Pinson  <raphink@gmail.com>
+
+       Ignore allow.pamlist from pam.aug
+
+       Add a few files to shellvars.aug
+
+       Add fuse.aug and associated test
+
+2012-01-27  Dominic Cleal  <dcleal@redhat.com>
+
+       Vfstab: new lens for /etc/vfstab config on Solaris
+
+2012-01-22  Dominic Cleal  <dcleal@redhat.com>
+
+       Automounter: exclude /etc/auto_master for Solaris, small tidyup
+
+       Automounter: exclude /etc/auto.master
+
+       Automaster: change to lowercase for consistency with Automounter
+
+       Automounter: new lens to parse automounter maps (/etc/auto.*)
+
+2012-01-21  Dominic Cleal  <dcleal@redhat.com>
+
+       AutoMaster: new lens to parse autofs auto.master files
+
+       CronAllow: new lens to parse both cron/at allow/deny files
+       Cron: exclude cron allow/deny files
+
+       Nsswitch: remove long list of databases, match by regexp
+
+       PamConf: new lens to parse /etc/pam.conf with the additional service field
+
+       Pam: allow uppercase chars in 'types', remove /etc/pam.conf from filter
+       PamConf: new lens to parse /etc/pam.conf with the additional service field
+
+       Networks: handle multiple missing network octets, fix sequencing of aliases
+
+       Nsswitch: add extra databases used on Solaris
+
+       Shells: permit same-line comments
+
+2012-01-20  Dominic Cleal  <dcleal@redhat.com>
+
+       Netmasks: new lens for parsing /etc/inet/netmasks on Solaris
+
+2012-01-19  Travis Groth  <tgroth@gmail.com>
+
+       Nsswitch: add passwd_compat, group_compat and shadow_compat GNU extensions
+
+2012-01-18  Raphaël Pinson  <raphink@gmail.com>
+
+       Add channels.aug and associated test.
+
+2012-01-14  Dominic Cleal  <dcleal@redhat.com>
+
+       Grub: parse "password --encrypted" properly, add tests for file subnode
+       Fixes ticket #250
+
+2012-01-11  Francis Giraldeau  <francis.giraldeau@gmail.com>
+
+       Fix fatest linking with libfa
+       fatest requires libfa symbols which are not exported by libaugeas library.
+
+2012-01-09  Lubomir Rintel  <lubo.rintel@gooddata.com>
+
+       Correctly parse empty object and arrays in JSON
+       Add a test case.
+       Fix from David Lutterkort <lutter@redhat.com>.
+
+       https://fedorahosted.org/augeas/ticket/248
+
+2012-01-09  Lubomir Rintel  <lubo.rintel@gooddata.com>
+
+       Allow JSON number literals to be followed by whitespace
+       Add a test case.
+
+       Fixes https://fedorahosted.org/augeas/ticket/247
+
+2012-01-09  David Lutterkort  <lutter@redhat.com>
+
+       * build/aux/move-if-change: refresh with latest from gnulib
+       Taken from gnulib commit 1602f0af
+
+2012-01-02  Dominic Cleal  <dcleal@redhat.com>
+
+       * src/augtool.c (main_loop): re-open rl_outstream/stdout only when stdout isn't   a tty (fixes -e -i); use /dev/tty instead of /dev/stdout when re-opening to   prevent permission errors
+       Fixes ticket #241
+
+2011-12-31  Dominic Cleal  <dcleal@redhat.com>
+
+       * tests/test-augtool.sh: fix broken gsed check
+
+2011-12-30  Dominic Cleal  <dcleal@redhat.com>
+
+       Remove Linux-isms so tests can run on Solaris
+       * tests/test-augtool-modify-root.sh: /bin/sh -> /bin/bash
+       * tests/test-augtool.sh: /bin/sh -> /bin/bash, use 'gsed' if available (GNU sed
+         is required)
+       * tests/test-load.c: don't use GNU sed in-place extension
+       * tests/test-preserve.sh: handle Solaris `ls -il` output
+
+       * bootstrap: add strchrnul gnulib module (for Solaris)
+
+2011-12-24  Jim Meyering  <meyering@redhat.com>
+
+       Don't use variables uninitialized upon error
+       * src/transform.c (filter_generate): Move declarations and
+         initializations of pathv and pathc to precede possible
+         "goto error;" via which those variables are used.
+
+2011-12-23  Francis Giraldeau  <francis.giraldeau@gmail.com>
+
+       fix fatest linking
+
+2011-12-19  Raphaël Pinson  <raphink@gmail.com>
+
+       Rebase yum.aug on inifile.aug, support comments (except in lists) Fix ticket #217
+
+       Add @return to shellvars.aug
+
+2011-12-19  Erinn Looney-Triggs  <erinn.looneytriggs@gmail.com>
+
+       Create lens and tests for sssd.conf heavily based on mysql and php lenses.
+
+2011-12-18  Raphaël Pinson  <raphink@gmail.com>
+
+       aliases.aug: commands can be fully enclosed in quotes (Fix ticket #229)
+
+2011-12-18  Erinn Looney-Triggs  <erinn.looneytriggs@gmail.com>
+
+       Add in single-request-reopen into lens and tests.
+
+2011-12-16  Michael Chapman  <mike@very.puzzling.org>
+
+       Add missing argument to escape()
+       Fixes ticket #242.
+
+2011-12-10  Dominic Cleal  <dcleal@redhat.com>
+
+       * src/augeas.c (tree_root_ctx): create context path if it doesn't exist
+
+2011-12-09  Raphaël Pinson  <raphink@gmail.com>
+
+       Add libxml2-devel to requirements in HACKING
+
+2011-12-08  Raphaël Pinson  <raphink@gmail.com>
+
+       Debian-based distributions use /etc/mdadm/mdadm.conf
+
+2011-12-05  Raphaël Pinson  <raphink@gmail.com>
+
+       Support include() in phpvars.aug
+
+       Add unit test for bug #239
+
+       In aug_to_xml: do not replace pathin with '/*' unless the length is 0 or pathin is '/' (Fix ticket #239)
+
+2011-12-03  Richard W.M. Jones  <rjones@redhat.com>
+
+       pkg-config: Augeas requires libxml2.
+
+2011-12-02  David Lutterkort  <lutter@redhat.com>
+
+       Version 0.10.0
+
 2011-12-02  Dominic Cleal  <dcleal@redhat.com>
 
        Implement escape sequences for whitespace, quotes and square brackets in command arguments to match Puppet provider.
        * src/augeas.c (aug_to_xml): rename 'path' attr on root to 'match'
        The attribute contains a path expression, not just a path.
 
+2011-12-01  David Lutterkort  <lutter@redhat.com>
+
        Make it possible for aug_init to report initialization errors
        Sometimes initialization fails for mundane reasons, like syntax errors in
        lens files. So far, it was not possible for callers to report details for
          * src/augtool.c: call aug_init with AUG_NO_ERR_CLOSE and print errors on
            initialization failure
 
+2011-12-01  David Lutterkort  <lutter@redhat.com>
+
        Update documentation for augtool/augrun and man page
 
        Adjust more copyright notices
 
        Fixes bug #238
 
+2011-11-29  David Lutterkort  <lutter@redhat.com>
+
        * tests/cutest.c: run one test when CUTEST env var is set
 
 2011-11-29  Raphaël Pinson  <raphink@gmail.com>
                  ^
          Configuration file errors encountered -- exiting
 
+2011-11-15  Michael Chapman  <mike@very.puzzling.org>
+
        Access: parse user@host and (group) in users field
        pam_access matches the hostname in user@host against the system's own
        hostname, which allows a single access.conf to be shared amongst
        pam_access also allows group names to be optionally enclosed in
        parentheses to disambiguate them from user names.
 
+2011-11-15  Michael Chapman  <mike@very.puzzling.org>
+
        Access: field separator need not be surrounded by spaces
        For compatibility with the old behaviour and to match the examples in
        the PAM documentation, new entries are still emitted with spaces.
 
        Mdadm: use case-insensitive regexps
 
+2011-11-15  David Lutterkort  <lutter@redhat.com>
+
        * src/fa.c (totalize): handle case-insensitive FA's properly
        The convention for case-insensitive FA's is that they do not contain any
        transitions on [A-Z], effectively removing upper case letters from the
        exception of \/ and \\ sequences. These needs to be handled by
        unescape() directly.
 
+2011-10-10  Michael Chapman  <mike@very.puzzling.org>
+
        FAI_DiskConfig: Fix invalid escape sequence \s
        It should be expanded to [ \n\t].
 
+2011-10-10  Michael Chapman  <mike@very.puzzling.org>
+
        Cron: Fix parsing of numeric fields
        In:
 
        erroneously allowed a whole bunch of characters (including all uppercase
        letters) in numeric fields.
 
+2011-10-10  Michael Chapman  <mike@very.puzzling.org>
+
        Cgconfig: Fix parsing of group names
        In:
 
        xpath test. fai_diskconfig does this. As a temporary fix, we disable transform
        from fai_diskconfig.
 
+2011-08-31  Francis Giraldeau  <francis.giraldeau@gmail.com>
+
        Adding ssh client lens
        This lens parses the client side configuration directives of ssh.
 
        By reformating eol of pupperfileserver test, it's possible to make both git and
        unit test working.
 
+2011-08-11  Francis Giraldeau  <francis.giraldeau@gmail.com>
+
        Remove trailing white spaces from puppet test
        Trailing white lines are valid in a puppet file, but the test is rejected when
        pushing to master git repository.
 
        Of course, this is a heinous hack.
 
+2011-07-22  David Lutterkort  <lutter@redhat.com>
+
        Migrate tests from test-mv.sh into run.tests
 
        aug_srun: new API call
        Sudoers: allow same-line comments
        Fixes ticket #206
 
+2011-06-29  Dominic Cleal  <dcleal@redhat.com>
+
        Util: allow comment_or_eol to match empty comments containing only whitespace
        Services: add test for line with a whitespace-only comment
 
 
        test root: add a few more files
 
+2011-04-29  David Lutterkort  <lutter@redhat.com>
+
        path expressions: allow whitespace inside names
        This makes the path expression '/files/etc/foo bar/baz' legal, i.e. it is
        no longer necessary to escape whitespace in path expressions.
 
        Enable the test for continuation lines in test_httpd.aug
 
+2011-03-25  Bill Pemberton  <wfp5p@virginia.edu>
+
        Add /etc/httpd/conf/httpd.conf to the filter list for httpd.aug
 
        Allow blank and comment lines throughout config file in iptables
 
        Thanks to thefoxbox for the enhancement
 
+2011-03-17  Francis Giraldeau  <francis.giraldeau@gmail.com>
+
        Fix unmatch bracket causes segfault in augtool.c
        When command is parsed in augtool, function nexttoken verify that path has
        valid and matching brackets and return NULL if not. The function cleanpath that
 
        Version 0.8.0
 
+2011-02-23  David Lutterkort  <lutter@redhat.com>
+
        Fix compile errors found by gcc 4.6.0
        There were several places that caused the new 'variable assigned but not
        used' warning.
        The struct lens also contained the member jmt twice; it is now only
        available for L_REC lenses.
 
+2011-02-23  David Lutterkort  <lutter@redhat.com>
+
        * src/info.h: include stdlib so we can use uint
 
        * tests/Makefile.am: distribute the test data in test-augtool/
          * Fix copy/paste error about config files
          * Added filters for Fedora and RHEL
 
+2011-01-25  Francis Giraldeau  <francis.giraldeau@gmail.com>
+
        Add Httpd lens
        The Httpd lens parses Apache Web server configuration according to the manual.
 
        for that file up for loading. This reduces the runtime of the tests from ~
        30s on my machine to under 2s.
 
+2011-01-11  David Lutterkort  <lutter@redhat.com>
+
        Test that getting and setting the root node works
        This tests the same thing that test-get.sh tests, but in a much more
        reliable fashion
 
        Refactor augtool.c to use only readline
 
+2011-01-10  Raphaël Pinson  <raphink@gmail.com>
+
        augtool: add --autosave option
        Additional changes to augtool:
          * Define AUGTOOL_PROMPT as a constant
 
        Enable square lens in dump_lens
 
+2010-12-10  Francis Giraldeau  <francis.giraldeau@usherbrooke.ca>
+
        Add square lens to language
        The new primitive square lens allows to handle XML like open and close tags.
        It takes 2 arguments, a regexp for the tag and a lens for the content. The
        comment entries.  Adapt tests for shellvars and services to take this new
        behaviour in consideration.
 
+2010-11-19  Raphaël Pinson  <raphink@gmail.com>
+
        Add "indomU" Debian setting to grub.aug (Fix ticket #162)
 
        Allow "\" style newlines in syslog.aug and add corresponding test (Fix ticket #161).
 
        * tests/Makefile.am (lens_tests): add tests for new lenses
 
+2010-11-18  David Lutterkort  <lutter@redhat.com>
+
        Krb5 (realm_re, app_re): allow digits in realm names
        Still makes the incorrect assumption that realm names start with an upper
        case letter, and app names with a lower case one, but it's an improvement
 
        * src/try: add an optioj to strace augtool
 
+2010-09-09  David Lutterkort  <lutter@redhat.com>
+
        Properly record the new mtime of a saved file in the tree
        transform_save used to pass an incorrect file name to add_file_info (the
        name was missing the root prefix), leading to an mitme of 0 for all saved
 
        Version 0.7.3
 
+2010-08-06  David Lutterkort  <lutter@redhat.com>
+
        Fix behavior of aug_defnode
          (1) Make sure that the definition of the variable is recorded under
              /augeas/variables
          * augeas.c (pathx_aug_parse): renamed, add optional arg for a different
            root
 
+2010-08-05  David Lutterkort  <lutter@redhat.com>
+
        Fix BZ 613967 - memory corruption on reloading externally modified file
        The problem was that when we replaced the old tree for a file with the new
        one we just read from the file, the replace operation did not update
          * tests/test-load.c (testReloadExternalMod): test that we do not segfault
            when a file was modified externally
 
+2010-08-05  David Lutterkort  <lutter@redhat.com>
+
        Test root: mimick the setup of grub config files on Fedora more closely
          * root/etc/grub.conf: symlink to root/boot/grub/grub.conf
          * root/boot/grub/grub.conf: new file with contents of /etc/grub.conf
        The lens doesn't autoload any files yet, though we should consider moving
        most of the files that Shellvars loads over to this lens.
 
+2010-07-23  David Lutterkort  <lutter@redhat.com>
+
        * src/lens.c (lns_check_rec): allow 'let rec' with regular RHS
        If the user writes 'let rec l = rhs' and the RHS does not mention l, just
        mark the lens as regular and carry on.
 
        * src/syntax.c (load_module_file): make sure we report an error
 
+2010-07-21  David Lutterkort  <lutter@redhat.com>
+
        Fix segfault in glue routines; add test for the fix
        The tree_*_glue functions did not set the error struct when parsing a path;
        this caused a segfault when trying to insert before/after a non-existant
 
        Fixes bug #129
 
+2010-07-21  David Lutterkort  <lutter@redhat.com>
+
        * src/syntax.c (compile_test): reset errors at the end of the test
        Otherwise, we can't have tests succeed after tests failed intentionally (by
        making their result '= *')
        obliterating the tree and filling it with the latest from disk. This
        includes throwing away unsaved changes or trees that have been deleted.
 
+2010-06-29  David Lutterkort  <lutter@redhat.com>
+
        Add utility tree_store_value to avoid unnecessary strdup's
          * src/internal.h (tree_store_value): add prototype
          * src/augeas.c (tree_store_value): new function; (tree_set_value): use
          * src/augeas.c (tree_clean): remove 'static'
          * src/internal.h (tree_clean): add prototype
 
+2010-06-29  David Lutterkort  <lutter@redhat.com>
+
        Add xstrtoint64 to internal.[ch]
        The implementation is directly from libvirt
 
          * src/internal.h (xstrtoint64): add prototype
          * src/internal.c (xstrtoint64): add impl
 
+2010-06-29  David Lutterkort  <lutter@redhat.com>
+
        * src/test-load.c (testLoadSave): work off a writable /etc/hosts
        This addresses a FIXME that could lead to use not detecting incorrect behavior
 
          * tests/cutest.c (run): add impl
          * tests/test-save.c (run): remove
 
+2010-06-29  David Lutterkort  <lutter@redhat.com>
+
        Redefine all variables upon load
        This is a slight change in behavior: before, we used to just discard the
        contents of all variables upon load. Now, we redefine variables by
        The change in behavior is backwards compatible, since at worst, users will
        redefine variables themselves after an aug_load
 
+2010-06-29  David Lutterkort  <lutter@redhat.com>
+
        * src/augeas.c (aug_init): create /augeas/variables on startup
 
        * src/augeas.c (aug_defvar): use constants to create /augeas/variables
 
        File was reported in bug #122
 
+2010-04-21  David Lutterkort  <lutter@redhat.com>
+
        tests: make most tests work on Solaris
        The test scripts are full of bashisms; removed some of them, though for
        most, just changed the shell from /bin/sh to /bin/bash; removing bashisms
 
        Tests now mostly pass (82/85) on the OpenCSW Solaris 5.10 build machine
 
+2010-04-21  David Lutterkort  <lutter@redhat.com>
+
        * tests/test-save.c: use proper includes for WIFEXITED
        Without them, the build fails on FreeBSD
 
 
        Debctrl: whitespace cleanup, no functional change
 
+2010-04-20  David Lutterkort  <lutter@redhat.com>
+
        * src/fa.c (re_iter_as_string): escape literal '|'
        When turning a FA back to a string, a literal '|' needs to be output as '\|'
 
 
        * src/augtool.c: report an error when 'get' fails
 
+2010-04-19  David Lutterkort  <lutter@redhat.com>
+
        aug_get: return -1 when multiple nodes match
        This fixes breakage in the API contract for aug_get, introduced in commit
        e80494a6. Also adds a test to ensure we do not break API for aug_get again.
        distinguish between internal errors, syntax errors and successful parses
        properly.
 
+2010-04-16  David Lutterkort  <lutter@redhat.com>
+
        * src/get.c (visit_exit): handle L_MAYBE
        Added test to tests/modules/pass_simple_recursion.aug, lens 'maybe'
 
        Fixes bug #119
 
+2010-04-16  David Lutterkort  <lutter@redhat.com>
+
        * src/jmt.c (build_tree): print debug output for build_nullable
 
 2010-03-12  David Lutterkort  <lutter@redhat.com>
 
        * src/fa.c (parse_int): flag not parsing anything as an error
 
+2010-02-08  David Lutterkort  <lutter@redhat.com>
+
        * src/jmt.c: add caller filtering
        Caller filtering is needed to weed out seemingly ambiguous parse trees (see
        Section 5.3 of Jim/Mandelbaum's paper)
        Also adds two pathological lenses and tests to
        pass_simple_recursion.aug. Those tests fail without caller filtering.
 
+2010-02-08  David Lutterkort  <lutter@redhat.com>
+
        * AUTHORS: reformatted
 
        * tests/Makefile.am: add test for cobblermodules.aug
 
        Bug reported by Matt Palmer
 
+2010-01-27  David Lutterkort  <lutter@redhat.com>
+
        * src/get.c (no_match_error): initialize lname
        Otherwise, gcc complains about a possibly uninitialized value with -O2
 
 
        Test for using a recursive lens inside other lenses
 
+2010-01-25  David Lutterkort  <lutter@redhat.com>
+
        * src/get.c: handle recursive lenses that are not L_REC
        Since any lens that uses an L_REC is itself recursive, the distinction
        whether to use get_rec or get_lens can be made in lns_get
 
        Fixes ticket #100
 
+2010-01-25  David Lutterkort  <lutter@redhat.com>
+
        Properly handle lenses that use L_REC lenses
        In constructs involving a recursive lens, we need to take the body of the
        recursive lens into consideration. We avoid infinite recursion by stopping
          * src/jmt.c: when building the jmt, consider L_REC as long as it's not
            internal
 
+2010-01-25  David Lutterkort  <lutter@redhat.com>
+
        * src/jmt.c (print_grammar): recurse into L_REC if they are not rec_internal
 
+2010-01-25  David Lutterkort  <lutter@redhat.com>
+
        * src/jmt.c (jmt_visit): allow for toplevel lenses that are not L_REC
        To reconstruct the parse of a lens that is not L_REC, but uses L_REC,
        e.g. l* where l is L_REC, we can not assume any longer that the root of the
        of the root of the parse tree; the Earley graph does not contain an item
        for that, which makes this operation slightly special.
 
+2010-01-25  David Lutterkort  <lutter@redhat.com>
+
        * src/lens.c: propagate rec_internal in the body of an L_REC
 
        * src/lens.c: don't short-circuit typechecking for recursive lenses explicitly
        allowed if the first expression is of type unit, i.e. '() ; something' is
        legal.
 
+2010-01-15  David Lutterkort  <lutter@redhat.com>
+
        Language: allow '_' as an identifier that is never bound
          The expression
            let _ = something
          * src/lexer.l (LID): allow leading underscore
          * src/syntax.c (bind, bind_type): do not bind '_'
 
+2010-01-15  David Lutterkort  <lutter@redhat.com>
+
        New primitive lens 'value'
        In analogy to 'label', this lens allows setting the value of a tree node to
        a fixed string
 
        Tests for recursive (context free) lenses
 
+2010-01-14  David Lutterkort  <lutter@redhat.com>
+
        Syntax for recursive lenses
        Add a 'let rec' construct; the syntax should be considered experimental and
        might be changed to some other form of expressing recursion.
            of let_check_rec within the interpreter
          * src/syntax.c (free_term): now extern, not static
 
+2010-01-14  David Lutterkort  <lutter@redhat.com>
+
        * src/get.c (get_rec, parse_rec): get/parse for recursive lenses
 
        * src/put.c: put/create for recursive lenses
 
        * src/lens.h: add a recursive lens combinator
 
+2010-01-14  David Lutterkort  <lutter@redhat.com>
+
        A simple debug facility
        Debugging is disabled by default. When configured with --enable-debug=yes,
        Augeas will look at runtime at the environment variable AUGEAS_DEBUG, which
          * src/internal.h (debugging, debug_file): new functions
          * src/internal.c (debugging, debug_file): new functions
 
+2010-01-14  David Lutterkort  <lutter@redhat.com>
+
        struct error: add pointer back to struct augeas
 
        * src/errcode.h: more usable BUG_ON and BUG_FMT
 
        * src/lens.c (str_to_fa): remove FIXME's and use proper error reporting
 
+2010-01-13  David Lutterkort  <lutter@redhat.com>
+
        Support for case-insensitive regexps
        Add nocase argument to make_regexp, and adjust all uses of make_regexp to
        pass that in. For concatenation and union of regexps we have to expand
 
        Adjust all uses of make_regexp.
 
+2010-01-13  David Lutterkort  <lutter@redhat.com>
+
        Add fa_expand_nocase to libfa
 
        Support for case-insensitive operations in libfa
            be enclosed in quotes if they have spaces with predicates, e.g. you can
            now type 'get /foo[ last() ]'
 
+2010-01-07  David Lutterkort  <lutter@redhat.com>
+
        Record an error if more than one lens tries to load a file
          * src/transform.c (file_info): new function; (transform_load): detect if
            more than one lens tries to load a file and record error in
          * src/transform.c (file_name_path): new function; (load_file): use
            file_name_path
 
+2010-01-07  David Lutterkort  <lutter@redhat.com>
+
        Change the metadata for individual files
        Record the name of the lens used to load the file in the lens node
        underneath /augeas/files/$PATH; the location info of the lens is kept in
            lens node
          * tests/xpath.tests (lircd-ancestor): adapt to metadata change
 
+2010-01-07  David Lutterkort  <lutter@redhat.com>
+
        * src/transform.c (add_file_info): manipulate tree directly
        Going through public functions like aug_set is silly, and causes all kinds
        of string munging.
          * src/transfrom.h (xfm_lens_name): add prototype
          * src/transform.c (xfm_lens_name): new function
 
+2010-01-07  David Lutterkort  <lutter@redhat.com>
+
        Tree functions to find/create a node with a path expression
        Internal counterparts to aug_get and aug_set
 
          * src/internal.h (tree_find, tree_find_cr): new prototypes
          * src/augeas.c (tree_find, tree_find_cr): new functions
 
+2010-01-07  David Lutterkort  <lutter@redhat.com>
+
        * src/internal.h: make various tree management functions available
 
 2010-01-06  David Lutterkort  <lutter@redhat.com>
 
        Fixes bug #98
 
+2010-01-05  David Lutterkort  <lutter@redhat.com>
+
        New error code AUG_ENOLENS
        Indicates failure to look a lens up by name from /augeas/load/*/lens
 
          * src/augeas.h (aug_errcode_t): new value AUG_ENOLENS
          * src/augeas.c (errcodes): new entry for AUG_ENOLENS
 
+2010-01-05  David Lutterkort  <lutter@redhat.com>
+
        * src/lens.c (lens_release): tolerate a NULL lens
 
 2010-01-04  Bryan Kearney  <bkearney@localhost.localdomain>
 
        * src/builtin.c (lens_get, lens_put): propagate errors as exceptions
 
+2009-12-18  David Lutterkort  <lutter@redhat.com>
+
        More convenience macros for errors
        Add BUG_ON and ERR_RET macros for reporting internal errors
 
 
        Fixes ticket #93
 
+2009-11-25  David Lutterkort  <lutter@redhat.com>
+
        * src/lexer.l: include errcode.h; fix bad use of report_error
 
        * src/errcode.c: include stdarg.h
 
+2009-11-25  David Lutterkort  <lutter@redhat.com>
+
        Cron: variable names can contain '_' etc.
        Use Shellvars.key_re for consistency.
 
 
        * test/Makefile.am (TEST_ENVIRONMENT): set LANG to a non-C locale
 
+2009-11-10  David Lutterkort  <lutter@redhat.com>
+
        Remove character ranges from regexps if we are not in the C locale
        Since re_compile_pattern uses the current locale when expanding character
        ranges like [a-z], we need to be careful that such ranges are expanded in
        Fixes ticket #35 for systems that do not have uselocale (for systems with
        uselocale, the fix is commit 07b6a880)
 
+2009-11-10  David Lutterkort  <lutter@redhat.com>
+
        libfa: new function fa_expand_char_ranges
 
        Calls to __aug_load_module need to go through api_entry/api_exit
 
+2009-11-10  David Lutterkort  <lutter@redhat.com>
+
        Switch to C locale on API entry on systems that have uselocale
        Since we need to do all our operations (especially regexp matching) in the
        C locale, we switch to that on API entry, and switch back to the user's
 
        Fixes ticket #89
 
+2009-10-21  David Lutterkort  <lutter@redhat.com>
+
        * src/pathx.c (clone_nodeset): properly set size of the clone
        The size of the clone is the number of nodes in the original nodeset, not
        the size of the original nodeset.
        Wine: new lens and test
        Lens for parsing textual Windows registry files
 
+2009-10-20  David Lutterkort  <lutter@redhat.com>
+
        Pam: allow '-' before type
        The type field in a pam.d file can start with a '-' to indicate that
        missing the module should not cause an error. The '-' is now mapped into
 
        Bug reported by Shannon Hughes
 
+2009-10-20  David Lutterkort  <lutter@redhat.com>
+
        * test/Makefile.am (lens_tests): add lens-ethers.sh
 
        * src/internal.c (escape): convert char to unsigned when printing as octal
          * lenses/rx.aug (device_name): new regexp
          * lenses/tests/test_lokkit.aug: new test for more permissive device names
 
+2009-10-09  David Lutterkort  <lutter@redhat.com>
+
        Lokkit.forward_port: add missing eol
        Also adjust test_lokkit.aug since we're not getting a spurious empty entry
        anymore
 
        * src/regexp.c (regexp_compile): do not print anything on error
 
+2009-09-21  David Lutterkort  <lutter@redhat.com>
+
        Split regexps, info and strings out of syntax.[ch]
          * Move struct string and struct info and related functions into info.[ch]
          * Move headers for regexp.c into new file regexp.h
        This makes it easier to reuse these outside of syntax.[ch] - including
        syntax.h in get.c and put.c was way too much anyway.
 
+2009-09-21  David Lutterkort  <lutter@redhat.com>
+
        aug_match, aug_mv: return -1 when pathx evaluation fails
 
        Report errors when exactly one match is expected
        e.g. when the original file is bindmounted - in that situation, we have to
        copy.
 
+2009-09-03  David Lutterkort  <lutter@redhat.com>
+
        * src/syntax.c (print_value): use print_tree instead of dump_tree
 
 2009-09-02  David Lutterkort  <lutter@redhat.com>
        The tests strips optional quotes and puts them back (or creates them) as
        needed, only depending on the value of the tree node.
 
+2009-08-31  David Lutterkort  <lutter@redhat.com>
+
        Match trees on label and value, not just label
        We still only use one level in the tree for matching in the put direction,
        but take the values of nodes into account.
        We had fail_ tests in place to document the deficiency of the tree matcher,
        but with that deficiency gone, these now become passing tests.
 
+2009-08-31  David Lutterkort  <lutter@redhat.com>
+
        Restrict the alphabet of a regexp
 
        Use offsets for various lens types
 
        * src/builtin.c (tree_clear_glue): primitive clear function for use in tests
 
+2009-08-31  David Lutterkort  <lutter@redhat.com>
+
        Utility function xasprintf
        Like asprintf, but don't leave first arg in limbo on error
 
        *  src/internal.h (xasprintf): new prototype
        *  src/internal.c (xasprintf): new function
 
+2009-08-31  David Lutterkort  <lutter@redhat.com>
+
        regexp_release: allow NULL regexp
 
        * src/augeas.c: do not read past the end of the load path
 
        Fixes bug #79
 
+2009-08-10  David Lutterkort  <lutter@redhat.com>
+
        Pass symtab explicitly into pathx_symtab_remove_descendants
 
 2009-08-06  David Lutterkort  <lutter@redhat.com>
 
        Fixes bug #78
 
+2009-08-06  David Lutterkort  <lutter@redhat.com>
+
        * src/transform.c (add_file_info): change what we store about a file
        For a file FILE, we now only record the path and the info for the lens;
        instead of
        The id wasn't useful to anybody, and the lens info is useful for debugging
        at best
 
+2009-08-06  David Lutterkort  <lutter@redhat.com>
+
        * src/transform.c (add_file_info): minor cleanup
          - Rename add_load_info to add_file_info
          - Eliminate filename argument, since it's redundant
 
+2009-08-06  David Lutterkort  <lutter@redhat.com>
+
        defnode: when creating new node, put it in the nodeset
        When a new node is created, e.g. with 'defnode x "/foo[0 = 1]"' we used to
        assign an empty nodeset to x. Now x will hold a reference to the newly
        as it does not know what types to expect, it stores a bare string. This
        will include quote marks.
 
+2009-08-04  Matthew Booth  <mbooth@redhat.com>
+
        Add more specific entry handlers to xorg.conf
        Additionally handle:
        * Driver
        values are valid. For example, with this patch Driver will not accept an
        unquoted value, which would cause the X server not to start.
 
+2009-08-04  Matthew Booth  <mbooth@redhat.com>
+
        Parse more directives in xorg.conf
        The default xorg.conf generated by pyxf86config on Red Hat/Fedora systems
        is not parsed by the current xorg.conf. Specifically it does not
 
        Fixes bug #72 reported by Micah
 
+2009-07-08  David Lutterkort  <lutter@redhat.com>
+
        Shellvars: allow backticks as quote characters
          * lenses/shellvars.aug (simple_value): allow backticks as quotes
          * lenses/tests/test_shellvars.aug: add tests
 
        Fixes part of bug #67 reported by Micah
 
+2009-07-08  David Lutterkort  <lutter@redhat.com>
+
        Logrotate: make owner/group in create statement optional
          * lenses/logrotate.aug (create): make mode/owner/group optional
          * lenses/test/test_logrotate.aug: add tests
 
        Fixes part of bug #67 reported by Micah
 
+2009-07-08  David Lutterkort  <lutter@redhat.com>
+
        * configure.ac: use AC_SYS_LARGEFILE
        Suggested by Jeff Johnson <n3npq@mac.com>
 
+2009-07-08  David Lutterkort  <lutter@redhat.com>
+
        * src/augeas.c (init_root): when root0 == "", use "/" as root
        When an empty string is passed as root0, make sure we do not make an
        invalid memory access when we look for the trailing slash.
 
        Fixes part of ticket #66
 
+2009-06-11  Anders F Björklund  <afb@users.sourceforge.net>
+
        configuration: check whether rl_completion_matches is available
        That function is missing on OS/X; we substitute it with a dummy if readline
        does not provide it.
 
        Fixes part of ticket #66
 
+2009-06-11  Anders F Björklund  <afb@users.sourceforge.net>
+
        * src/augtool.c: add missing include for ctype.h
        Part of fix for ticket #66
 
        Whitespace cleanup (no functional change)
        Remove trailing whitespace
 
+2009-05-29  David Lutterkort  <lutter@redhat.com>
+
        Ntp: support more commands
        * process 'broadcastdelay'
        * process enable/disable flags
 
        Fixes bug #62, reported by Frank Sweetser
 
+2009-05-29  David Lutterkort  <lutter@redhat.com>
+
        Fix grammar docs (production for PrimaryExpr was wrong)
 
        * tests/root/etc/: add group and passwd files
        Cron: new lens and test
        Parses /etc/crontab and /etc/cron.d
 
+2009-04-08  Raphael Pinson  <raphink@gmail.com>
+
        Sudoers: allow backslashes inside sto_to_com and sto_to_com_user
        This patch fixes ticket #60 which reports the possible usage of
        backslashes in sudoers aliases (for use with e.g. Windows resources).
        Additionally, add a line with backslashes in test_sudoers to prevent
        regressions.
 
+2009-04-08  Raphael Pinson  <raphink@gmail.com>
+
        Xinetd: map comments using Util.comment
 
        Squid: allow indentation of entries
 
        Also exposes comments in /etc/aliases as #comment nodes
 
+2009-04-03  Raphael Pinson  <raphink@gmail.com>
+
        New utility modules Build, Rx, and Sep
 
 2009-04-03  Marc Fournier  <marc.fournier@camptocamp.com>
 
        Thanks to Nate Foster for the inspiration of this
 
+2009-03-25  David Lutterkort  <lutter@redhat.com>
+
        Sudoers: produce at most one negate node
        Even if there are multiple '!' signs, only produce one negate node.
 
        into $(datadir)/augeas/lenses, they are automatically preferred over the
        ones we ship.
 
+2009-03-24  David Lutterkort  <lutter@redhat.com>
+
        New API call aug_defnode and augtool command defnode
        It's common that we want to define a variable to reference /foo/bar, and
        create that node if it does not exist yet. aug_defnode bundles that
 
        * src/fa.h: use 'struct fa *' instead of fa_t
 
+2009-03-13  David Lutterkort  <lutter@redhat.com>
+
        * src/augeas.c: fix handling of dirty flag
        Under some circumstances, we did not properly propagate the dirty flag up
        the tree, leading to files that were not saved even though they should have
        This also removes two full sweeps over the tree for dirty handling, and now
        only touches nodes that are/need to be marked dirty.
 
+2009-03-13  David Lutterkort  <lutter@redhat.com>
+
        * Makefile.maint: different setup at home
 
 2009-03-12  David Lutterkort  <lutter@redhat.com>
 
        Test the Debian Lenny sample squid.conf
 
+2009-03-09  Francois Deppierraz  <francois.deppierraz@camptocamp.com>
+
        Add a bunch of keywords available on squid-2.7-STABLE6 or squid-3.HEAD-20090308.
        The keywords list was generated by the following command:
 
 
        * src/pathx.c: make sure ['foo' != 'foo'] is false
 
+2009-03-02  David Lutterkort  <lutter@redhat.com>
+
        * src/pathx.c: handle names with '.' properly
        Make sure that a component ina path expression like '.bar' is parsed as a
        single step (name), and not as the self axis '.' followed by some
 
        Bug reported by Jan Kupec
 
+2009-03-02  David Lutterkort  <lutter@redhat.com>
+
        * src/pathx.c: it is an error if we don't consume the whole expression
 
 2009-02-27  David Lutterkort  <lutter@redhat.com>
 
        * src/pathx.c: allow '=' and '!=' of numbers
 
+2009-02-18  David Lutterkort  <lutter@redhat.com>
+
        * src/pathx.c: fix matching multiple predicates
        We used to evaluate /path[pred1][last()] wrong - last() must match the last
        node in the nodeset /path[pred1], not the last node in the nodeset /path.
 
        This requires that we compute nodesets explicitly.
 
+2009-02-18  David Lutterkort  <lutter@redhat.com>
+
        Logrotate: small fixes
        * recognize 'yearly' schedule
        * allow whitespaces around { and }
        The typecheck is redundant (we already do that when running lens tests) and
        really slow
 
+2009-02-06  David Lutterkort  <lutter@redhat.com>
+
        Grub: process 'savedefault' in boot stanza
        Also, allow keywords to be preceded by whitespace
 
        Fixes ticket #36
 
+2009-02-06  David Lutterkort  <lutter@redhat.com>
+
        Minor whitespace cleanup
 
 2009-02-02  Free Ekanayaka  <free@64studio.com>
        * pathx_next does not need an explicit argument for the current
          tree node any more
 
+2009-01-30  David Lutterkort  <lutter@redhat.com>
+
        Expand the grammar for path expressions
        * add predicates based on labels and values
        * allow path expressions in predicates, e.g. '/foo/bar[../baz = "7"]'
 
        Also add tests to check path expression evaluation
 
+2009-01-30  David Lutterkort  <lutter@redhat.com>
+
        Use absolute paths in lens tests when manipulating the tree
        Paths that start with a number (like '1/ipaddr') are ambiguous in the new
        path expression grammar and will confuse the parser; to make it clear that
        Segments do not need to track the tree node where they matched anymore,
        since we can get the same information by following parent pointers.
 
+2008-12-23  David Lutterkort  <lutter@redhat.com>
+
        Make finding the parent and siblings of a node uniform
        All nodes (including the root) now have a parent node, so
        that the start of the list of siblings can be found as
        children are the real root nodes. Another way to look at this is
        that the tree is now edge-labeled.
 
+2008-12-23  David Lutterkort  <lutter@redhat.com>
+
        Rename seg_siblings to tree_siblings
 
        Add an explicit parent pointer to the tree
        Logrotate: add dateext flag
        Patch by Sean E. Millichamp
 
+2008-09-22  David Lutterkort  <dlutter@redhat.com>
+
        Various changes to the NaturalDocs support
        This patch changes a few things around in the NaturalDocs support:
 
        There's no need to construct an FA to check if a regular expression matches
        the empty string.
 
+2008-09-03  David Lutterkort  <dlutter@redhat.com>
+
        Properly typecheck the '?' operator
        The '?' operator was completely missing a typecheck for the atype. The
        check must make sure that neither the ctype nor the atype match the empty
        Script to run lens tests through Valgrind
        We don't run this as part of 'make check' since it's _very_ slow.
 
+2008-08-27  David Lutterkort  <dlutter@redhat.com>
+
        Dhclient: change some defaults for del
        This is really a bug in how string literals are unescaped by the lexer, but
        we can sidestep the problem here.
 
        Shellvars: one more cornercase with double quoted strings
 
+2008-08-15  David Lutterkort  <dlutter@redhat.com>
+
        Shellvars: much improved handling
        - handle single and double quoted strings correctly
        - parse arrays into a subtree
 
        Inspired by a chat and preliminary work by nahamu
 
+2008-08-15  David Lutterkort  <dlutter@redhat.com>
+
        skel_instance_of: remove pointless check
        There is no point in trying to match against skel->text for a store lens
        since that is always NULL.
 
        Added test in test-mv.sh to test that moving at the root level works.
 
+2008-08-14  David Lutterkort  <dlutter@redhat.com>
+
        Module names are treated case-insensitively
        Before, if you had a module 'Mod' in file 'mod.aug' and requested variable
        'MoD.var' from another module, the interpreter would throw itself into a
 
        Test for continuation lines
 
+2008-08-11  David Lutterkort  <dlutter@redhat.com>
+
        Posix ERE compliant escaping
        Posix extended regular expressions treat a backslash outside of a character
        class always as an escape character, with the character sequence '\\x'
        by a sequence) or when all entries fall under one key, adding an entry to a
        dict is O(log n).
 
+2008-08-09  David Lutterkort  <dlutter@redhat.com>
+
        Don't use registers in split_iter
        The data in the registers was never used, calculating it causes some
        overhead in the matcher.
        inside a leaf node. In that case, we know that there is no possible split,
        and therefore can save the trouble of calling regexp_match.
 
+2008-08-08  David Lutterkort  <dlutter@redhat.com>
+
        Avoid O(n^2) runtime by appending to lists in constant time
        The data structure used to keep track of successive matches of an iterated
        lens, a split list, was being appended to by traversing the list for each
        Dicts still have that problem - they need to be changed to hash tables to
        address this issue.
 
+2008-08-08  David Lutterkort  <dlutter@redhat.com>
+
        Add list_reverse and list_tail_cons
        list_reverse reverses a list in place. list_tail_cons appends to a list in
        constant time, since it is given a pointer to the tail of the list.
        libaugeas, we also bump the minor version, since we just added aug_mv to
        the interface.
 
+2008-08-07  David Lutterkort  <dlutter@redhat.com>
+
        Check that 'put' fails when invalid tree entries are present
        put_quant_star and create_quant_star did not compare the part of the tree
        they should transform against the part of the tree they actually
 
        Fixes bug https://fedorahosted.org/augeas/ticket/1
 
+2008-08-07  David Lutterkort  <dlutter@redhat.com>
+
        Return an exit status from augtool
        augtool will return a non-zero exit status if any command issued
        failed. This is useful when piping multiple commands into augtool to check
 
        Added tag release-0.2.1 for changeset 13fdcd9bb18a
 
+2008-07-17  David Lutterkort  <dlutter@redhat.com>
+
        aliases.aug: Do not require whitespace after commas
        It's perfectly fine to have an alias like 'alias: target1,target2'
 
 
        Bug reported by Raphael Pinson.
 
+2008-07-16  David Lutterkort  <dlutter@redhat.com>
+
        Add support for 'insert' in unit tests
        Two new primitives 'insa' (insert after) and 'insb' (insert before) are
        added so that unit tests can modify the tree through insert, as in
        Most of this fix suggested by Jim Meyering, I only touched it up a little
        (and no doubt introduced all the bugs).
 
+2008-07-07  David Lutterkort  <dlutter@redhat.com>
+
        Check for NULL values in the put direction of store
        This is now flagged as an error instead of causing a segfault.
 
 
        Reported by Jason Dobies
 
+2008-06-13  David Lutterkort  <dlutter@redhat.com>
+
        Produce more helpful errors
        The previous check whether we could proces the entire input was too crude
        and produced the unhelpful error message "Get could not process entire
        Process /etc/sysconfig/selinux
        Patch by Alan Pevec
 
+2008-06-12  David Lutterkort  <dlutter@redhat.com>
+
        Fix segfault when aug_init/close are called multiple times
        The way we cached the regexp '[0-9]+/' was totally botched. We now allocate
        the pattern statically in memory and pin it to protect it from being freed,
 
        Initialize out parameters
 
+2008-06-06  David Lutterkort  <dlutter@redhat.com>
+
        Change struct fields of type (const char *) to (char *)
        There were many places where struct fields were declared (const char *) but
        then used as (char *) - mostly to free them. Remove the 'const' from those
        been declared yet and it goes and does that. gcc then complains about the
        duplicate declaration.
 
+2008-06-03  David Lutterkort  <dlutter@redhat.com>
+
        Infrastructure and import of gnulib modules
        We do not keep the gnulib sources in our own repo. Instead, autogen.sh now
        calls out to bootstrap to pull in needed files from gnulib.
 
        Add dependency on ref.h
 
+2008-05-16  David Lutterkort  <dlutter@redhat.com>
+
        Get rid of compiled regexps earlier
        After we're done with a transform, release the memory used by compiled
        regexps; storage for compiled regexps accounts for the lion's share of
        broke collect into separate subfunctions so we can see better when one of
        them becomes a bottleneck.
 
+2008-05-13  David Lutterkort  <dlutter@redhat.com>
+
        Stricter skeleton instance check for del and store
        Besides having the right tag, del and store match a skeleton only if the
        text for that skeleton also matches their regexp.
 
        Use the new '-' operator for key_re
 
+2008-05-09  David Lutterkort  <dlutter@redhat.com>
+
        Add subtraction of regular expressions to the language
        It is now possible to say something like
 
 
        The '-' operator is only defined between regexps.
 
+2008-05-09  David Lutterkort  <dlutter@redhat.com>
+
        Add REGEXP_MINUS; move REGEXP_TO_FA to regexp.c
 
        Refactor typechecking for union/concat
        Also clean up the definition of the bitset type and make the bitset_*
        functions const correct
 
+2008-05-09  David Lutterkort  <dlutter@redhat.com>
+
        Add fa_as_regexp that converts an automaton back to a regexp
        During conversion from FA to regexp, our FA mutates into a 'generalized
        transition graph' where transitions aren't labelled with character
 
        Safer memory allocation from libvirt
 
+2008-05-08  David Lutterkort  <dlutter@redhat.com>
+
        Fix a rather embarrassing #ifdef problem
        When __GNUC__ was not defined, a big chunk of internal.h was suppressed
        that is not compiler dependent.
 
        Also, add ATTRIBUTE_PURE macro.
 
+2008-05-08  David Lutterkort  <dlutter@redhat.com>
+
        Switch to using unsigned char internally
        Since we use chars as indices into arrays in some cases, it is simpler to
        treat characters as unsigned. This also addresses passing possibly signed
        There were also cases where we iterated over chars using a char, which was
        prone to silent overflow.
 
+2008-05-08  David Lutterkort  <dlutter@redhat.com>
+
        Fix mistaken assignments in asserts
        Reported by Jeff Johnson
 
 
        Patch by Jim Meyering
 
+2008-05-06  David Lutterkort  <dlutter@redhat.com>
+
        Small fixes to the specfile
        Suggested by Michael Schwendt
 
 
        Be more consistent in how NULL labels are printed
 
+2008-05-05  David Lutterkort  <dlutter@redhat.com>
+
        Suppress assert of hash_verify
        Doing the assert(hash_verify(hash)) at various places in hash.c is very
        expensive and slows things down considerably when assertions are turned
        Rather than turning assertions off globally, only do the hash_verify
        asserts when they are explicitly requested by defining HASH_DEBUG_VERIFY
 
+2008-05-05  David Lutterkort  <dlutter@redhat.com>
+
        Do not minimize freshly created regexps
        The minimization imposes a serious performance penalty, and is generally
        not needed.
        This also exposes a bug in fa_overlap; for acceptToAccept to work properly,
        it needs to be passed a deterministic automaton.
 
+2008-05-05  David Lutterkort  <dlutter@redhat.com>
+
        Fix containment check
        Checking for FA2\FA1 being empty was plain silly; this check is a little
        better, but still not the correct disjointness check.
        variables are actually going to be looked at (together with some
        restrictions on possible values)
 
+2008-04-30  David Lutterkort  <dlutter@redhat.com>
+
        Test files for various /etc/sysconfig files
        The next commit will add a lens for handling shell var style files in
        /etc/sysconfig. These are simply test/sample files. No functionality.
        the edge going from a parent to its child, but root has no parent, and
        therefore "/" does not really make sense.
 
+2008-04-25  David Lutterkort  <dlutter@redhat.com>
+
        Split multiple baseurl's in a yum file into multiple baseurl nodes
        With this, the schema for yum config files may now contain nodes like
          { "section"
 
        This change fixes that and adds a test to demonstrate the problem.
 
+2008-04-24  David Lutterkort  <dlutter@redhat.com>
+
        Fix ref counting error in lns_make_plus
        We burnt the passed-in ownership of L when constructing STAR; also, since
        we unref STAR at the end, we need to take ownership of STAR->LENS when
        Processing of Apt's sources files
        Contributed by Dean Wilson
 
+2008-04-24  David Lutterkort  <dlutter@redhat.com>
+
        Make sure install preserves timestamps
        Avoids getting into trouble with the .aug files in augeas-libs on multilib
        when installing more than one arch.
 
        See http://fedoraproject.org/wiki/PackagingDrafts/MultilibTricks
 
+2008-04-24  David Lutterkort  <dlutter@redhat.com>
+
        Remove trailing whitespace from the end of lines
        No functional change, only formatting.
 
 
        Add todo file for low-level tasks that don't make sense on the website
 
+2008-04-23  David Lutterkort  <dlutter@redhat.com>
+
        Split libraries into a -libs package
        This also includes the files in /usr/share/augeas, since they are read by
        the library and control how configuration files are processed.
 
        Patch provided by Harald Hoyer
 
+2008-04-23  David Lutterkort  <dlutter@redhat.com>
+
        Include the augtool manpage as doc in the RPM
 
+2008-04-23  David Lutterkort  <dlutter@redhat.com>
+
        Don't die on NULL entries in args
        There is no guarantee that parseline will fill all of args with strings,
        empty or otherwise; chk_args needs to be prepared that any entry in args
        Also, parseline initializes all args as NULL now to guard against garbage
        pointers accumulating from previous uses.
 
+2008-04-23  David Lutterkort  <dlutter@redhat.com>
+
        Don't complain about missing optional args
        For example, both 'print' and 'print PATH' are legal. Make sure we accept
        either.
 
        Clean up the error path in load_file; free the loaded text in transform_load
 
+2008-04-22  David Lutterkort  <dlutter@redhat.com>
+
        Use fread_file_lim to read entire files
        The function is taken verbatim from libvirt's util.c, and due to show up in
        gnulib soon.
 
        Also, make read_file return a char * instead of the silly const char *.
 
+2008-04-22  David Lutterkort  <dlutter@redhat.com>
+
        Check the return value from hash_create
 
        More const-correctness fixes
 
        Propagate failure of transform_save up
 
+2008-04-21  David Lutterkort  <dlutter@redhat.com>
+
        Sync compiler warnings with latest from libvirt
        This should avoid build failures seen on Debian, caused by
        -fstack-protector
 
        Also fix build failure caused by addition of -Wformat-security
 
+2008-04-21  David Lutterkort  <dlutter@redhat.com>
+
        Mention people who sent patches
 
        Parse network configs in /etc/sysconfig/ifcfg-*
        Check for failures during printing and return an indication whether printing
        succeeded or not.
 
+2008-04-21  David Lutterkort  <dlutter@redhat.com>
+
        Don't hide pointer in typedef; const correctness
        The type for the Augeas handle is now called 'augeas' insteda of
        'augeas_t', and is a struct, not a pointer to a struct.
 
        Patch provided by Jim Meyering
 
+2008-04-21  David Lutterkort  <dlutter@redhat.com>
+
        Change names of macros used to guard against double-inclusion
        Change the names from __NAME_H to NAME_H_ since __* macros are reserved.
 
        Suggested by Jim Meyering.
 
+2008-04-21  David Lutterkort  <dlutter@redhat.com>
+
        Add "2008" to the copyright in the headers
 
 2008-04-19  David Lutterkort  <dlutter@redhat.com>
 
        Process grub.conf
 
+2008-04-14  David Lutterkort  <dlutter@redhat.com>
+
        Don't delete too many siblings
        When a path specified a node that had siblings with the same name, tree_rm
        was deleting that node and all the siblings after it (because the name
 
        Now, first generate a list of nodes to delete before removing anything.
 
+2008-04-14  David Lutterkort  <dlutter@redhat.com>
+
        Fix put test - it was checking for hte wrong result
 
        Running a failing test fails loading the whole module
 
        Syntax and semantics follow XPath.
 
+2008-04-11  David Lutterkort  <dlutter@redhat.com>
+
        Run all tests - don't abort after the first failure
 
 2008-04-10  David Lutterkort  <dlutter@redhat.com>
        valid. Ideally, this check would be in the typechecker, but requires
        dependant types, too much of a complication right now.
 
+2008-04-09  David Lutterkort  <dlutter@redhat.com>
+
        Clean up some confusion around the semantics of store
        Store does not create a tree; instead it puts a value in place where the
        enclosing subtree will find it.
        happen in the typechecker, but it would require that we parametrize the
        lens type, considerably complicating matters.
 
+2008-04-09  David Lutterkort  <dlutter@redhat.com>
+
        When get encounters an error during a test, include hte tree in the exn
        lns_get now returns a tree even if the full input was not consumed. To
        check whether get succeeded, the ERR parameter needs to be checked.
        Do not do the expensive lens type checks if AUG_TYPE_CHECK is not set. Run
        augtool with -c in tests to ensure tests do type checks.
 
+2008-04-09  David Lutterkort  <dlutter@redhat.com>
+
        Update augtool round-trip tests and add them to 'make check'
        Update the tests to the new layout of the tree.
 
        test) and sets the exit status properly so that 'make check' will fail if
        one of the augtool tests fails
 
+2008-04-09  David Lutterkort  <dlutter@redhat.com>
+
        Fix underallocation
 
        Only attempt to save if there are dirty files
 
        /etc/aliases processing in the new syntax with tests
 
+2008-04-04  David Lutterkort  <dlutter@redhat.com>
+
        Allow rm from toplevel of tree
        The only issue with this is that the dirty flag can not be set properly
        when deleting from the toplevel of the tree since the flag has to be set on
        nodes are fixed, like /files and /augeas, and we don't really have an issue
        there.
 
+2008-04-04  David Lutterkort  <dlutter@redhat.com>
+
        Small tweaks
 
        Produce exn when tree_rm/tree_set fail
        The basename of the file must be the name of the module, lowercased and
        with ".aug" appended
 
+2008-04-03  David Lutterkort  <dlutter@redhat.com>
+
        Add explicit loadpath
        augtool and augparse now take an explicit loadpath with the -I option,
        which can be repeated multiple times.
 
        aug_init takes a loadpath as a new argument
 
+2008-04-03  David Lutterkort  <dlutter@redhat.com>
+
        Load needed modules
        When the module for a qualified identifier Mod.name is not loaded yet,
        automatically load it by looking for a file mod.aug on the module load
 
        Pass lns_error to parse; free dicts and skels
 
+2008-04-02  David Lutterkort  <dlutter@redhat.com>
+
        Report errors from get as exceptions
        Adds a value kind 'EXN'. When the interpreter gets such a value, it bails
        out immediately.
        lns_get now reports parse errors in an lns_error struct, which is turned
        into an exception in the interpreter.
 
+2008-04-02  David Lutterkort  <dlutter@redhat.com>
+
        Added tag ml-syntax-start for changeset fcd6c04a1eed
 
        A subtree without a key matches "/"
        Store the map of (s1, s2) -> s for intersection in nested state sets
        instead of a linked list.
 
+2008-03-12  David Lutterkort  <dlutter@redhat.com>
+
        Faster data structures for sets of states and a list of sets of states
        Store the list of sets of states for determinize in a hash table. Since I
        don't feel like implementing my own, pull in glib and use GHashTable.
        reachable states, use one bit each in the state to mark them for that
        purpose.
 
+2008-03-11  David Lutterkort  <dlutter@redhat.com>
+
        Add typechecking of lenses
        Concatenation and iteration of lenses is now checked for ambiguity. Union
        is checked for disjointness, but that is only flagged as a warning, since
        to split that string into u.pv and up.v. Algorithm from Anders Moeller from
        the dk.brics.grammar package.
 
+2008-03-06  David Lutterkort  <dlutter@redhat.com>
+
        Fix example generation, it was completely broken
        The previous algorithm was way too simplistic, and failed on more
        complicated languages.
        preferences, so that for example, alnum characters are preferred over
        printable ones, and those over nonprintable ones.
 
+2008-03-06  David Lutterkort  <dlutter@redhat.com>
+
        Fix some cornercases in fa_example
 
 2008-03-05  David Lutterkort  <dlutter@redhat.com>
 
        Released version 0.0.6
 
+2008-03-05  David Lutterkort  <dlutter@redhat.com>
+
        Allow influencing the behavior of save
        By passing one of the flags AUG_SAVE_BACKUP or AUG_SAVE_NEWFILE to
        aug_init, it is possible to influence the behavior of aug_save to either
        Also added switches to augtool to set this from the command line, and to
        set the filesystem root.
 
+2008-03-05  David Lutterkort  <dlutter@redhat.com>
+
        Added tag release-0.0.5 for changeset 0efe2a620e39
 
        Mark print_re as unused
 
        Add a test that performs Anders Moeller's ambiguity algorithm manually
 
+2008-03-04  David Lutterkort  <dlutter@redhat.com>
+
        Two bug fixes
        (1) fa_make_char_set would never create transitions with min == max
        (2) fa_intersect got things wrong when t2 had an interval that overlapped
 
        Also added tests to check these two problems.
 
+2008-03-04  David Lutterkort  <dlutter@redhat.com>
+
        Fix handling of negated charsets
        Negated charsets where handled entirely wrong. A character set is now
        represented as a map from char -> {0, 1}. That map is rather big (one byte
 
        Compute the complement, set difference and overlap of two languages
 
+2008-03-04  David Lutterkort  <dlutter@redhat.com>
+
        Fix a bug in how '.' is being handled
        The '.' was treated the same as [\n] instead of [^\n] by mistake.
 
        Also fixes a small bug in fa_contains.
 
+2008-03-04  David Lutterkort  <dlutter@redhat.com>
+
        Add deciding unambiguously iterable based on ua concatenable
 
 2008-03-03  David Lutterkort  <dlutter@redhat.com>
 
        Add tests for language subsets and equality
 
+2008-02-29  David Lutterkort  <dlutter@redhat.com>
+
        The beginnings of a finite automata library
        The code is heavily based on the Java package dk.brics.automaton by Anders
        Moeller (http://www.brics.dk/automaton/)
        Eventually, this should becomea standalone library, seeing how there does
        not seem to be any open-source, maintained finite automata library.
 
+2008-02-29  David Lutterkort  <dlutter@redhat.com>
+
        Some unit testing help
        This is an adapted version of CuTest
        (http://sourceforge.net/projects/cutest/) written by Asim Jalis
 
        Print test results a tad prettier
 
+2008-02-20  David Lutterkort  <dlutter@redhat.com>
+
        Use GNU regex instead of PCRE
        Use the GNU regex functions from glibc instead of PCRE, as glibc uses a DFA
        implementation that does not suffer the limitations of PCRE's backtracking
        essentially extended POSIX regular expressions, except that '.' does not
        match newlines.
 
+2008-02-20  David Lutterkort  <dlutter@redhat.com>
+
        Clean up regexps for POSIX
        Various small fixes to regexps to make them work properly as POSIX regexps.
 
        Added tag remove-any-first-follow for changeset 0d22160e9494
 
+2008-02-20  David Lutterkort  <dlutter@redhat.com>
+
        Remove any matches ... and ..? from the language. Remove first/follow sets
        They currently require lookahead assertions from the underlying regexp
        engine.
        Since any matches were the only reason to compute first/follow sets, remove
        those, too.
 
+2008-02-20  David Lutterkort  <dlutter@redhat.com>
+
        Remove the use of the any operators '...' and '..?'
        These operators inherently require lookahead assertions, but we need to
        switch to a regexp engine that does not support them.
        Unfortunately, we have to keep first/follow computations to construct the
        fairly tricky regexps that are used for ANY patterns.
 
+2008-02-18  David Lutterkort  <dlutter@redhat.com>
+
        Remove unused token T_FIELD
 
        Rename match.xaction to match.action
 
        Remove leading whitespace inside Match directives
 
+2008-02-18  David Lutterkort  <dlutter@redhat.com>
+
        Fix nested splits
        For a lens like a . (b . c)*, tree_split used to return a split that looked
        like [a; b; c; b; c] That is wrong: when we split on the outer '.', we need
        subsplits are mostly computed for their sideeffect, particularly for the
        fact that they change state->tree.
 
+2008-02-18  David Lutterkort  <dlutter@redhat.com>
+
        Properly print split nodes
 
        Lenses for sshd_config
        This is interesting because of the treatment of AcceptEnv and similar
        constructs
 
+2008-02-18  David Lutterkort  <dlutter@redhat.com>
+
        For split nodes, append entries at the last occurence
        It is possible that one logical node is split across several physical
        nodes to accomodate settings that are spread across several lines like
 
        Fixed, nicely working tests
 
+2008-02-14  David Lutterkort  <dlutter@redhat.com>
+
        Readline completion
        Complete command names and tree paths.
 
        trailing spaces or '/'. Cleaning should probably be done by the public
        API.
 
+2008-02-14  David Lutterkort  <dlutter@redhat.com>
+
        Major rework
        Code still unbelievably buggy and segfaults in lots of places, but it is
        fairly clean and works for choice examples.
        user cleanly indicate what a comment goes with (e.g., an entire section,
        the next key/value pair etc.)
 
+2008-01-29  David Lutterkort  <dlutter@redhat.com>
+
        Initialize fields used as path components
        When a field is used in a path component, initialize its value from the
        path. Since it is not possible to change an existing path, this operation
        where the leaf's value is used. That is not necessarily true; at least,
        it's not being checked from the grammar.
 
+2008-01-29  David Lutterkort  <dlutter@redhat.com>
+
        Test that reordering of subtrees works
 
        Set the root of the tree from include
 
+2008-01-29  David Lutterkort  <dlutter@redhat.com>
+
        Respect ordering of nodes in the config tree.
        Previously, reordering of branches in the config tree did not lead to a
        corresponding reordering of elements in the file. Branches in the AST are
        change the path for the current (iterator) node, only for the child nodes.
        That is terribly ugly.
 
+2008-01-29  David Lutterkort  <dlutter@redhat.com>
+
        Fix bug in creating sequence subtrees
 
+2008-01-29  David Lutterkort  <dlutter@redhat.com>
+
        Distribute enters so we have one per match
        Simultaneous traversal of the AST and the config tree is much simpler if
        any match will only go at most one level deeper. That guarantees that
        ensures that the children of an AST node differ in exactly one path
        component.
 
+2008-01-29  David Lutterkort  <dlutter@redhat.com>
+
        Push stores to the matches they store in the tree
        In an assignment, the value being stored can only be a field
        reference. Push the corresponding action for the store to that field. This
              if they get in the way of a store, but should probably be checked for
              the whole grammar
 
+2008-01-29  David Lutterkort  <dlutter@redhat.com>
+
        Produce dot files for the grammar
 
+2008-01-29  David Lutterkort  <dlutter@redhat.com>
+
        Various changes to the tests to make them (almost) work
        (1) Adjust to the fact that the root dir is now a variable
        (2) Mark tests as failing if augtool exits with an error exit status
 
        Some of the tests are still failing.
 
+2008-01-29  David Lutterkort  <dlutter@redhat.com>
+
        aug_ls: Fix bad parent comparison
        Before /foo/1000 was listed as a child of /foo/1
 
        names and simplifies the 'put' direction of the transformation
        considerably.
 
+2008-01-21  David Lutterkort  <dlutter@redhat.com>
+
        Some config settings - most of them need to be exposed through configure.ac
 
 2008-01-18  David Lutterkort  <dlutter@redhat.com>
 
        Don't segfault in ast_dot on NULL ast
 
+2008-01-18  David Lutterkort  <dlutter@redhat.com>
+
        Only save files with actual changes
        Split emitting into two parts: updating the AST from the config tree and
        actually writing the AST to file. do_insertion and do_deletion now report
        As a byproduct, parts of the AST that are no longer needed are actually
        freed.
 
+2008-01-18  David Lutterkort  <dlutter@redhat.com>
+
        Handle null values/tokens when storing
 
        Detect association of values with impossible paths
        version have been lost. Therefore, builds between 57:9e439a136787 and this
        revision will fail.
 
+2008-01-17  David Lutterkort  <dlutter@redhat.com>
+
        Emit a the current tree into a file
        Based on the AST, generate the file that lead to that AST. Changes to the
        config tree are mirrored by corresponding changes in the AST before it is
        This is a first version that works for some restricted set of grammars, but
        needs a lot more testing.
 
+2008-01-17  David Lutterkort  <dlutter@redhat.com>
+
        Compute tree handles for each match
        The handle of a match is a set of regular expressions that indicate which
        subtrees are generated by that match. Handles are computed based on the
        The handle of an action is a regular expression matching the path generated
        by that action.
 
+2008-01-17  David Lutterkort  <dlutter@redhat.com>
+
        Build an explicit AST
        Instead of representing the parsed file by a simple list of tokens, build a
        fullblown AST for that file. The AST is actually not very abstract, and is
        Remove aug_token and any mention of it - that has been replaced by struct
        ast.
 
+2008-01-17  David Lutterkort  <dlutter@redhat.com>
+
        Represent quantifiers in their own match nodes
        Instead of using a field in struct match for quantifiers '*', '+', '?',
        represent quantified expressions by their own struct match, with a matches
        This leads to a cleaner parser and makes constructing an explicit AST
        simpler.
 
+2008-01-17  David Lutterkort  <dlutter@redhat.com>
+
        Prefer comments over kv
 
        Print first sets for every match
        Still missing is saving of the tree back to file, and in particular adding
        new entries in the tree to such files.
 
+2008-01-03  David Lutterkort  <dlutter@redhat.com>
+
        Move hosts and inittab under /etc
 
        Always set the passed-in grammars and maps to NULL
        Produce tokens during parsing.
        Also, nicer printing of the tokens read.
 
+2007-12-20  David Lutterkort  <dlutter@redhat.com>
+
        Stricter checking for ambiguous rules
        Check that all items in alternatives have non-overlapping first sets. Two
        sets are overlapping if they both contain an entry pointing to the same
        expresions (e.g. /[ab]/ in one and /[ba]/ in the other) but that seems very
        hard to determine.
 
+2007-12-20  David Lutterkort  <dlutter@redhat.com>
+
        Print first/follow sets prettier, print control characters escaped with ~
        Literals from first/follow sets are now reduced back to the abbrev they
        belong to if that exists.
 
        aug_rec_save: Check input parameters
 
+2007-11-30  David Lutterkort  <dlutter@redhat.com>
+
        Major overhaul of record parsing
        Use PCRE to split records with regexps, and abstract a major chunk of
        functionality out so it is independent of parsing pam config files
        of nodes are translated into changing fields and insert/delete of fields
        and records/lines)
 
+2007-11-30  David Lutterkort  <dlutter@redhat.com>
+
        Root filesys that tests pass against
 
        Basic tests for record parsing
 
        Autotools support for building
 
+2007-11-26  David Lutterkort  <dlutter@redhat.com>
+
        Very simplistic key store with a public API in augeas.h
        The implementation is braindead and slow, but good enough to experiment
        with the actual difficulty for augeas: parsing and editing different config
 
        augtool gives a basic mean to inspect the keystore from the command line
 
+2007-11-26  David Lutterkort  <dlutter@redhat.com>
+
        Ignore some files
diff --git a/HACKING b/HACKING
index 419d681..7231a06 100644 (file)
--- a/HACKING
+++ b/HACKING
@@ -5,7 +5,7 @@ Check out the sources
 
 The sources are in a git repo (which you presumably found already)
 
-  git clone git://git.fedorahosted.org/git/augeas.git
+  git clone git://github.com/hercules-team/augeas
 
 Building from git
 -----------------
@@ -16,6 +16,7 @@ Building from git
     * Bison
     * Flex
     * readline-devel
+    * libxml2-devel
     * libselinux-devel (optional)
 
   Augeas uses gnulib, and you need a checkout of gnulib. The build scripts
@@ -47,8 +48,9 @@ of the ones that might be installed on your system)
 The script can be used for the following; OPTS are options that are passed
 to augtool verbatim
 
-  ./src/try OPTS     - run the commands from /tmp/augcmds.txt
+  ./src/try OPTS     - run the commands from build/augcmds.txt
   ./src/try cli OPTS - start an interactive session with augtool
-  ./src/try gdb      - start gdb and set it up for debugging augtool
-  ./src/try valgrind - run the commands from /tmp/augcmds.txt through augtool
+  ./src/try gdb      - start gdb and set it up from build/gdbcmds.txt for
+                       debugging augtool with commands in build/augcmds.txt
+  ./src/try valgrind - run the commands from build/augcmds.txt through augtool
                        under valgrind to check for memory leaks
index 14aa121..d88e6dd 100644 (file)
@@ -8,17 +8,17 @@ lenstestdir=$(datadir)/augeas/lenses/dist/tests
 dist_lens_DATA=$(wildcard lenses/*.aug)
 dist_lenstest_DATA=$(wildcard lenses/tests/*.aug)
 
-EXTRA_DIST=augeas.spec build/aux/move-if-change Makefile.am HACKING
+EXTRA_DIST=augeas.spec build/ac-aux/move-if-change Makefile.am HACKING
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = augeas.pc
 
 distclean-local:
-       -find $(top_builddir)/build/* -maxdepth 0 -not -name aux | xargs rm -rf
+       -find $(top_builddir)/build/* -maxdepth 0 -not -name ac-aux | xargs rm -rf
 
 ChangeLog:
        if test -d $(top_srcdir)/.git; then                             \
-         $(top_srcdir)/build/aux/gitlog-to-changelog > $@;             \
+         $(top_srcdir)/build/ac-aux/gitlog-to-changelog > $@;             \
        fi
 
 dist: ChangeLog
index d08d7e2..4d3212e 100644 (file)
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in 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.
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -34,20 +78,29 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = .
-DIST_COMMON = README $(am__configure_deps) $(dist_lens_DATA) \
-       $(dist_lenstest_DATA) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in $(srcdir)/augeas.pc.in \
-       $(srcdir)/augeas.spec.in $(srcdir)/config.h.in \
-       $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
-       build/aux/config.guess build/aux/config.rpath \
-       build/aux/config.sub build/aux/depcomp build/aux/install-sh \
-       build/aux/ltmain.sh build/aux/missing build/aux/ylwrap
+DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
+       $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+       $(top_srcdir)/configure $(am__configure_deps) \
+       $(srcdir)/config.h.in $(srcdir)/augeas.pc.in \
+       $(srcdir)/augeas.spec.in $(dist_lens_DATA) \
+       $(dist_lenstest_DATA) COPYING build/ac-aux/compile \
+       build/ac-aux/config.guess build/ac-aux/config.rpath \
+       build/ac-aux/config.sub build/ac-aux/depcomp \
+       build/ac-aux/install-sh build/ac-aux/missing \
+       build/ac-aux/ylwrap build/ac-aux/ltmain.sh \
+       $(top_srcdir)/build/ac-aux/config.guess \
+       $(top_srcdir)/build/ac-aux/config.rpath \
+       $(top_srcdir)/build/ac-aux/config.sub \
+       $(top_srcdir)/build/ac-aux/install-sh \
+       $(top_srcdir)/build/ac-aux/ltmain.sh \
+       $(top_srcdir)/build/ac-aux/missing
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/alloca.m4 \
        $(top_srcdir)/gnulib/m4/argz.m4 \
        $(top_srcdir)/gnulib/m4/btowc.m4 \
        $(top_srcdir)/gnulib/m4/canonicalize.m4 \
+       $(top_srcdir)/gnulib/m4/close.m4 \
        $(top_srcdir)/gnulib/m4/codeset.m4 \
        $(top_srcdir)/gnulib/m4/configmake.m4 \
        $(top_srcdir)/gnulib/m4/ctype.m4 \
@@ -56,24 +109,33 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/eealloc.m4 \
        $(top_srcdir)/gnulib/m4/environ.m4 \
        $(top_srcdir)/gnulib/m4/errno_h.m4 \
+       $(top_srcdir)/gnulib/m4/exponentd.m4 \
        $(top_srcdir)/gnulib/m4/extensions.m4 \
        $(top_srcdir)/gnulib/m4/fcntl-o.m4 \
        $(top_srcdir)/gnulib/m4/fcntl_h.m4 \
+       $(top_srcdir)/gnulib/m4/fdopen.m4 \
        $(top_srcdir)/gnulib/m4/float_h.m4 \
        $(top_srcdir)/gnulib/m4/fnmatch.m4 \
+       $(top_srcdir)/gnulib/m4/fpieee.m4 \
+       $(top_srcdir)/gnulib/m4/fstat.m4 \
+       $(top_srcdir)/gnulib/m4/getcwd.m4 \
        $(top_srcdir)/gnulib/m4/getdelim.m4 \
        $(top_srcdir)/gnulib/m4/getline.m4 \
        $(top_srcdir)/gnulib/m4/getopt.m4 \
        $(top_srcdir)/gnulib/m4/getpagesize.m4 \
+       $(top_srcdir)/gnulib/m4/gettimeofday.m4 \
        $(top_srcdir)/gnulib/m4/glibc21.m4 \
        $(top_srcdir)/gnulib/m4/gnulib-common.m4 \
        $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \
        $(top_srcdir)/gnulib/m4/include_next.m4 \
        $(top_srcdir)/gnulib/m4/intlmacosx.m4 \
        $(top_srcdir)/gnulib/m4/intmax_t.m4 \
+       $(top_srcdir)/gnulib/m4/inttypes-pri.m4 \
+       $(top_srcdir)/gnulib/m4/inttypes.m4 \
        $(top_srcdir)/gnulib/m4/inttypes_h.m4 \
        $(top_srcdir)/gnulib/m4/isblank.m4 \
        $(top_srcdir)/gnulib/m4/langinfo_h.m4 \
+       $(top_srcdir)/gnulib/m4/largefile.m4 \
        $(top_srcdir)/gnulib/m4/lcmessage.m4 \
        $(top_srcdir)/gnulib/m4/lib-ld.m4 \
        $(top_srcdir)/gnulib/m4/lib-link.m4 \
@@ -85,6 +147,7 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/locale-tr.m4 \
        $(top_srcdir)/gnulib/m4/locale-zh.m4 \
        $(top_srcdir)/gnulib/m4/locale_h.m4 \
+       $(top_srcdir)/gnulib/m4/localeconv.m4 \
        $(top_srcdir)/gnulib/m4/localename.m4 \
        $(top_srcdir)/gnulib/m4/lock.m4 \
        $(top_srcdir)/gnulib/m4/longlong.m4 \
@@ -102,15 +165,21 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/mbtowc.m4 \
        $(top_srcdir)/gnulib/m4/memchr.m4 \
        $(top_srcdir)/gnulib/m4/mempcpy.m4 \
+       $(top_srcdir)/gnulib/m4/mkstemp.m4 \
        $(top_srcdir)/gnulib/m4/mmap-anon.m4 \
        $(top_srcdir)/gnulib/m4/mode_t.m4 \
+       $(top_srcdir)/gnulib/m4/msvc-inval.m4 \
+       $(top_srcdir)/gnulib/m4/msvc-nothrow.m4 \
        $(top_srcdir)/gnulib/m4/multiarch.m4 \
        $(top_srcdir)/gnulib/m4/nl_langinfo.m4 \
+       $(top_srcdir)/gnulib/m4/nocrash.m4 \
+       $(top_srcdir)/gnulib/m4/off_t.m4 \
        $(top_srcdir)/gnulib/m4/onceonly.m4 \
        $(top_srcdir)/gnulib/m4/open.m4 \
        $(top_srcdir)/gnulib/m4/pathmax.m4 \
        $(top_srcdir)/gnulib/m4/printf.m4 \
        $(top_srcdir)/gnulib/m4/putenv.m4 \
+       $(top_srcdir)/gnulib/m4/rawmemchr.m4 \
        $(top_srcdir)/gnulib/m4/readlink.m4 \
        $(top_srcdir)/gnulib/m4/realloc.m4 \
        $(top_srcdir)/gnulib/m4/regex.m4 \
@@ -130,13 +199,18 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/stdlib_h.m4 \
        $(top_srcdir)/gnulib/m4/stpcpy.m4 \
        $(top_srcdir)/gnulib/m4/stpncpy.m4 \
+       $(top_srcdir)/gnulib/m4/strchrnul.m4 \
        $(top_srcdir)/gnulib/m4/string_h.m4 \
        $(top_srcdir)/gnulib/m4/strndup.m4 \
        $(top_srcdir)/gnulib/m4/strnlen.m4 \
        $(top_srcdir)/gnulib/m4/strstr.m4 \
        $(top_srcdir)/gnulib/m4/symlink.m4 \
+       $(top_srcdir)/gnulib/m4/sys_socket_h.m4 \
        $(top_srcdir)/gnulib/m4/sys_stat_h.m4 \
+       $(top_srcdir)/gnulib/m4/sys_time_h.m4 \
+       $(top_srcdir)/gnulib/m4/sys_types_h.m4 \
        $(top_srcdir)/gnulib/m4/sys_wait_h.m4 \
+       $(top_srcdir)/gnulib/m4/tempname.m4 \
        $(top_srcdir)/gnulib/m4/thread.m4 \
        $(top_srcdir)/gnulib/m4/threadlib.m4 \
        $(top_srcdir)/gnulib/m4/time_h.m4 \
@@ -162,21 +236,33 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = config.h
 CONFIG_CLEAN_FILES = augeas.pc augeas.spec
 CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_$(V))
-am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
-am__v_GEN_0 = @echo "  GEN   " $@;
-AM_V_at = $(am__v_at_$(V))
-am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
 am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-       html-recursive info-recursive install-data-recursive \
-       install-dvi-recursive install-exec-recursive \
-       install-html-recursive install-info-recursive \
-       install-pdf-recursive install-ps-recursive install-recursive \
-       installcheck-recursive installdirs-recursive pdf-recursive \
-       ps-recursive uninstall-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+       ctags-recursive dvi-recursive html-recursive info-recursive \
+       install-data-recursive install-dvi-recursive \
+       install-exec-recursive install-html-recursive \
+       install-info-recursive install-pdf-recursive \
+       install-ps-recursive install-recursive installcheck-recursive \
+       installdirs-recursive pdf-recursive ps-recursive \
+       tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -198,24 +284,55 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(lensdir)" "$(DESTDIR)$(lenstestdir)" \
        "$(DESTDIR)$(pkgconfigdir)"
 DATA = $(dist_lens_DATA) $(dist_lenstest_DATA) $(pkgconfig_DATA)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
   distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-       $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-       distdir dist dist-all distcheck
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+       cscope distdir dist dist-all distcheck
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+       $(LISP)config.h.in
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+CSCOPE = cscope
 DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
 am__remove_distdir = \
-  { test ! -d "$(distdir)" \
-    || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
-         && rm -fr "$(distdir)"; }; }
+  if test -d "$(distdir)"; then \
+    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+      && rm -rf "$(distdir)" \
+      || { sleep 5 && rm -rf "$(distdir)"; }; \
+  else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
 am__relativize = \
   dir0=`pwd`; \
   sed_first='s,^\([^/]*\)/.*$$,\1,'; \
@@ -243,7 +360,10 @@ am__relativize = \
   reldir="$$dir2"
 DIST_ARCHIVES = $(distdir).tar.gz
 GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
 distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+  | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
 distcleancheck_listfiles = find . -type f -print
 pkglibexecdir = @pkglibexecdir@
 ACLOCAL = @ACLOCAL@
@@ -253,6 +373,7 @@ AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 AR = @AR@
+ARFLAGS = @ARFLAGS@
 ARGZ_H = @ARGZ_H@
 AUGEAS_CFLAGS = @AUGEAS_CFLAGS@
 AUTOCONF = @AUTOCONF@
@@ -296,9 +417,11 @@ GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
 GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
+GNULIB_CHDIR = @GNULIB_CHDIR@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
+GNULIB_DUP = @GNULIB_DUP@
 GNULIB_DUP2 = @GNULIB_DUP2@
 GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
@@ -310,16 +433,25 @@ 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_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FFSL = @GNULIB_FFSL@
+GNULIB_FFSLL = @GNULIB_FFSLL@
+GNULIB_FGETC = @GNULIB_FGETC@
+GNULIB_FGETS = @GNULIB_FGETS@
 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_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@
@@ -327,6 +459,8 @@ 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@
@@ -339,8 +473,14 @@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
 GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
+GNULIB_IMAXABS = @GNULIB_IMAXABS@
+GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
+GNULIB_ISATTY = @GNULIB_ISATTY@
 GNULIB_ISBLANK = @GNULIB_ISBLANK@
 GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
 GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
@@ -348,6 +488,7 @@ GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
 GNULIB_LINKAT = @GNULIB_LINKAT@
+GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
@@ -388,25 +529,31 @@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
 GNULIB_MKTIME = @GNULIB_MKTIME@
 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_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_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
 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_RANDOM = @GNULIB_RANDOM@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
 GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
+GNULIB_READ = @GNULIB_READ@
 GNULIB_READLINK = @GNULIB_READLINK@
 GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
@@ -416,12 +563,15 @@ GNULIB_RENAME = @GNULIB_RENAME@
 GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
 GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
+GNULIB_SCANF = @GNULIB_SCANF@
 GNULIB_SETENV = @GNULIB_SETENV@
+GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
 GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
 GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
 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@
@@ -439,9 +589,11 @@ 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@
@@ -451,7 +603,7 @@ GNULIB_TIME_R = @GNULIB_TIME_R@
 GNULIB_TMPFILE = @GNULIB_TMPFILE@
 GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
 GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
-GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
+GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
 GNULIB_UNLINK = @GNULIB_UNLINK@
 GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
@@ -463,8 +615,10 @@ 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@
@@ -513,6 +667,7 @@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
 HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
 HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
 HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
 HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
@@ -523,18 +678,23 @@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 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_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
 HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
 HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
@@ -550,7 +710,10 @@ HAVE_FCHDIR = @HAVE_FCHDIR@
 HAVE_FCHMODAT = @HAVE_FCHMODAT@
 HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
 HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
 HAVE_FSEEKO = @HAVE_FSEEKO@
 HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
@@ -564,7 +727,9 @@ HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
 HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
 HAVE_ISBLANK = @HAVE_ISBLANK@
 HAVE_ISWBLANK = @HAVE_ISWBLANK@
@@ -598,15 +763,21 @@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
 HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
 HAVE_MKSTEMP = @HAVE_MKSTEMP@
 HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
 HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OPENAT = @HAVE_OPENAT@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
 HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
 HAVE_PREAD = @HAVE_PREAD@
 HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
 HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_RANDOM = @HAVE_RANDOM@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
 HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -616,6 +787,7 @@ HAVE_REALPATH = @HAVE_REALPATH@
 HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
 HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
@@ -632,6 +804,7 @@ HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
 HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
 HAVE_SYMLINK = @HAVE_SYMLINK@
 HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
@@ -639,6 +812,7 @@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
 HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
 HAVE_TIMEGM = @HAVE_TIMEGM@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
@@ -680,6 +854,7 @@ HAVE_WCSXFRM = @HAVE_WCSXFRM@
 HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
 HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
 HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WMEMCHR = @HAVE_WMEMCHR@
 HAVE_WMEMCMP = @HAVE_WMEMCMP@
@@ -696,6 +871,8 @@ INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 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@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
@@ -741,6 +918,7 @@ 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_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
 NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
 NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H = @NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H@
@@ -750,6 +928,8 @@ 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_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_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@
@@ -760,6 +940,7 @@ 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_INTTYPES_H = @NEXT_INTTYPES_H@
 NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_LOCALE_H = @NEXT_LOCALE_H@
 NEXT_SELINUX_SELINUX_H = @NEXT_SELINUX_SELINUX_H@
@@ -769,6 +950,8 @@ NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
 NEXT_STRING_H = @NEXT_STRING_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_WAIT_H = @NEXT_SYS_WAIT_H@
 NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
@@ -795,6 +978,8 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 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@
@@ -811,6 +996,7 @@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
 REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
@@ -822,6 +1008,7 @@ REPLACE_FSTAT = @REPLACE_FSTAT@
 REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
 REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
 REPLACE_GETDELIM = @REPLACE_GETDELIM@
@@ -830,11 +1017,15 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISATTY = @REPLACE_ISATTY@
 REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ITOLD = @REPLACE_ITOLD@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
 REPLACE_LINK = @REPLACE_LINK@
 REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALECONV = @REPLACE_LOCALECONV@
 REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
@@ -863,8 +1054,11 @@ REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
 REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
 REPLACE_REALLOC = @REPLACE_REALLOC@
 REPLACE_REALPATH = @REPLACE_REALPATH@
@@ -878,9 +1072,11 @@ REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
 REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
 REPLACE_STPNCPY = @REPLACE_STPNCPY@
 REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
 REPLACE_STRDUP = @REPLACE_STRDUP@
 REPLACE_STRERROR = @REPLACE_STRERROR@
 REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
@@ -890,10 +1086,14 @@ REPLACE_STRNLEN = @REPLACE_STRNLEN@
 REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
 REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
 REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
+REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
 REPLACE_SYMLINK = @REPLACE_SYMLINK@
 REPLACE_TIMEGM = @REPLACE_TIMEGM@
 REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
 REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
 REPLACE_UNLINK = @REPLACE_UNLINK@
 REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
@@ -926,6 +1126,8 @@ STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+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_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
@@ -933,6 +1135,8 @@ VERSION = @VERSION@
 VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@
 WARN_CFLAGS = @WARN_CFLAGS@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 YACC = @YACC@
 YFLAGS = @YFLAGS@
@@ -1001,14 +1205,14 @@ lensdir = $(datadir)/augeas/lenses/dist
 lenstestdir = $(datadir)/augeas/lenses/dist/tests
 dist_lens_DATA = $(wildcard lenses/*.aug)
 dist_lenstest_DATA = $(wildcard lenses/tests/*.aug)
-EXTRA_DIST = augeas.spec build/aux/move-if-change Makefile.am HACKING
+EXTRA_DIST = augeas.spec build/ac-aux/move-if-change Makefile.am HACKING
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = augeas.pc
 all: config.h
        $(MAKE) $(AM_MAKEFLAGS) all-recursive
 
 .SUFFIXES:
-am--refresh:
+am--refresh: Makefile
        @:
 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
        @for dep in $?; do \
@@ -1044,10 +1248,8 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 
 config.h: stamp-h1
-       @if test ! -f $@; then \
-         rm -f stamp-h1; \
-         $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
-       else :; fi
+       @if test ! -f $@; then rm -f stamp-h1; else :; fi
+       @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
 
 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
        @rm -f stamp-h1
@@ -1074,8 +1276,11 @@ distclean-libtool:
        -rm -f libtool config.lt
 install-dist_lensDATA: $(dist_lens_DATA)
        @$(NORMAL_INSTALL)
-       test -z "$(lensdir)" || $(MKDIR_P) "$(DESTDIR)$(lensdir)"
        @list='$(dist_lens_DATA)'; test -n "$(lensdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(lensdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(lensdir)" || exit 1; \
+       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
@@ -1089,13 +1294,14 @@ uninstall-dist_lensDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(dist_lens_DATA)'; test -n "$(lensdir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(lensdir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(lensdir)" && rm -f $$files
+       dir='$(DESTDIR)$(lensdir)'; $(am__uninstall_files_from_dir)
 install-dist_lenstestDATA: $(dist_lenstest_DATA)
        @$(NORMAL_INSTALL)
-       test -z "$(lenstestdir)" || $(MKDIR_P) "$(DESTDIR)$(lenstestdir)"
        @list='$(dist_lenstest_DATA)'; test -n "$(lenstestdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(lenstestdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(lenstestdir)" || exit 1; \
+       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
@@ -1109,13 +1315,14 @@ uninstall-dist_lenstestDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(dist_lenstest_DATA)'; test -n "$(lenstestdir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(lenstestdir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(lenstestdir)" && rm -f $$files
+       dir='$(DESTDIR)$(lenstestdir)'; $(am__uninstall_files_from_dir)
 install-pkgconfigDATA: $(pkgconfig_DATA)
        @$(NORMAL_INSTALL)
-       test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
        @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
+       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
@@ -1129,27 +1336,28 @@ uninstall-pkgconfigDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files
+       dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-       @fail= failcom='exit 1'; \
-       for f in x $$MAKEFLAGS; do \
-         case $$f in \
-           *=* | --[!k]*);; \
-           *k*) failcom='fail=yes';; \
-         esac; \
-       done; \
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+       @fail=; \
+       if $(am__make_keepgoing); then \
+         failcom='fail=yes'; \
+       else \
+         failcom='exit 1'; \
+       fi; \
        dot_seen=no; \
        target=`echo $@ | sed s/-recursive//`; \
-       list='$(SUBDIRS)'; for subdir in $$list; do \
+       case "$@" in \
+         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+         *) list='$(SUBDIRS)' ;; \
+       esac; \
+       for subdir in $$list; do \
          echo "Making $$target in $$subdir"; \
          if test "$$subdir" = "."; then \
            dot_seen=yes; \
@@ -1164,57 +1372,12 @@ $(RECURSIVE_TARGETS):
          $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
        fi; test -z "$$fail"
 
-$(RECURSIVE_CLEAN_TARGETS):
-       @fail= failcom='exit 1'; \
-       for f in x $$MAKEFLAGS; do \
-         case $$f in \
-           *=* | --[!k]*);; \
-           *k*) failcom='fail=yes';; \
-         esac; \
-       done; \
-       dot_seen=no; \
-       case "$@" in \
-         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-         *) list='$(SUBDIRS)' ;; \
-       esac; \
-       rev=''; for subdir in $$list; do \
-         if test "$$subdir" = "."; then :; else \
-           rev="$$subdir $$rev"; \
-         fi; \
-       done; \
-       rev="$$rev ."; \
-       target=`echo $@ | sed s/-recursive//`; \
-       for subdir in $$rev; do \
-         echo "Making $$target in $$subdir"; \
-         if test "$$subdir" = "."; then \
-           local_target="$$target-am"; \
-         else \
-           local_target="$$target"; \
-         fi; \
-         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-         || eval $$failcom; \
-       done && test -z "$$fail"
-tags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-       done
-ctags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-       done
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
        if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -1230,12 +1393,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
              set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
          fi; \
        done; \
-       list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -1247,15 +1405,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -1264,9 +1418,31 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+       test ! -s cscope.files \
+         || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+       -rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
 
 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)
        $(am__remove_distdir)
@@ -1302,13 +1478,10 @@ distdir: $(DISTFILES)
        done
        @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
          if test "$$subdir" = .; then :; else \
-           test -d "$(distdir)/$$subdir" \
-           || $(MKDIR_P) "$(distdir)/$$subdir" \
-           || exit 1; \
-         fi; \
-       done
-       @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-         if test "$$subdir" = .; then :; else \
+           $(am__make_dryrun) \
+             || test -d "$(distdir)/$$subdir" \
+             || $(MKDIR_P) "$(distdir)/$$subdir" \
+             || exit 1; \
            dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
            $(am__relativize); \
            new_distdir=$$reldir; \
@@ -1337,36 +1510,36 @@ distdir: $(DISTFILES)
        || chmod -R a+r "$(distdir)"
 dist-gzip: distdir
        tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-       $(am__remove_distdir)
+       $(am__post_remove_distdir)
 
 dist-bzip2: distdir
-       tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
-       $(am__remove_distdir)
+       tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+       $(am__post_remove_distdir)
 
-dist-lzma: distdir
-       tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
-       $(am__remove_distdir)
+dist-lzip: distdir
+       tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+       $(am__post_remove_distdir)
 
 dist-xz: distdir
-       tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
-       $(am__remove_distdir)
+       tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+       $(am__post_remove_distdir)
 
 dist-tarZ: distdir
        tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
-       $(am__remove_distdir)
+       $(am__post_remove_distdir)
 
 dist-shar: distdir
        shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
-       $(am__remove_distdir)
+       $(am__post_remove_distdir)
 
 dist-zip: distdir
        -rm -f $(distdir).zip
        zip -rq $(distdir).zip $(distdir)
-       $(am__remove_distdir)
+       $(am__post_remove_distdir)
 
-dist dist-all: distdir
-       tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-       $(am__remove_distdir)
+dist dist-all:
+       $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+       $(am__post_remove_distdir)
 
 # This target untars the dist file and tries a VPATH configuration.  Then
 # it guarantees that the distribution is self-contained by making another
@@ -1377,8 +1550,8 @@ distcheck: dist
          GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
        *.tar.bz2*) \
          bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
-       *.tar.lzma*) \
-         lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.lz*) \
+         lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
        *.tar.xz*) \
          xz -dc $(distdir).tar.xz | $(am__untar) ;;\
        *.tar.Z*) \
@@ -1388,9 +1561,9 @@ distcheck: dist
        *.zip*) \
          unzip $(distdir).zip ;;\
        esac
-       chmod -R a-w $(distdir); chmod a+w $(distdir)
-       mkdir $(distdir)/_build
-       mkdir $(distdir)/_inst
+       chmod -R a-w $(distdir)
+       chmod u+w $(distdir)
+       mkdir $(distdir)/_build $(distdir)/_inst
        chmod a-w $(distdir)
        test -d $(distdir)/_build || exit 0; \
        dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
@@ -1398,6 +1571,7 @@ distcheck: dist
          && am__cwd=`pwd` \
          && $(am__cd) $(distdir)/_build \
          && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+           $(AM_DISTCHECK_CONFIGURE_FLAGS) \
            $(DISTCHECK_CONFIGURE_FLAGS) \
          && $(MAKE) $(AM_MAKEFLAGS) \
          && $(MAKE) $(AM_MAKEFLAGS) dvi \
@@ -1421,13 +1595,21 @@ distcheck: dist
          && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
          && cd "$$am__cwd" \
          || exit 1
-       $(am__remove_distdir)
+       $(am__post_remove_distdir)
        @(echo "$(distdir) archives ready for distribution: "; \
          list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
          sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
 distuninstallcheck:
-       @$(am__cd) '$(distuninstallcheck_dir)' \
-       && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+       @test -n '$(distuninstallcheck_dir)' || { \
+         echo 'ERROR: trying to run $@ with an empty' \
+              '$$(distuninstallcheck_dir)' >&2; \
+         exit 1; \
+       }; \
+       $(am__cd) '$(distuninstallcheck_dir)' || { \
+         echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+         exit 1; \
+       }; \
+       test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
           || { echo "ERROR: files left after uninstall:" ; \
                if test -n "$(DESTDIR)"; then \
                  echo "  (check DESTDIR support)"; \
@@ -1461,10 +1643,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
 mostlyclean-generic:
 
 clean-generic:
@@ -1548,15 +1735,14 @@ ps-am:
 uninstall-am: uninstall-dist_lensDATA uninstall-dist_lenstestDATA \
        uninstall-pkgconfigDATA
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
-       ctags-recursive install-am install-strip tags-recursive
+.MAKE: $(am__recursive_targets) all install-am install-strip
 
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-       all all-am am--refresh check check-am clean clean-generic \
-       clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
-       dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
-       distcheck distclean distclean-generic distclean-hdr \
-       distclean-libtool distclean-local distclean-tags \
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+       am--refresh check check-am clean clean-cscope clean-generic \
+       clean-libtool cscope cscopelist-am ctags ctags-am dist \
+       dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
+       dist-xz dist-zip distcheck distclean distclean-generic \
+       distclean-hdr distclean-libtool distclean-local distclean-tags \
        distcleancheck distdir distuninstallcheck dvi dvi-am html \
        html-am info info-am install install-am install-data \
        install-data-am install-dist_lensDATA \
@@ -1567,17 +1753,17 @@ uninstall-am: uninstall-dist_lensDATA uninstall-dist_lenstestDATA \
        install-strip installcheck installcheck-am installdirs \
        installdirs-am maintainer-clean maintainer-clean-generic \
        mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
-       ps ps-am tags tags-recursive uninstall uninstall-am \
+       ps ps-am tags tags-am uninstall uninstall-am \
        uninstall-dist_lensDATA uninstall-dist_lenstestDATA \
        uninstall-pkgconfigDATA
 
 
 distclean-local:
-       -find $(top_builddir)/build/* -maxdepth 0 -not -name aux | xargs rm -rf
+       -find $(top_builddir)/build/* -maxdepth 0 -not -name ac-aux | xargs rm -rf
 
 ChangeLog:
        if test -d $(top_srcdir)/.git; then                             \
-         $(top_srcdir)/build/aux/gitlog-to-changelog > $@;             \
+         $(top_srcdir)/build/ac-aux/gitlog-to-changelog > $@;             \
        fi
 
 dist: ChangeLog
diff --git a/NEWS b/NEWS
index 0365547..13dc9a1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,531 @@
+1.3.0 - 2014-11-07
+  - General changes/additions
+    * Add missing cp entry in manpage (GH issue #78)
+    * Add seq to vim syntax highlight (Robert Drake)
+    * Update augtool.1 man page with new commands and --span, RHBZ#1100077
+    * augtool autocomplete includes command aliases, RHBZ#1100184
+    * Remove unused "filename" argument from dump-xml command, RHBZ#1100106
+    * aug_save returns non-zero result when unable to delete files,
+      RHBZ#1091143
+  - Lens changes/additions
+    * Aliases: permit missing whitespace between colon and recipients
+    * AptPreferences: Support spaces in origin fields
+    * Cgconfig: handle additional valid controllers (Andy Grimm)
+    * Chrony: New lens to parse /etc/chrony.conf (Pat Riehecky)
+    * CPanel: New lens to parse cpanel.config files
+    * Desktop: Allow @ in keys (GH issue #92)
+    * Device_map: Parse all device.map files under /boot (Mike Latimer)
+    * Dhclient: Add support for option modifiers (Robert Drake,
+                GH issue #95)
+                Parse hash statements with dhcp-eval strings
+    * Dhcpd: stmt_string quoted blocks no longer store quote marks
+             (incompatible change),
+             many changes to support more record types (Robert Drake)
+    * Group: NIS support (KaMichael)
+    * Grub: handle "foreground" option, RHBZ#1059383 (Miguel Armas)
+    * Gshadow: New lens (Lorenzo Catucci)
+    * Httpd: Allow eol comments after section tags
+             Allow continued lines inside quoted value (GH issue #104)
+             Allow comparison operators in tags (GH issue #154)
+    * IPRoute2: handle "/" in protocol name, swap ID and name fields
+                (incompatible change), RHBZ#1063968,
+                handle hex IDs and hyphens, as present in
+                rt_dsfield, RHBZ#1063961
+    * Iptables: parse /etc/sysconfig/iptables.save, RHBZ#1144651
+    * Kdump: parse new options, permit EOL comments, refactor, RHBZ#1139298
+    * Keepalived: Add more virtual/real server settings and checks, RHBZ#1064388
+    * Known_Hosts: New lens for SSH known hosts files
+    * Krb5: permit braces in values when not in sub-section, RHBZ#1066419
+    * Ldso: handle "hwcap" lines (GH issue #100)
+    * Lvm: support negative numbers, parse /etc/lvm/lvm.conf (Pino Toscano)
+    * Multipath: add support for rr_min_io_rq (Joel Loudermilk)
+    * NagiosConfig and NagiosObjects: Fix documentation (Simon Sehier)
+    * NetworkManager: Use the Quote module, support # in values (no eol comments)
+    * OpenVPN: Add support for fragment, mssfix, and script-security
+               (Frank Grötzner)
+    * Pagekite: New lens (Michael Pimmer)
+    * Pam: Add partial support for arguments enclosed in [] (Vincent Brillault)
+    * Passwd: Refactor lens (Lorenzo Catucci)
+    * Redis: Allow empty quoted values (GH issue #115)
+    * Rmt: New lens to parse /etc/default/rmt, RHBZ#1100549
+    * Rsyslog: support complex $template lines, property filters and file
+               actions with templates, RHBZ#1083016
+    * Services: permit colons in service name, RHBZ#1121263
+    * Shadow: New lens (Lorenzo Catucci)
+    * Shellvars: Handle case statements with same-line ';;', RHBZ#1033799
+                 Allow any kind of quoted values in block
+                 conditions (GH issue #118)
+                 Support $(( .. )) arithmetic expansion in variable
+                 assignment, RHBZ#1100550
+    * Simplevars: Support flags and empty values
+    * Sshd: Allow all types of entries in Match groups (GH issue #75)
+    * Sssd: Allow ; for comments
+    * Squid: Support configuration files for squid 3 (Mykola Nikishov)
+    * Sudoers: Allow wuoted string in default str/bool params (Nick Piacentine)
+    * Syslog: Support "# !" style comments (Robert Drake, GH issue #65)
+              Permit IPv6 loghost addresses, RHBZ#1129388
+    * Systemd: Allow quoted Environment key=value pairs, RHBZ#1100547
+               Parse /etc/sysconfig/*.systemd, RHBZ#1083022
+               Parse semicolons inside entry values, RHBZ#1139498
+    * Tuned: New lens for /etc/tuned/tuned-main.conf (Pat Riehecky)
+    * UpdateDB: New lens to parse /etc/updatedb.conf
+                (incompatible change as this file used to be processed with
+                 Simplevars)
+    * Xml: Allow backslash in #attribute values (GH issue #145)
+           Parse CDATA elements (GH issue #80)
+    * Xymon_Alerting: refactor lens (GH issue #89)
+
+1.2.0 - 2014-01-27
+  - API changes
+    * Add aug_cp and the cp and copy commands
+    * aug_to_xml now includes span information in the XML dump
+  - General changes/additions
+    * Fix documentation link in c_api NaturalDocs menu
+    * Fix NaturalDocs documentation for various lenses
+    * src/transform.c (filter_matches): wrap fnmatch to ensure that an incl
+      pattern containing "//" matches file paths, RHBZ#1031084
+    * Correct locations table for transform_save() (Tomas Hoger)
+    * Corrections for CVE-2012-0786 tests (Tomas Hoger)
+    * Fix umask handling when creating new files, RHBZ#1034261
+  - Lens changes/additions
+    * Access: support DOMAIN\user syntax for users and groups, bug #353
+    * Authorized_Keys: Allow 'ssh-ed25519' as a valid authorized_key
+      type (Jasper Lievisse Adriaanse)
+    * Automounter: Handle hostnames with dashes in them, GH issue #27
+    * Build: Add combinatorics group
+    * Cyrus_Imapd: Create new entries without space before separator,
+      RHBZ#1014974 (Dietmar Kling)
+    * Desktop: Support square brackets in keys
+    * Dhclient: Add dhclient.conf path for Debian/Ubuntu (Esteve Fernandez)
+    * Dhcpd: Support conditionals, GH issue #34
+             Support a wider variety of allow/deny statement, including
+             booting and bootp (Yanis Guenane)
+             Support a wider variety of DHCP allow/deny/ignore statements
+             (Yanis Guenane)
+    * Dovecot: Various enhancements and bug fixes (Michael Haslgrübler):
+               add mailbox to block_names, fix for block_args in quotes,
+               fix for block's brackets upon write,
+               fixes broken tests for mailbox,
+               fixes indention,
+               test case for block_args with ",
+               fixes broken indention
+               Use Quote module
+    * Exports: Permit colons for IPv6 client addresses, bug #366
+    * Grub: Support the 'setkey' and 'lock' directives
+            NFC fix whitespace errors
+            Handle makeactive menu command, bug #340
+            Add 'verbose' option, GH issue #73
+    * Interfaces: Add in support for the source stanza in
+                  /etc/network/interfaces files
+                  Map bond-slaves and bridge-ports to arrays (incompatible
+                  change) (Kaarle Ritvanen)
+                  Add /etc/network/interfaces.d/* support
+                  Allow numeric characters in stanza options (Pascal Lalonde)
+    * Koji: New lens to parse Koji configs (Pat Riehecky)
+    * MongoDBServer: Accept quoted values (Tomas Klouda)
+    * NagiosCfg: Do not try to parse /etc/nagios/nrpe.cfg anymore, GH issue #43
+                 /etc/nagios/nrpe.cfg is parsed by Nrpe (Yanis Guenane)
+    * Nagiosobjects: Add support for optional spaces and indents
+                     and whole-line comments (Sean Millichamp)
+    * OpenVPN: Support daemon, client-config-dir, route, and management
+               directives (Freakin https://github.com/Freakin)
+    * PHP: allow php-fpm syntax in keys, GH issue #35
+    * Postfix_Main: Handle stray whitespace at end of multiline lines, bug #348
+    * Postfix_virtual: allow '+' and '=' in email addresses (Tom Hendrikx)
+    * Properties: support multiline starting with an empty string, GH issue #19
+    * Samba: Permit asterisk in key name, bug #354
+    * Shellvars: Read /etc/firewalld/firewalld.conf, bug #363
+                 Support all types of quoted strings in arrays, bug #357
+                 Exclude /etc/sysconfig/ip*tables.save files
+    * Shellvars, Sysconfig: map "bare" export and unset lines to seq numbered
+      nodes to handle multiple variables (incompatible change), RHBZ#1033795
+    * Shellvars_list: Handle backtick variable assignments, bug #368
+                      Allow end-of-line comments, bug #342
+    * Simplevars: Add /etc/selinux/semanage.conf
+    * Slapd: use smart quotes for database entries; rename by/what to by/access;
+      allow access to be absent as per official docs (incompatible change)
+    * Sshd: Indent Match entries by 2 spaces by default
+            Support Ciphers and KexAlgorithms groups, GH issue #69
+            Let all special keys be case-insensitive
+    * Sudoers: Permit underscores in group names, bug #370 (Matteo Cerutti)
+               Allow uppercase characters in user names, bug #376
+    * Sysconfig: Permit empty comments after comment lines, RHBZ#1043636
+    * Sysconfig_Route: New lens for RedHat's route configs
+    * Syslog: Accept UDP(@) and TCP(@@) protocol, bug #364 (Yanis Guenane)
+    * Xymon_Alerting: New lens for Xymon alerting files (François Maillard)
+    * Yum: Add yum-cron*.conf files (Pat Riehecky)
+           Include only *.repo files from yum.repos.d (Andrew N Golovkov)
+           Permit spaces after equals sign in list options, GH issue #45
+           Split excludes as lists, bug #275
+
+1.1.0 - 2013-06-14
+  - General changes/additions
+    * Handle files with special characters in their name, bug #343
+    * Fix type error in composition ('f; g') of functions, bug #328
+    * Improve detection of version script; make build work on Illumos with
+      GBU ld (Igor Pashev)
+    * augparse: add --trace option to print filenames of all modules being
+      loaded
+    * Various lens documentation improvements (Jasper Lievisse Adriaanse)
+  - Lens changes/additions
+    * ActiveMQ_*: new lens for ActiveMQ/JBoss A-MQ (Brian Harrington)
+    * AptCacherNGSecurity: new lens for /etc/apt-cacher-ng/security.conf
+      (Erik Anderson)
+    * Automaster: accept spaces between options
+    * BBHosts: support more flags and downtime feature (Mathieu Alorent)
+    * Bootconf: new lens for OpenBSD's /etc/boot.conf (Jasper Lievisse Adriaanse)
+    * Desktop: Support dos eol
+    * Dhclient: read /etc/dhclient.conf used in OpenBSD (Jasper Lievisse Adriaanse)
+    * Dovecot: New lens for dovecot configurations (Serge Smetana)
+    * Fai_Diskconfig: Optimize some regexps
+    * Fonts: exclude all README files (Jasper Lievisse Adriaanse)
+    * Inetd: support IPv6 addresses, bug #320
+    * IniFile: Add lns_loose and lns_loose_multiline definitions
+               Support smart quotes
+      Warning: Smart quotes support means users should not add
+               escaped double quotes themselves. Tests need to be fixed
+               also.
+               Use standard Util.comment_generic and Util.empty_generic
+      Warning: Existing lens tests must be adapted to use standard
+               comments and empty lines
+               Allow spaces in entry_multiline* values
+               Add entry_generic and entry_multiline_generic
+               Add empty_generic and empty_noindent
+               Let multiline values begin with a single newline
+               Support dos eol
+      Warning: Support for dos eol means existing lenses usually
+               need to be adapted to exclude \r as well as \n.
+    * IPRoute2: Support for iproute2 files (Davide Guerri)
+    * JaaS: lens for the Java Authentication and Authorization Service
+            (Simon Vocella)
+    * JettyRealm: new lens for jetty-realm.properties (Brian Harrington)
+    * JMXAccess, JMXPassword: new lenses for ActiveMQ's JMX files
+      (Brian Harrington)
+    * Krb5: Use standard comments and empty lines
+            Support dos eol
+            Improve performance
+            Accept pkinit_anchors (Andrew Anderson)
+    * Lightdm: Use standard comments and empty lines
+    * LVM: New lens for LVM metadata (Gabriel)
+    * Mdadm_conf: optimize some regexps
+    * MongoDBServer: new lens (Brian Harrington)
+    * Monit: also load /etc/monitrc (Jasper Lievisse Adriaanse)
+    * MySQL: Use standard comments and empty lines
+             Support dos eol
+    * NagiosCfg: handle Icinga and resources.cfg (Jasper Lievisse Adriaanse)
+    * Nrpe: accept any config option rather than predefined list (Gonzalo
+            Servat); optimize some regexps
+    * Ntpd: new lense for OpenNTPD config (Jasper Lievisse Adriaanse)
+    * Odbc: Use standard comments and empty lines
+    * Openshift_*: new lenses for Openshift support (Brian Harrington)
+    * Quote: allow multiple spaces in quote_spaces; improve docs
+    * Passwd: allow period in user names in spec, bug #337; allow overrides
+              in nisentry
+    * PHP: Support smart quotes
+           Use standard comments and empty lines
+           Load /etc/php*/fpm/pool.d/*.conf (Enrico Stahn)
+    * Postfix_master: allow [] in words, bug #345
+    * Resolv: support 'lookup' and 'family' key words, bug #320
+              (Jasper Lievisse Adriaanse))
+    * Rsyslog: support :omusrmsg: list of users in actions
+    * RX: add CR to RX.space_in
+    * Samba: Use standard comments and empty lines
+             Support dos eol
+    * Schroot: Support smart quotes
+    * Services: support port ranges (Branan Purvine-Riley)
+    * Shellvars: optimize some regexps; reinstate /etc/sysconfig/network,
+      fixes bug #330, RHBZ#904222, RHBZ#920609; parse /etc/rc.conf.local
+      from OpenBSD
+    * Sip_Conf: New lens for sip.conf configurations (Rob Tucker)
+    * Splunk: new lens (Tim Brigham)
+    * Subversion: Support smart quotes
+                  Use standard comments and empty lines
+                  Use IniFile.entry_multiline_generic
+                  Use IniFile.empty_noindent
+                  Support dos eol
+    * Sudoers: allow user aliases in specs
+    * Sysctl: exclude README file
+    * Systemd: Support smart quotes; allow backslashes in values
+    * Xinetd: handle missing values in list, bug #307
+    * Xorg: allow 'Screen' in Device section, bug #344
+    * Yum: Support dos eol, optimize some regexps
+
+1.0.0 - 2012-12-21
+  - General changes/additions
+    * fix missing requirement on libxml2 in pkg-config
+    * do not replace pathin with '/*' unless the length is 0
+      or pathin is '/', bug #239
+    * create context path if it doesn't exist
+    * add missing argument to escape() to fix build on solaris, bug #242
+    * fix fatest linking with libfa
+    * don't use variables uninitialized upon error (Jim Meyering)
+    * bootstrap: add strchrnul gnulib module (for Solaris)
+    * remove Linux-isms so tests can run on Solaris
+    * re-open rl_outstream/stdout only when stdout isn't a tty
+      (fixes -e -i); use /dev/tty instead of /dev/stdout when re-opening
+      to prevent permission errors, bug #241
+    * take root into account for excludes, bug #252
+    * fix different errors for parse and put failure
+    * fix various memory leaks
+    * add leak test
+    * allocate exception instead of static const value
+    * improve aug_srun quoting to permit concatenation and better detect
+      bad quoting
+    * rename echo to echo_commands to fix differing types reported
+      with Solaris linker (Tim Mooney), bug #262
+    * fix excl filters that only specify a filename or wildcard
+    * make sure reloading discards changes after save with mode 'newfile'
+    * remove loop that added a second iteration around children of /files,
+      causing multiple saves in newfile and noop modes when editing under
+      /files/boot, bug #264
+    * support \t and \n in aug_srun tokens, bug #265
+    * compile_exp: don't return an uninitialized pointer upon failure
+      (Jim Meyering)
+    * include 'extern "C"' wrapper for C++, bug #272 (Igor Pashev)
+    * src/try: don't overwrite gdbcmds.txt if it exists
+    * fix behavior of set with empty strings
+    * allow running individual tests with test-run
+    * test-augtool.sh: escape all possible regular expressions before
+      they are sent to sed (Micah Anderson)
+    * add new print_tree primitive
+    * fix bad memory access in regexp.c
+    * case-insensitive regexps: fix a problem with number of groups
+    * prevent symlink attacks via .augnew during saving,
+      RedHat bug #772257, CVE-2012-0786
+    * prevent cross-mountpoint attacks via .augsave during saving,
+      RedHat bug #772261, CVE-2012-0787
+    * add bundled (gnulib) provides in augeas.spec.in, RedHat bug #821745
+    * make Travis CI builds
+    * src/transform.c (xread_file): catch failed fopen, e.g. EACCES
+    * src/augrun.c (cmd_retrieve_help): tidy line wrapping
+    * make get_square case insensitive on the ending key
+    * escape double quotes when dumping regexp
+    * use constants for "lens", "incl" and "excl"
+    * src/transform.c (filter_generate): remove duplicate variable assignment
+    * src/jmt.c (parse_add_item): ensure return is defined on goto error
+    * src/transform.c (transform_save): chmod after creating new files to
+      permissions implied by the umask
+    * ignore eclipse settings directory
+    * fix memory leak in dbg_visit
+    * build AST while visiting the parse v2
+    * rewrite square lens to be more generic, allowing e.g. square quoting
+    * tests/modules/fail_shadow_union.aug: fix unintended test failure
+    * src/syntax.c (compile_test): print which test failed when missing
+      exception
+    * libfa (fa_enumerate): new function
+    * use precise ctype of a square lens if it is indeed regula
+    * square: properly handle first lens matching empty string
+    * square lens: correctly process skeletons during put
+    * src/pathx.c: disallow ',' in names in path expressions
+    * src/pathx.c: match functions by name and arity
+    * src/pathx.c: pass the number of actual arguments to the func
+      implementation
+    * correctly parse escaped string literals in vim syntax file (Domen Ko¿ar)
+  - API changes/additions
+    * add aug_text_store to write string to tree
+    * add aug_text_retrieve to turn tree into text
+    * add aug_rename to rename node labels without moving them in the tree
+    * add aug_transform to allow specifying transforms
+    * add aug_label to retrieve the label from a path
+  - Augtool/aug_srun changes/additions
+    * add "touch" command to create node if it doesn't exist, bug #276
+    * make <VALUE> argument to "set" and "setm" optional, bug #276
+    * add "text_store" and "text_retrieve" commands
+    * add "rename" command
+    * add "transform" command and "-t|--transform" option
+    * add "label" command
+    * arrange commands in groups for better help
+    * man/augtool.pod: update mentions of default load path
+    * fix exit code when using autosave
+    * output errors when sending a command as argument
+    * honor --echo when sending a command as argument
+  - XPath changes/additions
+    * add support for an 'i' flag in regexp builtin function
+  - Lens changes/additions
+    * Aliases: commands can be fully enclosed in quotes, bug #229
+    * Anacron: new lens for /etc/anacrontab
+    * Apt_Update_Manager: new lens for /etc/update-manager
+    * AptPreferences: #comments are accepted within entries
+    * AuthorizedKeys: new lens for SSH's authorized_keys
+    * AutoMaster: new lens for auto.master files
+    * AutoMounter: new lens for automounter maps (/etc/auto.*)
+    * Avahi: new lens for /etc/avahi/avahi-daemon.conf (Athir Nuaimi)
+    * Build: add blocks
+    * Cachefilesd: new lens for /etc/cachefilesd.conf (Pat Riehecky)
+    * Carbon: new lens for /etc/carbon files (Marc Fournier)
+    * Cgconfig: add space between group and id (Filip Andres)
+    * Channels: new lens for channels.conf
+    * Collectd: new lens for /etc/collectd.conf
+    * Cron: exclude cron allow/deny files;
+            optimize typechecking;
+            records can be prefixed by '-' (Michal Filka)
+    * CronAllow: new lens for cron/at allow/deny files
+    * Cups: new lens for Cups files
+    * Cyrus_Imapd: new lens for /etc/imapd.conf, bug #296 (Jeroen van Meeuwen)
+    * Debctrl: fixed package paragraph keywords, allow variables
+               for version numbers in dependency lists,
+               allow DM-Upload-Allowed keyword, Debian bug #650887;
+               allow control extensions for Python packages, bug #267
+    * Dhcpd: fix primary statement arguments, bug #293;
+             use the Quote module to manage quoted values;
+             force double quotes for filename attribute, bug #311
+    * Dput: use Sys.getenv("HOME")
+    * Erlang: new generic lens to build Erlang config lenses
+    * Fonts: new lens for /etc/fonts files
+    * Fstab: handle options with empty values ("password=");
+             make options field optional;
+             allow end-of-line comment
+    * Fuse: new lens for fuse.conf
+    * Gdm: include /etc/gdm/custom.conf
+    * Grub: parse "password --encrypted" properly, bug #250;
+            optimize typechecking;
+            add /boot/grub/grub.conf to transform (Josh Kayse)
+    * GtkBookmarks: new lens for $HOME/.gtk-bookmarks
+    * Hosts_Access: add netmask;
+                    permit more client list formats
+                    (whitespace separated lists, @netgroups,
+                    IPv6 hosts, inc. zone indices,
+                    paths to lists of clients, wildcards,
+                    hosts_options), bug #256
+    * Htpasswd: new lens for htpasswd/rsyncd.secret files (Marc Fournier)
+    * Httpd: support DOS eol
+    * IniFile: allow # and ; in quoted values, bug #243;
+               add entry_list and entry_list_nocomment
+    * Inputrc: new lens for /etc/inputrc
+    * Iptables: test that blank lines are accepted (Terence Haddock)
+    * Json: allow JSON number literals to be followed by whitespace;
+            correctly parse empty object and arrays (Lubomir Rintel)
+    * Keepalived: various improvements, optimize typechecking
+    * Krb5: handle host{} sections in v4_name_convert;
+            support ticket_lifetime;
+            handle multiple arguments to *_enctypes (Pat Riehecky);
+            better whitespace and semicolon comment support
+    * Ldif: new lens to read LDIF files per RFC2849
+    * Ldso: new lens for ld.so.conf files
+    * Lightdm: new lens for /etc/lightdm/*.conf, bug #302 (David Salmen)
+    * Logrotate: rewrite with Build, Rx, and Sep;
+                 add su logrotate.conf option (Luc Didry);
+                 accept integers prefixed by a sign (Michal Filka)
+    * Logwatch: new lens for /etc/logwatch/conf/logwatch.conf (Francois Lebel)
+    * Mcollective: new lens for Mcollective files (Marc Fournier)
+    * Memcached: new lens for /etc/memcached.conf (Marc Fournier)
+    * Mdadm_conf: include /etc/mdadm/mdadm.conf
+    * Mke2fs: add support for default_mntopts, enable_periodic_fsck,
+              and auto_64-bit_support
+    * Modprobe: support softdep command, Debian bug #641813;
+                allow spaces around '=' in option, RedHat bug #826752;
+                support multiline split commands, Ubuntu bug #1054306;
+                revert inner lens name change, fixes Modules_conf
+    * Modules: define own entry regexp as referenced Modprobe inner lens
+               doesn't match file format
+    * Multipath: allow devices to override defaults, bug #278 (Jacob M. McCann)
+    * NagiosCfg: support syntax for commands.cfg and resource.cfg
+    * Netmask: new lens for /etc/inet/netmasks on Solaris
+    * NetworkManager: new lens for NetworkManager files
+    * Networks: handle multiple missing network octets,
+                fix sequencing of aliases
+    * Nginx: new lens for /etc/nginx/nginx.conf (Ian Berry)
+    * Nsswitch: add passwd_compat, group_compat and shadow_compat
+                GNU extensions (Travis Groth);
+                remove long list of databases, match by regexp
+    * Ntp: allow deprecated 'authenticate' setting;
+           add tos directive, bug #297 (Jacob M. McCann)
+    * OpenVPN: use the Quote module to manage quoted values
+    * Pam: allow uppercase chars in 'types', remove /etc/pam.conf from filter;
+           ignore allow.pamlist;
+           exclude /etc/pam.d/README, bug #255
+    * PamConf: new lens for /etc/pam.conf
+    * Passwd: allow asterisk in password field, bug #255
+    * Pg_Hba: support multiple options, bug #313;
+              add a path to pg_hba.aug, bug #281 (Marc Fournier)
+    * Php: support include() statements
+    * Phpvars: map arrays with @arraykey subnodes to make working paths;
+               support classes and public/var values, bug #299 (aheahe)
+    * Postfix_Transport: new lens for Postfix transport files;
+               allow host:port and [host]:port syntaxes, bug #303
+    * Postfix_Virtual: new lens for Postfix virtual files
+    * Postgresql: new lens for postgresql.conf;
+                  properly support quotes, bug #317
+    * Properties: improve handling of whitespace, empty props, and underscores
+                  in keys (Brett Porter, Carlos Sanchez)
+    * Protocols: new lens for /etc/protocols
+    * Puppet: add /usr/local/etc/puppet paths (Tim Bishop)
+    * Puppet_Auth: new lens for /etc/puppet/auth.conf
+    * PuppetFileserver: add /usr/local/etc/puppet paths (Tim Bishop)
+    * PythonPaste: new lens for Python Paste configs (Dan Prince)
+    * Qpid: new lens to read Apache Qpid daemon/client configs (Andrew Replogle)
+    * Quote: new generic lens to manage quoted values using square lenses
+    * Rabbitmq: new lens for /etc/rabbitmq/rabbitmq.config
+    * Redis: new lens for /etc/redis/redis.conf (Marc Fournier)
+    * Resolv: add in single-request-reopen (Erinn Looney-Triggs)
+    * Rsyslog: new lens for rsyslog files
+    * Rx: add continous lines (cl, cl_or_space, cl_or_opt_space)
+    * Sep: add space_equal;
+           add continous lines (cl_or_space, cl_or_opt_space)
+    * Shellvars: support @return;
+                 allow multiple elif statements;
+                 parse functions;
+                 add more includes;
+                 autoload some SuSe and RHN specific files (Duncan Mac-Vicar P);
+                 add BSD's /etc/rc.conf, bug #255;
+                 remove non-shell files, up2date now has a lens,
+                 move updatedb.conf to Simplevars;
+                 include /etc/{default,sysconfig}/* and /etc/selinux/config;
+                 add systemd's /etc/os-release file;
+                 exclude bootloader from shellvars (Duncan Mac-Vicar P);
+                 handle bash's implicit concatenation of quoted strings
+                 (Michal Filka);
+                 exclude /etc/default/whoopsie;
+                 fix ambiguity by making semi-colons illegal in bquot
+                 and arrays;
+                 add lns_norec to check for ambiguities;
+                 allow newlines in quoted values;
+                 allow semi-colons in bquot and dollar_assign;
+                 make end-of-line comments begin with a space;
+                 allow double backquoted values;
+                 support matching keys in var_action, bug #290;
+                 fix empty lines after comments;
+                 add shift and exit builtins, with optional args;
+                 allow double quotes around variables in case statements;
+                 fix empty comments;
+                 add locale.conf, vconsole.conf systemd configs,
+                 RedHat bug #881841
+    * Shells: permit same-line comments
+    * Simplelines: new lens for simple lines files
+    * Simplevars: new lens for simple key/value, non shellvars files
+    * Smbusers: new lens for Samba's smbusers
+    * Sssd: new lens for sssd.conf (Erinn Looney-Triggs)
+    * Ssh: use Sys.getenv('HOME') in filter instead of ~ since it's not
+           expanded (Luc Didry)
+    * Sshd: permit hyphens in subsystem names
+    * Subversion: new lens for /etc/subversion files
+    * Sudoers: optimize typechecking;
+               allow = in commands (but force ! or / as first character
+               if not an alias);
+               allow commands without full path if they begin with a lowcase
+               letter;
+               allow "!" as a type of Defaults entry, Debian bug #650079;
+               allow quoted strings in Defaults parameters, bug #263
+    * Sysconfig: handle end of line comments and semicolons; strip quotes,
+                 RedHat bug #761246
+    * Sysctl: include /etc/sysctl.d files
+    * Syslog: allow capital letters in tokens
+    * Systemd: new lens to parse systemd unit files
+    * Thttpd: new lens for /etc/thttpd/thttpd.conf (Marc Fournier)
+    * Up2date: new lens for /etc/sysconfig/rhn/up2date
+    * Util: add comment_noindent; add delim; add doseol;
+            support DOS eols in various places;
+            add *.bak and *.old to stdexcl, to match files in /etc/sysconfig
+    * Vfstab: new lens for /etc/vfstab config on Solaris
+    * Vmware_Config: new lens for /etc/vmware/config
+    * Vsftpd: add require_ssl_reuse option (Danny Yates)
+    * Xinetd: rewrite with Build, Sep, and Rx;
+              make attribute names case-insensitive (Michal Filka)
+    * Xml: support single _and_ double quoted attribute values,
+           RedHat bug #799885, bug #258
+    * Xymon: new lens for Xymon config files, bug #266 (Jason Kincl)
+    * Yum: rebase on IniFile, support for comments, bug #217
+
 0.10.0 - 2011-12-02
   - support relative paths by taking them relative to the value
     of /augeas/context in all API functions where paths are used
diff --git a/README b/README
index 92d9e87..8ea1c36 100644 (file)
--- a/README
+++ b/README
@@ -34,41 +34,42 @@ Introduction
 Non-goals
 ---------
 
-  Augeas is as much defined by the things it does _not_ try to accomplish
-  as by its goals:
-
-    * No abstraction from native config format, i.e. the organization of
-      the tree mirrors closely how the native config files are organized
-    * No cross-platform abstraction - what is logically the same value may
-      live in different places in the tree on different
-      distributions. Dealing with that should be left to a higher-level
-      tool
-    * No remote management support. Augeas is a local API, other ways of
-      access to Augeas should be built on top of it
-    * No (or very little) modelling. Augeas is focused on syntax
-      transformation, not on any higher-level understanding of
-      configuration.
-
-  The above non-goals are of course important concerns in
-  practice. Historically though, too many config mgmt projects have failed
-  because they set their sights too high and tried to address syntax
-  transformation, modelling, remote support, and scalable management all in
-  one. That leads to a lack of focus, and to addressing each of those goals
-  unsatisfactorily.
+Augeas is as much defined by the things it does _not_ try to accomplish
+as by its goals:
+
+* No abstraction from native config format, i.e. the organization of
+  the tree mirrors closely how the native config files are organized
+* No cross-platform abstraction - what is logically the same value may
+  live in different places in the tree on different
+  distributions. Dealing with that should be left to a higher-level
+  tool
+* No remote management support. Augeas is a local API, other ways of
+  access to Augeas should be built on top of it
+* No (or very little) modelling. Augeas is focused on syntax
+  transformation, not on any higher-level understanding of
+  configuration.
+
+The above non-goals are of course important concerns in
+practice. Historically though, too many config mgmt projects have failed
+because they set their sights too high and tried to address syntax
+transformation, modelling, remote support, and scalable management all in
+one. That leads to a lack of focus, and to addressing each of those goals
+unsatisfactorily.
 
 Building
 --------
 
-  These instructions apply to building a released tarball. If you want to
-  build from a git checkout, see the file HACKING.
+These instructions apply to building a released tarball. If you want to
+build from a git checkout, see the file HACKING.
+
+See the generic instructions in INSTALL. Generally,
 
-  See the generic instructions in INSTALL. Generally,
-    ./configure
-    make && make install
-  should be all that is needed.
+      ./configure
+      make && make install
+should be all that is needed.
 
-  You need to have readline-devel installed. On systems that support
-  SELinux, you should also install libselinux-devel.
+You need to have readline-devel installed. On systems that support
+SELinux, you should also install libselinux-devel.
 
 Documentation
 -------------
@@ -76,3 +77,9 @@ Documentation
 Documentation can be found on Augeas' website http://augeas.net/ The site
 also contains information on how to get in touch, what you can do to help
 etc.
+
+License
+-------
+
+Augeas is released under the [Lesser General Public License, Version 2.1](http://www.gnu.org/licenses/lgpl-2.1.html)
+See the file COPYING for details.
index 7168cf3..f632182 100644 (file)
@@ -19,7 +19,7 @@ AC_DEFUN([AUGEAS_COMPILE_WARNINGS],[
 
     warnCFLAGS=
 
-    common_flags="-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fasynchronous-unwind-tables"
+    common_flags="-fexceptions -fasynchronous-unwind-tables"
 
     case "$enable_compile_warnings" in
     no)
@@ -45,6 +45,14 @@ AC_DEFUN([AUGEAS_COMPILE_WARNINGS],[
        ;;
     esac
 
+    AH_VERBATIM([FORTIFY_SOURCE],
+    [/* Enable compile-time and run-time bounds-checking, and some warnings,
+        without upsetting newer glibc. */
+     #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
+     # define _FORTIFY_SOURCE 2
+     #endif
+    ])
+
     compiler_flags=
     for option in $try_compiler_flags; do
        SAVE_CFLAGS="$CFLAGS"
index b3a5ed7..162cf2b 100644 (file)
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.13.4 -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009  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.
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
+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.68],,
-[m4_warning([this file was generated for autoconf 2.68.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
 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'.])])
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 # serial 1 (pkg-config-0.24)
@@ -47,7 +48,8 @@ To do so, use the procedure documented by the package, typically `autoreconf'.])
 # ----------------------------------
 AC_DEFUN([PKG_PROG_PKG_CONFIG],
 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
@@ -93,7 +95,8 @@ m4_define([_PKG_CONFIG],
     pkg_cv_[]$1="$$1"
  elif test -n "$PKG_CONFIG"; then
     PKG_CHECK_EXISTS([$3],
-                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes ],
                     [pkg_failed=yes])
  else
     pkg_failed=untried
@@ -141,9 +144,9 @@ if test $pkg_failed = yes; then
        AC_MSG_RESULT([no])
         _PKG_SHORT_ERRORS_SUPPORTED
         if test $_pkg_short_errors_supported = yes; then
-               $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
         else 
-               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
         fi
        # Put the nasty error message in config.log where it belongs
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
@@ -156,7 +159,7 @@ $$1_PKG_ERRORS
 Consider adjusting the PKG_CONFIG_PATH environment variable if you
 installed software in a non-standard prefix.
 
-_PKG_TEXT])
+_PKG_TEXT])[]dnl
         ])
 elif test $pkg_failed = untried; then
        AC_MSG_RESULT([no])
@@ -167,7 +170,7 @@ path to pkg-config.
 
 _PKG_TEXT
 
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
         ])
 else
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
@@ -177,457 +180,62 @@ else
 fi[]dnl
 ])# PKG_CHECK_MODULES
 
-# po.m4 serial 17 (gettext-0.18)
-dnl Copyright (C) 1995-2010 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.50])
-
-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([AM_PROG_MKDIR_P])dnl defined by automake
-  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.18])
-
-  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"
-          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[  ]*\$/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 assigment 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 assigment 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.
-  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.
-/^[     ]*VARIABLE[     ]*=/{
-  # Seen the first line of the variable definition.
-  s/^[  ]*VARIABLE[     ]*=//
-  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 assigment 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"
-  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
-       @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
-       \$(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
-       @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
-       \$(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"
-])
+# PKG_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable pkgconfigdir as the location where a module
+# should install pkg-config .pc files. By default the directory is
+# $libdir/pkgconfig, but the default can be changed by passing
+# DIRECTORY. The user can override through the --with-pkgconfigdir
+# parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+    [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_INSTALLDIR
+
+
+# PKG_NOARCH_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable noarch_pkgconfigdir as the location where a
+# module should install arch-independent pkg-config .pc files. By
+# default the directory is $datadir/pkgconfig, but the default can be
+# changed by passing DIRECTORY. The user can override through the
+# --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+    [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_NOARCH_INSTALLDIR
+
+
+# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------
+# Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
 
-dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
-AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
-[
-  XGETTEXT_EXTRA_OPTIONS=
-])
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
 
-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"
-])
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])# PKG_CHECK_VAR
 
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -639,10 +247,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.11'
+[am__api_version='1.13'
 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.11.1], [],
+m4_if([$1], [1.13.4], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -658,22 +266,22 @@ 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.11.1])dnl
+[AM_AUTOMAKE_VERSION([1.13.4])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 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.
 
 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
 #
 # Of course, Automake must honor this variable whenever it calls a
 # tool from the auxiliary directory.  The problem is that $srcdir (and
@@ -692,7 +300,7 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 #
 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
 # are both prefixed by $srcdir.  In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
+# harmless because $srcdir is '.', but things will broke when you
 # start a VPATH build or use an absolute $srcdir.
 #
 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
@@ -718,22 +326,19 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2013 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 9
-
 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
 # -------------------------------------
 # Define a conditional.
 AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
-       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+[AC_PREREQ([2.52])dnl
m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
 AC_SUBST([$1_TRUE])dnl
 AC_SUBST([$1_FALSE])dnl
 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
@@ -752,16 +357,14 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 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 10
 
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
 # will think it sees a *use*, and therefore will trigger all it's
 # C support machinery.  Also note that it means that autoscan, seeing
@@ -771,7 +374,7 @@ fi])])
 # _AM_DEPENDENCIES(NAME)
 # ----------------------
 # See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
 # We try a few techniques and use that to set a single cache variable.
 #
 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
@@ -784,12 +387,13 @@ AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
 AC_REQUIRE([AM_DEP_TRACK])dnl
 
-ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
-       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
-       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
-       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
-       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
-                   [depcc="$$1"   am_compiler_list=])
+m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
+      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
+      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
+      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                    [depcc="$$1"   am_compiler_list=])
 
 AC_CACHE_CHECK([dependency style of $depcc],
                [am_cv_$1_dependencies_compiler_type],
@@ -797,8 +401,9 @@ AC_CACHE_CHECK([dependency style of $depcc],
   # 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'.
+  # 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.
@@ -837,16 +442,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
     : > 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 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # 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"
+    # 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
+    # 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
@@ -855,16 +460,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
       test "$am__universal" = false || continue
       ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # 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
       ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+    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}
@@ -912,7 +517,7 @@ AM_CONDITIONAL([am__fastdep$1], [
 # AM_SET_DEPDIR
 # -------------
 # Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
 AC_DEFUN([AM_SET_DEPDIR],
 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
@@ -922,34 +527,39 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
 # AM_DEP_TRACK
 # ------------
 AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors])
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+  [--enable-dependency-tracking],
+  [do not reject slow dependency extractors])
+AS_HELP_STRING(
+  [--disable-dependency-tracking],
+  [speeds up one-time build])])
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
+  am__nodep='_no'
 fi
 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
 AC_SUBST([AMDEPBACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
 ])
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 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 5
 
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 [{
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # 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
@@ -962,7 +572,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
     # 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
+    # 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.
@@ -974,21 +584,19 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
       continue
     fi
     # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running `make'.
+    # 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
+    test -z "$am__include" && continue
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # When using ansi2knr, U may be empty or an underscore; expand it
-    U=`sed -n 's/^U = //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' -e 's/\$U/'"$U"'/g'`; do
+        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
       # Make sure the directory exists.
       test -f "$dirpart/$file" && continue
       fdir=`AS_DIRNAME(["$file"])`
@@ -1006,7 +614,7 @@ 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
+# is enabled.  FIXME.  This creates each '.P' file that we will
 # need in order to bootstrap the dependency handling code.
 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 [AC_CONFIG_COMMANDS([depfiles],
@@ -1014,29 +622,14 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
 ])
 
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
-# 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 8
-
-# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
-AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
-
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 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 16
-
 # This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
 
@@ -1052,7 +645,7 @@ AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
 # arguments mandatory, and then we can depend on a new Autoconf
 # release and drop the old call support.
 AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.62])dnl
+[AC_PREREQ([2.65])dnl
 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
 dnl the ones we care about.
 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -1081,31 +674,40 @@ AC_SUBST([CYGPATH_W])
 # Define the identity of the package.
 dnl Distinguish between old-style and new-style calls.
 m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+[AC_DIAGNOSE([obsolete],
+             [$0: two- and three-arguments forms are deprecated.])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
  AC_SUBST([PACKAGE], [$1])dnl
  AC_SUBST([VERSION], [$2])],
 [_AM_SET_OPTIONS([$1])dnl
 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+m4_if(
+  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+  [ok:ok],,
   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
 
 _AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
 
 # Some tools Automake needs.
 AC_REQUIRE([AM_SANITY_CHECK])dnl
 AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
-AC_REQUIRE([AM_PROG_MKDIR_P])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>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
 AC_REQUIRE([AC_PROG_AWK])dnl
@@ -1116,28 +718,32 @@ _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
                             [_AM_PROG_TAR([v7])])])
 _AM_IF_OPTION([no-dependencies],,
 [AC_PROVIDE_IFELSE([AC_PROG_CC],
-                 [_AM_DEPENDENCIES(CC)],
-                 [define([AC_PROG_CC],
-                         defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+                 [_AM_DEPENDENCIES([CC])],
+                 [m4_define([AC_PROG_CC],
+                            m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
 AC_PROVIDE_IFELSE([AC_PROG_CXX],
-                 [_AM_DEPENDENCIES(CXX)],
-                 [define([AC_PROG_CXX],
-                         defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+                 [_AM_DEPENDENCIES([CXX])],
+                 [m4_define([AC_PROG_CXX],
+                            m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
-                 [_AM_DEPENDENCIES(OBJC)],
-                 [define([AC_PROG_OBJC],
-                         defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+                 [_AM_DEPENDENCIES([OBJC])],
+                 [m4_define([AC_PROG_OBJC],
+                            m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+                 [_AM_DEPENDENCIES([OBJCXX])],
+                 [m4_define([AC_PROG_OBJCXX],
+                            m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
 ])
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
-dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
 AC_CONFIG_COMMANDS_PRE(dnl
 [m4_provide_if([_AM_COMPILER_EXEEXT],
   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
 ])
 
-dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
 dnl mangled by Autoconf and run in a shell conditional statement.
 m4_define([_AC_COMPILER_EXEEXT],
@@ -1165,7 +771,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, 2003, 2005, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1184,16 +790,14 @@ if test x"${install_sh}" != xset; then
     install_sh="\${SHELL} $am_aux_dir/install-sh"
   esac
 fi
-AC_SUBST(install_sh)])
+AC_SUBST([install_sh])])
 
-# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2003-2013 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 2
-
 # Check whether the underlying file-system supports filenames
 # with a leading dot.  For instance MS-DOS doesn't.
 AC_DEFUN([AM_SET_LEADING_DOT],
@@ -1209,14 +813,12 @@ AC_SUBST([am__leading_dot])])
 
 # Check to see how 'make' treats includes.                 -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 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 4
-
 # AM_MAKE_INCLUDE()
 # -----------------
 # Check to see how make treats includes.
@@ -1234,7 +836,7 @@ am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# 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
@@ -1261,15 +863,12 @@ rm -f confinc confmf
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2013 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 6
-
 # AM_MISSING_PROG(NAME, PROGRAM)
 # ------------------------------
 AC_DEFUN([AM_MISSING_PROG],
@@ -1277,11 +876,10 @@ AC_DEFUN([AM_MISSING_PROG],
 $1=${$1-"${am_missing_run}$2"}
 AC_SUBST($1)])
 
-
 # AM_MISSING_HAS_RUN
 # ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
 AC_DEFUN([AM_MISSING_HAS_RUN],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 AC_REQUIRE_AUX_FILE([missing])dnl
@@ -1294,63 +892,64 @@ if test x"${MISSING+set}" != xset; then
   esac
 fi
 # Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
 else
   am_missing_run=
-  AC_MSG_WARN([`missing' script is too old or missing])
+  AC_MSG_WARN(['missing' script is too old or missing])
 fi
 ])
 
-# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+#  -*- Autoconf -*-
+# Obsolete and "removed" macros, that must however still report explicit
+# error messages when used, to smooth transition.
+#
+# Copyright (C) 1996-2013 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_MKDIR_P
-# ---------------
-# Check for `mkdir -p'.
-AC_DEFUN([AM_PROG_MKDIR_P],
-[AC_PREREQ([2.60])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
-dnl while keeping a definition of mkdir_p for backward compatibility.
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
-dnl adjustment using top_builddir (which is defined more often than
-dnl MKDIR_P).
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
-case $mkdir_p in
-  [[\\/$]]* | ?:[[\\/]]*) ;;
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-])
+AC_DEFUN([AM_CONFIG_HEADER],
+[AC_DIAGNOSE([obsolete],
+['$0': this macro is obsolete.
+You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl
+AC_CONFIG_HEADERS($@)])
+
+AC_DEFUN([AM_PROG_CC_STDC],
+[AC_PROG_CC
+am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
+AC_DIAGNOSE([obsolete],
+['$0': this macro is obsolete.
+You should simply use the 'AC][_PROG_CC' macro instead.
+Also, your code should no longer depend upon 'am_cv_prog_cc_stdc',
+but upon 'ac_cv_prog_cc_stdc'.])])
+
+AC_DEFUN([AM_C_PROTOTYPES],
+         [AC_FATAL([automatic de-ANSI-fication support has been removed])])
+AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 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 4
-
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
 AC_DEFUN([_AM_MANGLE_OPTION],
 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
 
 # _AM_SET_OPTION(NAME)
-# ------------------------------
+# --------------------
 # Set option NAME.  Presently that only means defining a flag for this option.
 AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
 
 # _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
+# ------------------------
 # OPTIONS is a space-separated list of Automake options.
 AC_DEFUN([_AM_SET_OPTIONS],
 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
@@ -1363,22 +962,16 @@ AC_DEFUN([_AM_IF_OPTION],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 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 5
-
 # AM_SANITY_CHECK
 # ---------------
 AC_DEFUN([AM_SANITY_CHECK],
 [AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
 # Reject unsafe characters in $srcdir or the absolute working directory
 # name.  Accept space and tab only in the latter.
 am_lf='
@@ -1389,32 +982,40 @@ case `pwd` in
 esac
 case $srcdir in
   *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
-    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
 esac
 
-# Do `set' in a subshell so we don't clobber the current shell's
+# Do 'set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
-   if test "$[*]" = "X"; then
-      # -L didn't work.
-      set X `ls -t "$srcdir/configure" conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$[*]" != "X $srcdir/configure conftest.file" \
-      && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
-alias in your environment])
-   fi
-
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$[*]" = "X"; then
+       # -L didn't work.
+       set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$[*]" != "X $srcdir/configure conftest.file" \
+       && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+       # If neither matched, then we have a broken ls.  This can happen
+       # if, for instance, CONFIG_SHELL is bash and it inherits a
+       # broken ls alias from the environment.  This has actually
+       # happened.  Such a system could not be considered "sane".
+       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment])
+     fi
+     if test "$[2]" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
    test "$[2]" = conftest.file
    )
 then
@@ -1424,36 +1025,85 @@ else
    AC_MSG_ERROR([newly created file is older than distributed files!
 Check your system clock])
 fi
-AC_MSG_RESULT(yes)])
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+  [AC_MSG_CHECKING([that generated files are newer than configure])
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
 
-# Copyright (C) 2009  Free Software Foundation, Inc.
+# Copyright (C) 2009-2013 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 1
-
 # AM_SILENT_RULES([DEFAULT])
 # --------------------------
 # Enable less verbose build rules; with the default set to DEFAULT
-# (`yes' being less verbose, `no' or empty being verbose).
+# ("yes" being less verbose, "no" or empty being verbose).
 AC_DEFUN([AM_SILENT_RULES],
-[AC_ARG_ENABLE([silent-rules],
-[  --enable-silent-rules          less verbose build output (undo: `make V=1')
-  --disable-silent-rules         verbose build output (undo: `make V=0')])
-case $enable_silent_rules in
-yes) AM_DEFAULT_VERBOSITY=0;;
-no)  AM_DEFAULT_VERBOSITY=1;;
-*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+  [--enable-silent-rules],
+  [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+  [--disable-silent-rules],
+  [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
 esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+   [am_cv_make_support_nested_variables],
+   [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+       @$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+  dnl Using '$V' instead of '$(V)' breaks IRIX make.
+  AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
 AM_BACKSLASH='\'
 AC_SUBST([AM_BACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1461,34 +1111,32 @@ _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 
 # AM_PROG_INSTALL_STRIP
 # ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
+# One issue with vendor 'install' (even GNU) is that you can't
 # specify the program used to strip binaries.  This is especially
 # annoying in cross-compiling environments, where the build's strip
 # is unlikely to handle the host's binaries.
 # Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
+# always use install-sh in "make install-strip", and initialize
 # STRIPPROG with the value of the STRIP variable (set by the user).
 AC_DEFUN([AM_PROG_INSTALL_STRIP],
 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
 # tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
 if test "$cross_compiling" != no; then
   AC_CHECK_TOOL([STRIP], [strip], :)
 fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2006-2013 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 2
-
 # _AM_SUBST_NOTMAKE(VARIABLE)
 # ---------------------------
 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
@@ -1496,24 +1144,22 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
 AC_DEFUN([_AM_SUBST_NOTMAKE])
 
 # AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
+# --------------------------
 # Public sister of _AM_SUBST_NOTMAKE.
 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2004-2013 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 2
-
 # _AM_PROG_TAR(FORMAT)
 # --------------------
 # Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
 #
 # Substitute a variable $(am__tar) that is a command
 # writing to stdout a FORMAT-tarball containing the directory
@@ -1523,75 +1169,114 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 # Substitute a variable $(am__untar) that extract such
 # a tarball read from stdin.
 #     $(am__untar) < result.tar
+#
 AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [tar])
-m4_if([$1], [v7],
-     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
-     [m4_case([$1], [ustar],, [pax],,
-              [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
+[# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+
+# We'll loop over all known methods to create a tar archive until one works.
 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
-  case $_am_tool in
-  gnutar)
-    for _am_tar in tar gnutar gtar;
-    do
-      AM_RUN_LOG([$_am_tar --version]) && break
-    done
-    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
-    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
-    am__untar="$_am_tar -xf -"
-    ;;
-  plaintar)
-    # Must skip GNU tar: if it does not support --format= it doesn't create
-    # ustar tarball either.
-    (tar --version) >/dev/null 2>&1 && continue
-    am__tar='tar chf - "$$tardir"'
-    am__tar_='tar chf - "$tardir"'
-    am__untar='tar xf -'
-    ;;
-  pax)
-    am__tar='pax -L -x $1 -w "$$tardir"'
-    am__tar_='pax -L -x $1 -w "$tardir"'
-    am__untar='pax -r'
-    ;;
-  cpio)
-    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
-    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
-    am__untar='cpio -i -H $1 -d'
-    ;;
-  none)
-    am__tar=false
-    am__tar_=false
-    am__untar=false
-    ;;
-  esac
 
-  # If the value was cached, stop now.  We just wanted to have am__tar
-  # and am__untar set.
-  test -n "${am_cv_prog_tar_$1}" && break
+m4_if([$1], [v7],
+  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+  [m4_case([$1],
+    [ustar],
+     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+      # There is notably a 21 bits limit for the UID and the GID.  In fact,
+      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+      # and bug#13588).
+      am_max_uid=2097151 # 2^21 - 1
+      am_max_gid=$am_max_uid
+      # The $UID and $GID variables are not portable, so we need to resort
+      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
+      # below are definitely unexpected, so allow the users to see them
+      # (that is, avoid stderr redirection).
+      am_uid=`id -u || echo unknown`
+      am_gid=`id -g || echo unknown`
+      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+      if test $am_uid -le $am_max_uid; then
+         AC_MSG_RESULT([yes])
+      else
+         AC_MSG_RESULT([no])
+         _am_tools=none
+      fi
+      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+      if test $am_gid -le $am_max_gid; then
+         AC_MSG_RESULT([yes])
+      else
+        AC_MSG_RESULT([no])
+        _am_tools=none
+      fi],
+
+  [pax],
+    [],
 
-  # tar/untar a dummy directory, and stop if the command works
-  rm -rf conftest.dir
-  mkdir conftest.dir
-  echo GrepMe > conftest.dir/file
-  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  [m4_fatal([Unknown tar format])])
+
+  AC_MSG_CHECKING([how to create a $1 tar archive])
+
+  # Go ahead even if we have the value already cached.  We do so because we
+  # need to set the values for the 'am__tar' and 'am__untar' variables.
+  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+  for _am_tool in $_am_tools; do
+    case $_am_tool in
+    gnutar)
+      for _am_tar in tar gnutar gtar; do
+        AM_RUN_LOG([$_am_tar --version]) && break
+      done
+      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+      am__untar="$_am_tar -xf -"
+      ;;
+    plaintar)
+      # Must skip GNU tar: if it does not support --format= it doesn't create
+      # ustar tarball either.
+      (tar --version) >/dev/null 2>&1 && continue
+      am__tar='tar chf - "$$tardir"'
+      am__tar_='tar chf - "$tardir"'
+      am__untar='tar xf -'
+      ;;
+    pax)
+      am__tar='pax -L -x $1 -w "$$tardir"'
+      am__tar_='pax -L -x $1 -w "$tardir"'
+      am__untar='pax -r'
+      ;;
+    cpio)
+      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+      am__untar='cpio -i -H $1 -d'
+      ;;
+    none)
+      am__tar=false
+      am__tar_=false
+      am__untar=false
+      ;;
+    esac
+
+    # If the value was cached, stop now.  We just wanted to have am__tar
+    # and am__untar set.
+    test -n "${am_cv_prog_tar_$1}" && break
+
+    # tar/untar a dummy directory, and stop if the command works.
+    rm -rf conftest.dir
+    mkdir conftest.dir
+    echo GrepMe > conftest.dir/file
+    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+    rm -rf conftest.dir
+    if test -s conftest.tar; then
+      AM_RUN_LOG([$am__untar <conftest.tar])
+      AM_RUN_LOG([cat conftest.dir/file])
+      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+    fi
+  done
   rm -rf conftest.dir
-  if test -s conftest.tar; then
-    AM_RUN_LOG([$am__untar <conftest.tar])
-    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
-  fi
-done
-rm -rf conftest.dir
 
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
 AC_SUBST([am__tar])
 AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
@@ -1601,6 +1286,7 @@ m4_include([gnulib/m4/alloca.m4])
 m4_include([gnulib/m4/argz.m4])
 m4_include([gnulib/m4/btowc.m4])
 m4_include([gnulib/m4/canonicalize.m4])
+m4_include([gnulib/m4/close.m4])
 m4_include([gnulib/m4/codeset.m4])
 m4_include([gnulib/m4/configmake.m4])
 m4_include([gnulib/m4/ctype.m4])
@@ -1609,24 +1295,33 @@ m4_include([gnulib/m4/dup2.m4])
 m4_include([gnulib/m4/eealloc.m4])
 m4_include([gnulib/m4/environ.m4])
 m4_include([gnulib/m4/errno_h.m4])
+m4_include([gnulib/m4/exponentd.m4])
 m4_include([gnulib/m4/extensions.m4])
 m4_include([gnulib/m4/fcntl-o.m4])
 m4_include([gnulib/m4/fcntl_h.m4])
+m4_include([gnulib/m4/fdopen.m4])
 m4_include([gnulib/m4/float_h.m4])
 m4_include([gnulib/m4/fnmatch.m4])
+m4_include([gnulib/m4/fpieee.m4])
+m4_include([gnulib/m4/fstat.m4])
+m4_include([gnulib/m4/getcwd.m4])
 m4_include([gnulib/m4/getdelim.m4])
 m4_include([gnulib/m4/getline.m4])
 m4_include([gnulib/m4/getopt.m4])
 m4_include([gnulib/m4/getpagesize.m4])
+m4_include([gnulib/m4/gettimeofday.m4])
 m4_include([gnulib/m4/glibc21.m4])
 m4_include([gnulib/m4/gnulib-common.m4])
 m4_include([gnulib/m4/gnulib-comp.m4])
 m4_include([gnulib/m4/include_next.m4])
 m4_include([gnulib/m4/intlmacosx.m4])
 m4_include([gnulib/m4/intmax_t.m4])
+m4_include([gnulib/m4/inttypes-pri.m4])
+m4_include([gnulib/m4/inttypes.m4])
 m4_include([gnulib/m4/inttypes_h.m4])
 m4_include([gnulib/m4/isblank.m4])
 m4_include([gnulib/m4/langinfo_h.m4])
+m4_include([gnulib/m4/largefile.m4])
 m4_include([gnulib/m4/lcmessage.m4])
 m4_include([gnulib/m4/lib-ld.m4])
 m4_include([gnulib/m4/lib-link.m4])
@@ -1638,6 +1333,7 @@ m4_include([gnulib/m4/locale-ja.m4])
 m4_include([gnulib/m4/locale-tr.m4])
 m4_include([gnulib/m4/locale-zh.m4])
 m4_include([gnulib/m4/locale_h.m4])
+m4_include([gnulib/m4/localeconv.m4])
 m4_include([gnulib/m4/localename.m4])
 m4_include([gnulib/m4/lock.m4])
 m4_include([gnulib/m4/longlong.m4])
@@ -1655,15 +1351,21 @@ m4_include([gnulib/m4/mbstate_t.m4])
 m4_include([gnulib/m4/mbtowc.m4])
 m4_include([gnulib/m4/memchr.m4])
 m4_include([gnulib/m4/mempcpy.m4])
+m4_include([gnulib/m4/mkstemp.m4])
 m4_include([gnulib/m4/mmap-anon.m4])
 m4_include([gnulib/m4/mode_t.m4])
+m4_include([gnulib/m4/msvc-inval.m4])
+m4_include([gnulib/m4/msvc-nothrow.m4])
 m4_include([gnulib/m4/multiarch.m4])
 m4_include([gnulib/m4/nl_langinfo.m4])
+m4_include([gnulib/m4/nocrash.m4])
+m4_include([gnulib/m4/off_t.m4])
 m4_include([gnulib/m4/onceonly.m4])
 m4_include([gnulib/m4/open.m4])
 m4_include([gnulib/m4/pathmax.m4])
 m4_include([gnulib/m4/printf.m4])
 m4_include([gnulib/m4/putenv.m4])
+m4_include([gnulib/m4/rawmemchr.m4])
 m4_include([gnulib/m4/readlink.m4])
 m4_include([gnulib/m4/realloc.m4])
 m4_include([gnulib/m4/regex.m4])
@@ -1683,13 +1385,18 @@ m4_include([gnulib/m4/stdio_h.m4])
 m4_include([gnulib/m4/stdlib_h.m4])
 m4_include([gnulib/m4/stpcpy.m4])
 m4_include([gnulib/m4/stpncpy.m4])
+m4_include([gnulib/m4/strchrnul.m4])
 m4_include([gnulib/m4/string_h.m4])
 m4_include([gnulib/m4/strndup.m4])
 m4_include([gnulib/m4/strnlen.m4])
 m4_include([gnulib/m4/strstr.m4])
 m4_include([gnulib/m4/symlink.m4])
+m4_include([gnulib/m4/sys_socket_h.m4])
 m4_include([gnulib/m4/sys_stat_h.m4])
+m4_include([gnulib/m4/sys_time_h.m4])
+m4_include([gnulib/m4/sys_types_h.m4])
 m4_include([gnulib/m4/sys_wait_h.m4])
+m4_include([gnulib/m4/tempname.m4])
 m4_include([gnulib/m4/thread.m4])
 m4_include([gnulib/m4/threadlib.m4])
 m4_include([gnulib/m4/time_h.m4])
index c97847d..9e166db 100644 (file)
@@ -6,6 +6,6 @@ includedir=@includedir@
 Name: augeas
 Version: @VERSION@
 Description: Augeas configuration editing library
-Requires:
+Requires.private: libxml-2.0
 Libs: -L${libdir} -laugeas @LIBS@
 Cflags: -I${includedir}
index a9b75d8..f23f4c0 100644 (file)
@@ -1,16 +1,18 @@
 Name:           augeas
-Version:        0.10.0
+Version:        1.3.0
 Release:        1%{?dist}
 Summary:        A library for changing configuration files
 
 Group:          System Environment/Libraries
 License:        LGPLv2+
 URL:            http://augeas.net/
-Source0:        http://augeas.net/download/%{name}-%{version}.tar.gz
+Source0:        http://download.augeas.net/%{name}-%{version}.tar.gz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  readline-devel libselinux-devel libxml2-devel
 Requires:       %{name}-libs = %{version}-%{release}
+# Bundling exception for gnulib: https://fedorahosted.org/fpc/ticket/174
+Provides:       bundled(gnulib)
 
 %description
 A library for programmatically editing configuration files. Augeas parses
@@ -40,6 +42,10 @@ Group:          System Environment/Libraries
 %description    libs
 The libraries for %{name}.
 
+Augeas is a library for programmatically editing configuration files. It parses
+configuration files into a tree structure, which it exposes through its
+public API. Changes made through the API are written back to the initially
+read files.
 
 %prep
 %setup -q
@@ -48,11 +54,26 @@ The libraries for %{name}.
 %configure --disable-static
 make %{?_smp_mflags}
 
+%check
+# Disable test-preserve.sh SELinux testing. This fails when run under mock due
+# to differing SELinux labelling.
+export SKIP_TEST_PRESERVE_SELINUX=1
+
+make %{?_smp_mflags} check || {
+  echo '===== tests/test-suite.log ====='
+  cat tests/test-suite.log
+  exit 1
+}
+
 %install
 rm -rf $RPM_BUILD_ROOT
 make install DESTDIR=$RPM_BUILD_ROOT INSTALL="%{__install} -p"
 find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
 
+# The tests/ subdirectory contains lenses used only for testing, and
+# so it shouldn't be packaged.
+rm -r $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/dist/tests
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -85,6 +106,17 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/pkgconfig/augeas.pc
 
 %changelog
+* Tue Oct 15 2013 Dominic Cleal <dcleal@redhat.com> - 1.1.0-2
+- Add %check stage to run make check (rjones@redhat.com)
+- Don't package lenses in tests/ subdirectory (rjones@redhat.com)
+- Fix source URL to download.augeas.net (RHBZ#996033)
+
+* Fri Jun 14 2013 David Lutterkort <lutter@watzmann.net> - 1.1.0-1
+- New version
+
+* Fri Dec 21 2012 David Lutterkort <lutter@redhat.com> - 1.0.0-1
+- New version
+
 * Fri Dec  2 2011 David Lutterkort <lutter@redhat.com> - 0.10.0-1
 - New version
 
index 21debb2..5a829e2 100644 (file)
@@ -6,11 +6,13 @@ Summary:        A library for changing configuration files
 Group:          System Environment/Libraries
 License:        LGPLv2+
 URL:            http://augeas.net/
-Source0:        http://augeas.net/download/%{name}-%{version}.tar.gz
+Source0:        http://download.augeas.net/%{name}-%{version}.tar.gz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  readline-devel libselinux-devel libxml2-devel
 Requires:       %{name}-libs = %{version}-%{release}
+# Bundling exception for gnulib: https://fedorahosted.org/fpc/ticket/174
+Provides:       bundled(gnulib)
 
 %description
 A library for programmatically editing configuration files. Augeas parses
@@ -40,6 +42,10 @@ Group:          System Environment/Libraries
 %description    libs
 The libraries for %{name}.
 
+Augeas is a library for programmatically editing configuration files. It parses
+configuration files into a tree structure, which it exposes through its
+public API. Changes made through the API are written back to the initially
+read files.
 
 %prep
 %setup -q
@@ -48,11 +54,26 @@ The libraries for %{name}.
 %configure --disable-static
 make %{?_smp_mflags}
 
+%check
+# Disable test-preserve.sh SELinux testing. This fails when run under mock due
+# to differing SELinux labelling.
+export SKIP_TEST_PRESERVE_SELINUX=1
+
+make %{?_smp_mflags} check || {
+  echo '===== tests/test-suite.log ====='
+  cat tests/test-suite.log
+  exit 1
+}
+
 %install
 rm -rf $RPM_BUILD_ROOT
 make install DESTDIR=$RPM_BUILD_ROOT INSTALL="%{__install} -p"
 find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
 
+# The tests/ subdirectory contains lenses used only for testing, and
+# so it shouldn't be packaged.
+rm -r $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/dist/tests
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -85,6 +106,17 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/pkgconfig/augeas.pc
 
 %changelog
+* Tue Oct 15 2013 Dominic Cleal <dcleal@redhat.com> - 1.1.0-2
+- Add %check stage to run make check (rjones@redhat.com)
+- Don't package lenses in tests/ subdirectory (rjones@redhat.com)
+- Fix source URL to download.augeas.net (RHBZ#996033)
+
+* Fri Jun 14 2013 David Lutterkort <lutter@watzmann.net> - 1.1.0-1
+- New version
+
+* Fri Dec 21 2012 David Lutterkort <lutter@redhat.com> - 1.0.0-1
+- New version
+
 * Fri Dec  2 2011 David Lutterkort <lutter@redhat.com> - 0.10.0-1
 - New version
 
diff --git a/build/ac-aux/compile b/build/ac-aux/compile
new file mode 100755 (executable)
index 0000000..531136b
--- /dev/null
@@ -0,0 +1,347 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2012-10-14.11; # UTC
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.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, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# 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>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""       $nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+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/,$2, in
+       *,$file_conv,*)
+         ;;
+       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_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+  func_file_conv "$1"
+  if test -z "$lib_path"; then
+    lib_path=$file
+  else
+    lib_path="$lib_path;$file"
+  fi
+  linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+  lib=$1
+  found=no
+  save_IFS=$IFS
+  IFS=';'
+  for dir in $lib_path $LIB
+  do
+    IFS=$save_IFS
+    if $shared && test -f "$dir/$lib.dll.lib"; then
+      found=yes
+      lib=$dir/$lib.dll.lib
+      break
+    fi
+    if test -f "$dir/$lib.lib"; then
+      found=yes
+      lib=$dir/$lib.lib
+      break
+    fi
+    if test -f "$dir/lib$lib.a"; then
+      found=yes
+      lib=$dir/lib$lib.a
+      break
+    fi
+  done
+  IFS=$save_IFS
+
+  if test "$found" != yes; then
+    lib=$lib.lib
+  fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+  # Assume a capable shell
+  lib_path=
+  shared=:
+  linker_opts=
+  for arg
+  do
+    if test -n "$eat"; then
+      eat=
+    else
+      case $1 in
+       -o)
+         # configure might choose to run compile as 'compile cc -o foo foo.c'.
+         eat=1
+         case $2 in
+           *.o | *.[oO][bB][jJ])
+             func_file_conv "$2"
+             set x "$@" -Fo"$file"
+             shift
+             ;;
+           *)
+             func_file_conv "$2"
+             set x "$@" -Fe"$file"
+             shift
+             ;;
+         esac
+         ;;
+       -I)
+         eat=1
+         func_file_conv "$2" mingw
+         set x "$@" -I"$file"
+         shift
+         ;;
+       -I*)
+         func_file_conv "${1#-I}" mingw
+         set x "$@" -I"$file"
+         shift
+         ;;
+       -l)
+         eat=1
+         func_cl_dashl "$2"
+         set x "$@" "$lib"
+         shift
+         ;;
+       -l*)
+         func_cl_dashl "${1#-l}"
+         set x "$@" "$lib"
+         shift
+         ;;
+       -L)
+         eat=1
+         func_cl_dashL "$2"
+         ;;
+       -L*)
+         func_cl_dashL "${1#-L}"
+         ;;
+       -static)
+         shared=false
+         ;;
+       -Wl,*)
+         arg=${1#-Wl,}
+         save_ifs="$IFS"; IFS=','
+         for flag in $arg; do
+           IFS="$save_ifs"
+           linker_opts="$linker_opts $flag"
+         done
+         IFS="$save_ifs"
+         ;;
+       -Xlinker)
+         eat=1
+         linker_opts="$linker_opts $2"
+         ;;
+       -*)
+         set x "$@" "$1"
+         shift
+         ;;
+       *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+         func_file_conv "$1"
+         set x "$@" -Tp"$file"
+         shift
+         ;;
+       *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+         func_file_conv "$1" mingw
+         set x "$@" "$file"
+         shift
+         ;;
+       *)
+         set x "$@" "$1"
+         shift
+         ;;
+      esac
+    fi
+    shift
+  done
+  if test -n "$linker_opts"; then
+    linker_opts="-link$linker_opts"
+  fi
+  exec "$@" $linker_opts
+  exit 1
+}
+
+eat=
+
+case $1 in
+  '')
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit $?
+    ;;
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+    func_cl_wrapper "$@"      # Doesn't return...
+    ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+       # configure might choose to run compile as 'compile cc -o foo foo.c'.
+       # So we strip '-o arg' only if arg is an object.
+       eat=1
+       case $2 in
+         *.o | *.obj)
+           ofile=$2
+           ;;
+         *)
+           set x "$@" -o "$2"
+           shift
+           ;;
+       esac
+       ;;
+      *.c)
+       cfile=$1
+       set x "$@" "$1"
+       shift
+       ;;
+      *)
+       set x "$@" "$1"
+       shift
+       ;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no '-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # '.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
similarity index 62%
rename from build/aux/config.guess
rename to build/ac-aux/config.guess
index 0e30d56..1f5c50c 100755 (executable)
@@ -1,13 +1,12 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+#   Copyright 1992-2014 Free Software Foundation, Inc.
 
-timestamp='2003-07-02'
+timestamp='2014-03-23'
 
 # 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 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful, but
@@ -16,24 +15,22 @@ timestamp='2003-07-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, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# 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.
-
-# Originally written by Per Bothner <per@bothner.com>.
-# Please send patches to <config-patches@gnu.org>.  Submit a context
-# diff and a properly formatted ChangeLog entry.
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+#
+# Originally written by Per Bothner.
 #
-# This script attempts to guess a canonical system name similar to
-# config.sub.  If it succeeds, it prints the system name on stdout, and
-# exits with 0.  Otherwise, it exits with 1.
+# 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;hb=HEAD
 #
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+
 
 me=`echo "$0" | sed -e 's,.*/,,'`
 
@@ -53,8 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
+Copyright 1992-2014 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."
@@ -66,11 +62,11 @@ Try \`$me --help' for more information."
 while test $# -gt 0 ; do
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
+       echo "$timestamp" ; exit ;;
     --version | -v )
-       echo "$version" ; exit ;;
+       echo "$version" ; exit ;;
     --help | --h* | -h )
-       echo "$usage"; exit ;;
+       echo "$usage"; exit ;;
     -- )     # Stop option processing
        shift; break ;;
     - )        # Use stdin as input.
@@ -104,7 +100,7 @@ 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 -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$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 ; } ;
@@ -123,7 +119,7 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in
        ;;
  ,,*)   CC_FOR_BUILD=$CC ;;
  ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ;'
+esac ; set_cc_for_build= ;'
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi@noc.rutgers.edu 1994-08-24)
@@ -136,12 +132,33 @@ 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
+Linux|GNU|GNU/*)
+       # If the system lacks a compiler, then just pick glibc.
+       # We could probably try harder.
+       LIBC=gnu
+
+       eval $set_cc_for_build
+       cat <<-EOF > $dummy.c
+       #include <features.h>
+       #if defined(__UCLIBC__)
+       LIBC=uclibc
+       #elif defined(__dietlibc__)
+       LIBC=dietlibc
+       #else
+       LIBC=gnu
+       #endif
+       EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+       ;;
+esac
+
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     *:NetBSD:*:*)
        # NetBSD (nbsd) targets should (where applicable) match one or
-       # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+       # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
        # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
        # switched to ELF, *-*-netbsd* would select the old
        # object file format.  This provides both forward
@@ -158,6 +175,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
            arm*) machine=arm-unknown ;;
            sh3el) machine=shl-unknown ;;
            sh3eb) machine=sh-unknown ;;
+           sh5el) machine=sh5le-unknown ;;
            *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
        esac
        # The Operating System including object format, if it has switched
@@ -166,7 +184,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
            arm*|i386|m68k|ns32k|sh3*|sparc|vax)
                eval $set_cc_for_build
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
-                       | grep __ELF__ >/dev/null
+                       | grep -q __ELF__
                then
                    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
                    # Return netbsd for either.  FIX?
@@ -176,7 +194,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                fi
                ;;
            *)
-               os=netbsd
+               os=netbsd
                ;;
        esac
        # The OS release
@@ -196,50 +214,36 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # contains redundant information, the shorter form:
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
        echo "${machine}-${os}${release}"
-       exit 0 ;;
-    amiga:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    arc:OpenBSD:*:*)
-       echo mipsel-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    hp300:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    mac68k:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    macppc:OpenBSD:*:*)
-       echo powerpc-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    mvme68k:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    mvme88k:OpenBSD:*:*)
-       echo m88k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    mvmeppc:OpenBSD:*:*)
-       echo powerpc-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    pmax:OpenBSD:*:*)
-       echo mipsel-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    sgi:OpenBSD:*:*)
-       echo mipseb-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    sun3:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    wgrisc:OpenBSD:*:*)
-       echo mipsel-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
+       exit ;;
+    *:Bitrig:*:*)
+       UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+       echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+       exit ;;
     *:OpenBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
+       UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+       echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+       exit ;;
+    *:ekkoBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+       exit ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+       exit ;;
+    *:MirBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+       exit ;;
     alpha:OSF1:*:*)
-       if test $UNAME_RELEASE = "V4.0"; then
+       case $UNAME_RELEASE in
+       *4.0)
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
-       fi
+               ;;
+       *5.*)
+               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
@@ -277,42 +281,52 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
            "EV7.9 (21364A)")
                UNAME_MACHINE="alphaev79" ;;
        esac
+       # A Pn.n version is a patched version.
        # A Vn.n version is a released version.
        # 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/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-       exit 0 ;;
-    Alpha*:OpenVMS:*:*)
-       echo alpha-hp-vms
-       exit 0 ;;
+       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 ;;
+       exit ;;
     21064:Windows_NT:50:3)
        echo alpha-dec-winnt3.5
-       exit ;;
+       exit ;;
     Amiga*:UNIX_System_V:4.0:*)
        echo m68k-unknown-sysv4
-       exit 0;;
+       exit ;;
     *:[Aa]miga[Oo][Ss]:*:*)
        echo ${UNAME_MACHINE}-unknown-amigaos
-       exit ;;
+       exit ;;
     *:[Mm]orph[Oo][Ss]:*:*)
        echo ${UNAME_MACHINE}-unknown-morphos
-       exit ;;
+       exit ;;
     *:OS/390:*:*)
        echo i370-ibm-openedition
-       exit 0 ;;
+       exit ;;
+    *:z/VM:*:*)
+       echo s390-ibm-zvmoe
+       exit ;;
+    *:OS400:*:*)
+       echo powerpc-ibm-os400
+       exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
        echo arm-acorn-riscix${UNAME_RELEASE}
-       exit 0;;
+       exit ;;
+    arm*:riscos:*:*|arm*:RISCOS:*:*)
+       echo arm-unknown-riscos
+       exit ;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
        echo hppa1.1-hitachi-hiuxmpp
-       exit 0;;
+       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
@@ -320,32 +334,51 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        else
                echo pyramid-pyramid-bsd
        fi
-       exit ;;
+       exit ;;
     NILE*:*:*:dcosx)
        echo pyramid-pyramid-svr4
-       exit ;;
+       exit ;;
     DRS?6000:unix:4.0:6*)
        echo sparc-icl-nx6
-       exit ;;
-    DRS?6000:UNIX_SV:4.2*:7*)
+       exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
        case `/usr/bin/uname -p` in
-           sparc) echo sparc-icl-nx7 && exit 0 ;;
+           sparc) echo sparc-icl-nx7; exit ;;
        esac ;;
+    s390x:SunOS:*:*)
+       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/[^.]*//'`
-       exit ;;
+       exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit 0 ;;
-    i86pc:SunOS:5.*:*)
-       echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit 0 ;;
+       exit ;;
+    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+       echo i386-pc-auroraux${UNAME_RELEASE}
+       exit ;;
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+       eval $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 (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH="x86_64"
+           fi
+       fi
+       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/[^.]*//'`
-       exit ;;
+       exit ;;
     sun4*:SunOS:*:*)
        case "`/usr/bin/arch -k`" in
            Series*|S4*)
@@ -354,10 +387,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        esac
        # Japanese Language versions have a version number like `4.1.3-JL'.
        echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
-       exit ;;
+       exit ;;
     sun3*:SunOS:*:*)
        echo m68k-sun-sunos${UNAME_RELEASE}
-       exit ;;
+       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
@@ -369,10 +402,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                echo sparc-sun-sunos${UNAME_RELEASE}
                ;;
        esac
-       exit ;;
+       exit ;;
     aushp:SunOS:*:*)
        echo sparc-auspex-sunos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
     # "atarist" or "atariste" at least should have a processor
@@ -382,38 +415,41 @@ 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}
-       exit ;;
+       echo m68k-atari-mint${UNAME_RELEASE}
+       exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
        echo m68k-atari-mint${UNAME_RELEASE}
-        exit 0 ;;
+       exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
-       exit ;;
+       echo m68k-atari-mint${UNAME_RELEASE}
+       exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-        echo m68k-milan-mint${UNAME_RELEASE}
-        exit 0 ;;
+       echo m68k-milan-mint${UNAME_RELEASE}
+       exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-        echo m68k-hades-mint${UNAME_RELEASE}
-        exit 0 ;;
+       echo m68k-hades-mint${UNAME_RELEASE}
+       exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-        echo m68k-unknown-mint${UNAME_RELEASE}
-        exit 0 ;;
+       echo m68k-unknown-mint${UNAME_RELEASE}
+       exit ;;
+    m68k:machten:*:*)
+       echo m68k-apple-machten${UNAME_RELEASE}
+       exit ;;
     powerpc:machten:*:*)
        echo powerpc-apple-machten${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     RISC*:Mach:*:*)
        echo mips-dec-mach_bsd4.3
-       exit ;;
+       exit ;;
     RISC*:ULTRIX:*:*)
        echo mips-dec-ultrix${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     VAX*:ULTRIX*:*:*)
        echo vax-dec-ultrix${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     2020:CLIX:*:* | 2430:CLIX:*:*)
        echo clipper-intergraph-clix${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
        eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
@@ -437,35 +473,36 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
          exit (-1);
        }
 EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c \
-         && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
-         && exit 0
+       $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}
-       exit ;;
+       exit ;;
     Motorola:PowerMAX_OS:*:*)
        echo powerpc-motorola-powermax
-       exit ;;
+       exit ;;
     Motorola:*:4.3:PL8-*)
        echo powerpc-harris-powermax
-       exit ;;
+       exit ;;
     Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
        echo powerpc-harris-powermax
-       exit ;;
+       exit ;;
     Night_Hawk:Power_UNIX:*:*)
        echo powerpc-harris-powerunix
-       exit ;;
+       exit ;;
     m88k:CX/UX:7*:*)
        echo m88k-harris-cxux7
-       exit ;;
+       exit ;;
     m88k:*:4*:R4*)
        echo m88k-motorola-sysv4
-       exit ;;
+       exit ;;
     m88k:*:3*:R3*)
        echo m88k-motorola-sysv3
-       exit ;;
+       exit ;;
     AViiON:dgux:*:*)
-        # DG/UX returns AViiON for all architectures
-        UNAME_PROCESSOR=`/usr/bin/uname -p`
+       # DG/UX returns AViiON for all architectures
+       UNAME_PROCESSOR=`/usr/bin/uname -p`
        if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
        then
            if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
@@ -478,29 +515,29 @@ EOF
        else
            echo i586-dg-dgux${UNAME_RELEASE}
        fi
-       exit ;;
+       exit ;;
     M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
        echo m88k-dolphin-sysv3
-       exit ;;
+       exit ;;
     M88*:*:R3*:*)
        # Delta 88k system running SVR3
        echo m88k-motorola-sysv3
-       exit ;;
+       exit ;;
     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
        echo m88k-tektronix-sysv3
-       exit ;;
+       exit ;;
     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
        echo m68k-tektronix-bsd
-       exit ;;
+       exit ;;
     *:IRIX*:*:*)
        echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
-       exit ;;
+       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 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
+       echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+       exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
     i*86:AIX:*:*)
        echo i386-ibm-aix
-       exit ;;
+       exit ;;
     ia64:AIX:*:*)
        if [ -x /usr/bin/oslevel ] ; then
                IBM_REV=`/usr/bin/oslevel`
@@ -508,7 +545,7 @@ EOF
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
        fi
        echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
-       exit ;;
+       exit ;;
     *:AIX:2:3)
        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
                eval $set_cc_for_build
@@ -523,15 +560,19 @@ EOF
                        exit(0);
                        }
 EOF
-               $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
-               echo rs6000-ibm-aix3.2.5
+               if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+               then
+                       echo "$SYSTEM_NAME"
+               else
+                       echo rs6000-ibm-aix3.2.5
+               fi
        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
                echo rs6000-ibm-aix3.2.4
        else
                echo rs6000-ibm-aix3.2
        fi
-       exit ;;
-    *:AIX:*:[45])
+       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_ARCH=rs6000
@@ -544,28 +585,28 @@ EOF
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
        fi
        echo ${IBM_ARCH}-ibm-aix${IBM_REV}
-       exit ;;
+       exit ;;
     *:AIX:*:*)
        echo rs6000-ibm-aix
-       exit ;;
+       exit ;;
     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
        echo romp-ibm-bsd4.4
-       exit ;;
+       exit ;;
     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
        echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
-       exit 0 ;;                           # report: romp-ibm BSD 4.3
+       exit ;;                             # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
        echo rs6000-bull-bosx
-       exit ;;
+       exit ;;
     DPX/2?00:B.O.S.:*:*)
        echo m68k-bull-sysv3
-       exit ;;
+       exit ;;
     9000/[34]??:4.3bsd:1.*:*)
        echo m68k-hp-bsd
-       exit ;;
+       exit ;;
     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
        echo m68k-hp-bsd4.4
-       exit ;;
+       exit ;;
     9000/[34678]??:HP-UX:*:*)
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
        case "${UNAME_MACHINE}" in
@@ -574,52 +615,52 @@ EOF
            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
-                      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
-                          32) HP_ARCH="hppa2.0n" ;;
-                          64) HP_ARCH="hppa2.0w" ;;
+                   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
+                         32) HP_ARCH="hppa2.0n" ;;
+                         64) HP_ARCH="hppa2.0w" ;;
                          '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
-                        esac ;;
-                    esac
+                       esac ;;
+                   esac
                fi
                if [ "${HP_ARCH}" = "" ]; then
                    eval $set_cc_for_build
-                   sed 's/^              //' << EOF >$dummy.c
+                   sed 's/^            //' << EOF >$dummy.c
 
-              #define _HPUX_SOURCE
-              #include <stdlib.h>
-              #include <unistd.h>
+               #define _HPUX_SOURCE
+               #include <stdlib.h>
+               #include <unistd.h>
 
-              int main ()
-              {
-              #if defined(_SC_KERNEL_BITS)
-                  long bits = sysconf(_SC_KERNEL_BITS);
-              #endif
-                  long cpu  = sysconf (_SC_CPU_VERSION);
+               int main ()
+               {
+               #if defined(_SC_KERNEL_BITS)
+                   long bits = sysconf(_SC_KERNEL_BITS);
+               #endif
+                   long cpu  = sysconf (_SC_CPU_VERSION);
 
-                  switch (cpu)
-               {
-               case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
-               case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
-               case CPU_PA_RISC2_0:
-              #if defined(_SC_KERNEL_BITS)
-                   switch (bits)
-                       {
-                       case 64: puts ("hppa2.0w"); break;
-                       case 32: puts ("hppa2.0n"); break;
-                       default: puts ("hppa2.0"); break;
-                       } break;
-              #else  /* !defined(_SC_KERNEL_BITS) */
-                   puts ("hppa2.0"); break;
-              #endif
-               default: puts ("hppa1.0"); break;
-               }
-                  exit (0);
-              }
+                   switch (cpu)
+                       {
+                       case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+                       case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+                       case CPU_PA_RISC2_0:
+               #if defined(_SC_KERNEL_BITS)
+                           switch (bits)
+                               {
+                               case 64: puts ("hppa2.0w"); break;
+                               case 32: puts ("hppa2.0n"); break;
+                               default: puts ("hppa2.0"); break;
+                               } break;
+               #else  /* !defined(_SC_KERNEL_BITS) */
+                           puts ("hppa2.0"); break;
+               #endif
+                       default: puts ("hppa1.0"); break;
+                       }
+                   exit (0);
+               }
 EOF
                    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
                    test -z "$HP_ARCH" && HP_ARCH=hppa
@@ -627,9 +668,19 @@ EOF
        esac
        if [ ${HP_ARCH} = "hppa2.0w" ]
        then
-           # avoid double evaluation of $set_cc_for_build
-           test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
-           if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+           eval $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
+           # generating 64-bit code.  GNU and HP use different nomenclature:
+           #
+           # $ CC_FOR_BUILD=cc ./config.guess
+           # => hppa2.0w-hp-hpux11.23
+           # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+           # => hppa64-hp-hpux11.23
+
+           if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+               grep -q __LP64__
            then
                HP_ARCH="hppa2.0w"
            else
@@ -637,11 +688,11 @@ EOF
            fi
        fi
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
-       exit ;;
+       exit ;;
     ia64:HP-UX:*:*)
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
        echo ia64-hp-hpux${HPUX_REV}
-       exit ;;
+       exit ;;
     3050*:HI-UX:*:*)
        eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
@@ -669,321 +720,345 @@ EOF
          exit (0);
        }
 EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+       $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+               { echo "$SYSTEM_NAME"; exit; }
        echo unknown-hitachi-hiuxwe2
-       exit ;;
+       exit ;;
     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
        echo hppa1.1-hp-bsd
-       exit ;;
+       exit ;;
     9000/8??:4.3bsd:*:*)
        echo hppa1.0-hp-bsd
-       exit ;;
+       exit ;;
     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
        echo hppa1.0-hp-mpeix
-       exit ;;
+       exit ;;
     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
        echo hppa1.1-hp-osf
-       exit ;;
+       exit ;;
     hp8??:OSF1:*:*)
        echo hppa1.0-hp-osf
-       exit ;;
+       exit ;;
     i*86:OSF1:*:*)
        if [ -x /usr/sbin/sysversion ] ; then
            echo ${UNAME_MACHINE}-unknown-osf1mk
        else
            echo ${UNAME_MACHINE}-unknown-osf1
        fi
-       exit ;;
+       exit ;;
     parisc*:Lites*:*:*)
        echo hppa1.1-hp-lites
-       exit ;;
+       exit ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
        echo c1-convex-bsd
-        exit 0 ;;
+       exit ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
        if getsysinfo -f scalar_acc
        then echo c32-convex-bsd
        else echo c2-convex-bsd
        fi
-        exit 0 ;;
+       exit ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
        echo c34-convex-bsd
-        exit 0 ;;
+       exit ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
        echo c38-convex-bsd
-        exit 0 ;;
+       exit ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
        echo c4-convex-bsd
-        exit 0 ;;
+       exit ;;
     CRAY*Y-MP:*:*:*)
        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit ;;
     CRAY*[A-Z]90:*:*:*)
        echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
        | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
              -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit ;;
     CRAY*TS:*:*:*)
        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit ;;
     CRAY*T3E:*:*:*)
        echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit ;;
     CRAY*SV1:*:*:*)
        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit ;;
     *:UNICOS/mp:*:*)
-       echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 
-       exit ;;
+       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/ /_/'`
-        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit 0 ;;
+       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/ /_/'`
+       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}
-       exit ;;
+       exit ;;
     sparc*:BSD/OS:*:*)
        echo sparc-unknown-bsdi${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:BSD/OS:*:*)
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
-       exit 0 ;;
-    *:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
-       # Determine whether the default compiler uses glibc.
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #include <features.h>
-       #if __GLIBC__ >= 2
-       LIBC=gnu
-       #else
-       LIBC=
-       #endif
-EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
-       # GNU/FreeBSD systems have a "k" prefix to indicate we are using
-       # FreeBSD's kernel, but not the complete OS.
-       case ${LIBC} in gnu) kernel_only='k' ;; esac
-       echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
-       exit 0 ;;
+       exit ;;
+    *:FreeBSD:*:*)
+       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/[-(].*//'` ;;
+       esac
+       exit ;;
     i*:CYGWIN*:*)
        echo ${UNAME_MACHINE}-pc-cygwin
-       exit 0 ;;
-    i*:MINGW*:*)
+       exit ;;
+    *:MINGW64*:*)
+       echo ${UNAME_MACHINE}-pc-mingw64
+       exit ;;
+    *:MINGW*:*)
        echo ${UNAME_MACHINE}-pc-mingw32
-       exit 0 ;;
+       exit ;;
+    *:MSYS*:*)
+       echo ${UNAME_MACHINE}-pc-msys
+       exit ;;
+    i*:windows32*:*)
+       # uname -m includes "-pc" on this system.
+       echo ${UNAME_MACHINE}-mingw32
+       exit ;;
     i*:PW*:*)
        echo ${UNAME_MACHINE}-pc-pw32
-       exit 0 ;;
-    x86:Interix*:[34]*)
-       echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
-       exit 0 ;;
+       exit ;;
+    *:Interix*:*)
+       case ${UNAME_MACHINE} in
+           x86)
+               echo i586-pc-interix${UNAME_RELEASE}
+               exit ;;
+           authenticamd | genuineintel | EM64T)
+               echo x86_64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+           IA64)
+               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 0 ;;
+       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 ;;
+       exit ;;
     i*:UWIN*:*)
        echo ${UNAME_MACHINE}-pc-uwin
-       exit 0 ;;
+       exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+       echo x86_64-unknown-cygwin
+       exit ;;
     p*:CYGWIN*:*)
        echo powerpcle-unknown-cygwin
-       exit ;;
+       exit ;;
     prep*:SunOS:5.*:*)
        echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit ;;
     *:GNU:*:*)
-       echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
-       exit 0 ;;
+       # the GNU system
+       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 '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+       exit ;;
     i*86:Minix:*:*)
        echo ${UNAME_MACHINE}-pc-minix
-       exit 0 ;;
+       exit ;;
+    aarch64:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    aarch64_be:Linux:*:*)
+       UNAME_MACHINE=aarch64_be
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    alpha:Linux:*:*)
+       case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+         EV5)   UNAME_MACHINE=alphaev5 ;;
+         EV56)  UNAME_MACHINE=alphaev56 ;;
+         PCA56) UNAME_MACHINE=alphapca56 ;;
+         PCA57) UNAME_MACHINE=alphapca56 ;;
+         EV6)   UNAME_MACHINE=alphaev6 ;;
+         EV67)  UNAME_MACHINE=alphaev67 ;;
+         EV68*) UNAME_MACHINE=alphaev68 ;;
+       esac
+       objdump --private-headers /bin/sh | grep -q ld.so.1
+       if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    arc:Linux:*:* | arceb:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
     arm*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit 0 ;;
+       eval $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}
+       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
+           else
+               echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+           fi
+       fi
+       exit ;;
+    avr32*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
     cris:Linux:*:*)
-       echo cris-axis-linux-gnu
-       exit 0 ;;
+       echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+       exit ;;
+    crisv32:Linux:*:*)
+       echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+       exit ;;
+    frv:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    hexagon:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    i*86:Linux:*:*)
+       echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+       exit ;;
     ia64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit 0 ;;
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    m32r*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
     m68*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit 0 ;;
-    mips:Linux:*:*)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #undef CPU
-       #undef mips
-       #undef mipsel
-       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-       CPU=mipsel
-       #else
-       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-       CPU=mips
-       #else
-       CPU=
-       #endif
-       #endif
-EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-       test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
-       ;;
-    mips64:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    mips:Linux:*:* | mips64:Linux:*:*)
        eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
        #undef CPU
-       #undef mips64
-       #undef mips64el
+       #undef ${UNAME_MACHINE}
+       #undef ${UNAME_MACHINE}el
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-       CPU=mips64el
+       CPU=${UNAME_MACHINE}el
        #else
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-       CPU=mips64
+       CPU=${UNAME_MACHINE}
        #else
        CPU=
        #endif
        #endif
 EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-       test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
        ;;
-    ppc:Linux:*:*)
-       echo powerpc-unknown-linux-gnu
-       exit 0 ;;
-    ppc64:Linux:*:*)
-       echo powerpc64-unknown-linux-gnu
-       exit 0 ;;
-    alpha:Linux:*:*)
-       case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
-         EV5)   UNAME_MACHINE=alphaev5 ;;
-         EV56)  UNAME_MACHINE=alphaev56 ;;
-         PCA56) UNAME_MACHINE=alphapca56 ;;
-         PCA57) UNAME_MACHINE=alphapca56 ;;
-         EV6)   UNAME_MACHINE=alphaev6 ;;
-         EV67)  UNAME_MACHINE=alphaev67 ;;
-         EV68*) UNAME_MACHINE=alphaev68 ;;
-        esac
-       objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
-       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
-       exit 0 ;;
+    openrisc*:Linux:*:*)
+       echo or1k-unknown-linux-${LIBC}
+       exit ;;
+    or32:Linux:*:* | or1k*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    padre:Linux:*:*)
+       echo sparc-unknown-linux-${LIBC}
+       exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+       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-gnu ;;
-         PA8*) echo hppa2.0-unknown-linux-gnu ;;
-         *)    echo hppa-unknown-linux-gnu ;;
+         PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+         PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+         *)    echo hppa-unknown-linux-${LIBC} ;;
        esac
-       exit 0 ;;
-    parisc64:Linux:*:* | hppa64:Linux:*:*)
-       echo hppa64-unknown-linux-gnu
-       exit 0 ;;
+       exit ;;
+    ppc64:Linux:*:*)
+       echo powerpc64-unknown-linux-${LIBC}
+       exit ;;
+    ppc:Linux:*:*)
+       echo powerpc-unknown-linux-${LIBC}
+       exit ;;
+    ppc64le:Linux:*:*)
+       echo powerpc64le-unknown-linux-${LIBC}
+       exit ;;
+    ppcle:Linux:*:*)
+       echo powerpcle-unknown-linux-${LIBC}
+       exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-       echo ${UNAME_MACHINE}-ibm-linux
-       exit ;;
+       echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+       exit ;;
     sh64*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
     sh*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit 0 ;;
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    tile*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+       exit ;;
     x86_64:Linux:*:*)
-       echo x86_64-unknown-linux-gnu
-       exit 0 ;;
-    i*86:Linux:*:*)
-       # The BFD linker knows what the default object file format is, so
-       # first see if it will tell us. cd to the root directory to prevent
-       # problems with other programs or directories called `ld' in the path.
-       # Set LC_ALL=C to ensure ld outputs messages in English.
-       ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
-                        | sed -ne '/supported targets:/!d
-                                   s/[         ][      ]*/ /g
-                                   s/.*supported targets: *//
-                                   s/ .*//
-                                   p'`
-        case "$ld_supported_targets" in
-         elf32-i386)
-               TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
-               ;;
-         a.out-i386-linux)
-               echo "${UNAME_MACHINE}-pc-linux-gnuaout"
-               exit 0 ;;
-         coff-i386)
-               echo "${UNAME_MACHINE}-pc-linux-gnucoff"
-               exit 0 ;;
-         "")
-               # Either a pre-BFD a.out linker (linux-gnuoldld) or
-               # one that does not give us useful --help.
-               echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
-               exit 0 ;;
-       esac
-       # Determine whether the default compiler is a.out or elf
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
-       #include <features.h>
-       #ifdef __ELF__
-       # ifdef __GLIBC__
-       #  if __GLIBC__ >= 2
-       LIBC=gnu
-       #  else
-       LIBC=gnulibc1
-       #  endif
-       # else
-       LIBC=gnulibc1
-       # endif
-       #else
-       #ifdef __INTEL_COMPILER
-       LIBC=gnu
-       #else
-       LIBC=gnuaout
-       #endif
-       #endif
-EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
-       test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
-       test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
-       ;;
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    xtensa*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
     i*86:DYNIX/ptx:4*:*)
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
        # earlier versions are messed up and put the nodename in both
        # sysname and nodename.
        echo i386-sequent-sysv4
-       exit ;;
+       exit ;;
     i*86:UNIX_SV:4.2MP:2.*)
-        # Unixware is an offshoot of SVR4, but it has its own version
-        # number series starting with 2...
-        # I am not positive that other SVR4 systems won't match this,
+       # Unixware is an offshoot of SVR4, but it has its own version
+       # number series starting with 2...
+       # 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.
+       # Use sysv4.2uw... so that sysv4* matches it.
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
-       exit ;;
+       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
-       exit ;;
+       exit ;;
     i*86:XTS-300:*:STOP)
        echo ${UNAME_MACHINE}-unknown-stop
-       exit ;;
+       exit ;;
     i*86:atheos:*:*)
        echo ${UNAME_MACHINE}-unknown-atheos
-       exit 0 ;;
-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+       exit ;;
+    i*86: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}
-       exit ;;
+       exit ;;
     i*86:*DOS:*:*)
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
-       exit ;;
+       exit ;;
     i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
@@ -991,15 +1066,16 @@ EOF
        else
                echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
        fi
-       exit 0 ;;
-    i*86:*:5:[78]*)
+       exit ;;
+    i*86:*:5:[678]*)
+       # UnixWare 7.x, OpenUNIX and OpenServer 6.
        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}
-       exit ;;
+       exit ;;
     i*86:*:3.2:*)
        if test -f /usr/options/cb.name; then
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
@@ -1017,73 +1093,86 @@ EOF
        else
                echo ${UNAME_MACHINE}-pc-sysv32
        fi
-       exit ;;
+       exit ;;
     pc:*:*:*)
        # Left here for compatibility:
-        # uname -m prints for DJGPP always 'pc', but it prints nothing about
-        # the processor, so we play safe by assuming i386.
-       echo i386-pc-msdosdjgpp
-        exit 0 ;;
+       # uname -m prints for DJGPP always 'pc', but it prints nothing about
+       # the processor, so we play safe by assuming i586.
+       # Note: whatever this is, it MUST be the same as what config.sub
+       # prints for the "djgpp" host, or else GDB configury will decide that
+       # this is a cross-build.
+       echo i586-pc-msdosdjgpp
+       exit ;;
     Intel:Mach:3*:*)
        echo i386-pc-mach3
-       exit ;;
+       exit ;;
     paragon:*:*:*)
        echo i860-intel-osf1
-       exit ;;
+       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
        else # Add other i860-SVR4 vendors below as they are discovered.
          echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
        fi
-       exit ;;
+       exit ;;
     mini*:CTIX:SYS*5:*)
        # "miniframe"
        echo m68010-convergent-sysv
-       exit ;;
+       exit ;;
     mc68k:UNIX:SYSTEM5:3.51m)
        echo m68k-convergent-sysv
-       exit ;;
+       exit ;;
     M680?0:D-NIX:5.3:*)
        echo m68k-diab-dnix
-       exit ;;
-    M68*:*:R3V[567]*:*)
-       test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
-    3[34]??:*: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)
+       exit ;;
+    M68*:*:R3V[5678]*:*)
+       test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+    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`
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-         && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+         && { 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 0 ;;
+         && { 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 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`
+       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+           && { 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; }
+       /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
        echo m68k-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     mc68030:UNIX_System_V:4.*:*)
        echo m68k-atari-sysv4
-       exit ;;
+       exit ;;
     TSUNAMI:LynxOS:2.*:*)
        echo sparc-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     rs6000:LynxOS:2.*:*)
        echo rs6000-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
-    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+       exit ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
        echo powerpc-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     SM[BE]S:UNIX_SV:*:*)
        echo mips-dde-sysv${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     RM*:ReliantUNIX-*:*:*)
        echo mips-sni-sysv4
-       exit ;;
+       exit ;;
     RM*:SINIX-*:*:*)
        echo mips-sni-sysv4
-       exit ;;
+       exit ;;
     *:SINIX-*:*:*)
        if uname -p 2>/dev/null >/dev/null ; then
                UNAME_MACHINE=`(uname -p) 2>/dev/null`
@@ -1091,68 +1180,109 @@ EOF
        else
                echo ns32k-sni-sysv
        fi
-       exit ;;
-    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-                      # says <Richard.M.Bartel@ccMail.Census.GOV>
-        echo i586-unisys-sysv4
-        exit 0 ;;
+       exit ;;
+    PENTIUM:*:4.0*:*)  # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                       # says <Richard.M.Bartel@ccMail.Census.GOV>
+       echo i586-unisys-sysv4
+       exit ;;
     *:UNIX_System_V:4*:FTX*)
        # From Gerald Hewes <hewes@openmarket.com>.
        # How about differentiating between stratus architectures? -djm
        echo hppa1.1-stratus-sysv4
-       exit ;;
+       exit ;;
     *:*:*:FTX*)
        # From seanf@swdc.stratus.com.
        echo i860-stratus-sysv4
-       exit 0 ;;
+       exit ;;
+    i*86:VOS:*:*)
+       # From Paul.Green@stratus.com.
+       echo ${UNAME_MACHINE}-stratus-vos
+       exit ;;
     *:VOS:*:*)
        # From Paul.Green@stratus.com.
        echo hppa1.1-stratus-vos
-       exit ;;
+       exit ;;
     mc68*:A/UX:*:*)
        echo m68k-apple-aux${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     news*:NEWS-OS:6*:*)
        echo mips-sony-newsos6
-       exit ;;
+       exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
        if [ -d /usr/nec ]; then
-               echo mips-nec-sysv${UNAME_RELEASE}
+               echo mips-nec-sysv${UNAME_RELEASE}
        else
-               echo mips-unknown-sysv${UNAME_RELEASE}
+               echo mips-unknown-sysv${UNAME_RELEASE}
        fi
-        exit 0 ;;
+       exit ;;
     BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
        echo powerpc-be-beos
-       exit ;;
+       exit ;;
     BeMac:BeOS:*:*)    # BeOS running on Mac or Mac clone, PPC only.
        echo powerpc-apple-beos
-       exit ;;
+       exit ;;
     BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
        echo i586-pc-beos
-       exit 0 ;;
+       exit ;;
+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
+       echo i586-pc-haiku
+       exit ;;
+    x86_64:Haiku:*:*)
+       echo x86_64-unknown-haiku
+       exit ;;
     SX-4:SUPER-UX:*:*)
        echo sx4-nec-superux${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     SX-5:SUPER-UX:*:*)
        echo sx5-nec-superux${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     SX-6:SUPER-UX:*:*)
        echo sx6-nec-superux${UNAME_RELEASE}
-       exit 0 ;;
+       exit ;;
+    SX-7:SUPER-UX:*:*)
+       echo sx7-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8:SUPER-UX:*:*)
+       echo sx8-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8R:SUPER-UX:*:*)
+       echo sx8r-nec-superux${UNAME_RELEASE}
+       exit ;;
     Power*:Rhapsody:*:*)
        echo powerpc-apple-rhapsody${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:Rhapsody:*:*)
        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:Darwin:*:*)
-       case `uname -p` in
-           *86) UNAME_PROCESSOR=i686 ;;
-           powerpc) UNAME_PROCESSOR=powerpc ;;
-       esac
+       UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+       eval $set_cc_for_build
+       if test "$UNAME_PROCESSOR" = unknown ; then
+           UNAME_PROCESSOR=powerpc
+       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
+           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
+       fi
        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
        UNAME_PROCESSOR=`uname -p`
        if test "$UNAME_PROCESSOR" = "x86"; then
@@ -1160,22 +1290,28 @@ EOF
                UNAME_MACHINE=pc
        fi
        echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:QNX:*:4*)
        echo i386-pc-qnx
-       exit 0 ;;
-    NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
+       exit ;;
+    NEO-?:NONSTOP_KERNEL:*:*)
+       echo neo-tandem-nsk${UNAME_RELEASE}
+       exit ;;
+    NSE-*:NONSTOP_KERNEL:*:*)
+       echo nse-tandem-nsk${UNAME_RELEASE}
+       exit ;;
+    NSR-?:NONSTOP_KERNEL:*:*)
        echo nsr-tandem-nsk${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:NonStop-UX:*:*)
        echo mips-compaq-nonstopux
-       exit ;;
+       exit ;;
     BS2000:POSIX*:*:*)
        echo bs2000-siemens-sysv
-       exit ;;
+       exit ;;
     DS/*:UNIX_System_V:*:*)
        echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:Plan9:*:*)
        # "uname -m" is not consistent, so use $cputype instead. 386
        # is converted to i386 for consistency with other x86
@@ -1186,180 +1322,55 @@ EOF
            UNAME_MACHINE="$cputype"
        fi
        echo ${UNAME_MACHINE}-unknown-plan9
-       exit ;;
+       exit ;;
     *:TOPS-10:*:*)
        echo pdp10-unknown-tops10
-       exit ;;
+       exit ;;
     *:TENEX:*:*)
        echo pdp10-unknown-tenex
-       exit ;;
+       exit ;;
     KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
        echo pdp10-dec-tops20
-       exit ;;
+       exit ;;
     XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
        echo pdp10-xkl-tops20
-       exit ;;
+       exit ;;
     *:TOPS-20:*:*)
        echo pdp10-unknown-tops20
-       exit ;;
+       exit ;;
     *:ITS:*:*)
        echo pdp10-unknown-its
-       exit ;;
+       exit ;;
     SEI:*:*:SEIUX)
-        echo mips-sei-seiux${UNAME_RELEASE}
-       exit 0 ;;
+       echo mips-sei-seiux${UNAME_RELEASE}
+       exit ;;
+    *:DragonFly:*:*)
+       echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+       exit ;;
+    *:*VMS:*:*)
+       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 ;;
+       esac ;;
+    *:XENIX:*:SysV)
+       echo i386-pc-xenix
+       exit ;;
+    i*86:skyos:*:*)
+       echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+       exit ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       exit ;;
+    i*86:AROS:*:*)
+       echo ${UNAME_MACHINE}-pc-aros
+       exit ;;
+    x86_64:VMkernel:*:*)
+       echo ${UNAME_MACHINE}-unknown-esx
+       exit ;;
 esac
 
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#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 (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
-  printf ("m68k-hp-bsd\n"); exit (0);
-#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
-    printf ("vax-dec-ultrix\n"); exit (0);
-# 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 && $dummy && exit 0
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
-    case `getsysinfo -f cpu_type` in
-    c1*)
-       echo c1-convex-bsd
-       exit 0 ;;
-    c2*)
-       if getsysinfo -f scalar_acc
-       then echo c32-convex-bsd
-       else echo c2-convex-bsd
-       fi
-       exit 0 ;;
-    c34*)
-       echo c34-convex-bsd
-       exit 0 ;;
-    c38*)
-       echo c38-convex-bsd
-       exit 0 ;;
-    c4*)
-       echo c4-convex-bsd
-       exit 0 ;;
-    esac
-fi
-
 cat >&2 <<EOF
 $0: unable to guess system type
 
@@ -1367,7 +1378,9 @@ This script, last modified $timestamp, has failed to recognize
 the operating system you are using. It is advised that you
 download the most up to date version of the config scripts from
 
-    ftp://ftp.gnu.org/pub/gnu/config/
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
 
 If the version you run ($0) is already up to date, please
 send the following data and any information you think might be
similarity index 99%
rename from build/aux/config.rpath
rename to build/ac-aux/config.rpath
index 8bd7f5d..1a07018 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-2011 Free Software Foundation, Inc.
+#   Copyright 1996-2012 Free Software Foundation, Inc.
 #   Taken from GNU libtool, 2001
 #   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 #
@@ -25,7 +25,7 @@
 #   known workaround is to choose shorter directory names for the build
 #   directory and/or the installation directory.
 
-# All known linkers require a `.a' archive for static linking (except MSVC,
+# All known linkers require a '.a' archive for static linking (except MSVC,
 # which needs '.lib').
 libext=a
 shrext=.so
similarity index 73%
rename from build/aux/config.sub
rename to build/ac-aux/config.sub
index 9d7f733..66c5074 100755 (executable)
@@ -1,42 +1,40 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+#   Copyright 1992-2014 Free Software Foundation, Inc.
 
-timestamp='2003-07-04'
+timestamp='2014-07-28'
 
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine.  It does not imply ALL GNU software can.
-#
-# 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 2 of the License, or
+# 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 program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
+# 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.
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
 
-# Please send patches to <config-patches@gnu.org>.  Submit a context
-# diff and a properly formatted ChangeLog entry.
+
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
 # If it is invalid, we print an error message on stderr and exit with code 1.
 # 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;hb=HEAD
+
 # This file is supposed to be the same for all GNU packages
 # and recognize all the CPU types, system types and aliases
 # that are meaningful with *any* GNU software.
@@ -70,8 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
+Copyright 1992-2014 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."
@@ -83,11 +80,11 @@ Try \`$me --help' for more information."
 while test $# -gt 0 ; do
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
+       echo "$timestamp" ; exit ;;
     --version | -v )
-       echo "$version" ; exit ;;
+       echo "$version" ; exit ;;
     --help | --h* | -h )
-       echo "$usage"; exit ;;
+       echo "$usage"; exit ;;
     -- )     # Stop option processing
        shift; break ;;
     - )        # Use stdin as input.
@@ -99,7 +96,7 @@ while test $# -gt 0 ; do
     *local*)
        # First pass through any local machine types.
        echo $1
-       exit 0;;
+       exit ;;
 
     * )
        break ;;
@@ -118,10 +115,18 @@ esac
 # 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* | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-gnu* | \
+  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 ]
@@ -144,10 +149,13 @@ case $os in
        -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)
+       -apple | -axis | -knuth | -cray | -microblaze*)
                os=
                basic_machine=$1
                ;;
+       -bluegene*)
+               os=-cnk
+               ;;
        -sim | -cisco | -oki | -wec | -winbond)
                os=
                basic_machine=$1
@@ -162,13 +170,17 @@ case $os in
                os=-chorusos
                basic_machine=$1
                ;;
-       -chorusrdb)
-               os=-chorusrdb
+       -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/'`
@@ -185,6 +197,10 @@ case $os in
                # 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/'`
@@ -202,6 +218,12 @@ case $os in
        -isc*)
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
                ;;
+       -lynx*178)
+               os=-lynxos178
+               ;;
+       -lynx*5)
+               os=-lynxos5
+               ;;
        -lynx*)
                os=-lynxos
                ;;
@@ -226,55 +248,108 @@ case $basic_machine in
        # 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] \
-       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
-       | c4x | clipper \
+       | am33_2.0 \
+       | arc | arceb \
+       | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+       | avr | avr32 \
+       | be32 | be64 \
+       | bfin \
+       | c4x | c8051 | clipper \
        | d10v | d30v | dlx | dsp16xx \
-       | fr30 | frv \
+       | epiphany \
+       | fido | fr30 | frv \
        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | hexagon \
        | i370 | i860 | i960 | ia64 \
-       | ip2k \
-       | m32r | m68000 | m68k | m88k | mcore \
+       | 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 \
-       | mips64vr | mips64vrel \
+       | 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 \
-       | openrisc | or32 \
+       | open8 | or1k | or1knd | or32 \
        | pdp10 | pdp11 | pj | pjl \
-       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | powerpc | powerpc64 | powerpc64le | powerpcle \
        | pyramid \
-       | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+       | rl78 | rx \
+       | score \
+       | 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 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
-       | strongarm \
-       | tahoe | thumb | tic4x | tic80 | tron \
-       | v850 | v850e \
+       | 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 \
        | we32k \
-       | x86 | xscale | xstormy16 | xtensa \
-       | z8k)
+       | x86 | xc16x | xstormy16 | xtensa \
+       | z8k | z80)
                basic_machine=$basic_machine-unknown
                ;;
-       m6811 | m68hc11 | m6812 | m68hc12)
-               # Motorola 68HC11/12.
+       c54x)
+               basic_machine=tic54x-unknown
+               ;;
+       c55x)
+               basic_machine=tic55x-unknown
+               ;;
+       c6x)
+               basic_machine=tic6x-unknown
+               ;;
+       m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
                basic_machine=$basic_machine-unknown
                os=-none
                ;;
        m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
                ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       strongarm | thumb | xscale)
+               basic_machine=arm-unknown
+               ;;
+       xgate)
+               basic_machine=$basic_machine-unknown
+               os=-none
+               ;;
+       xscaleeb)
+               basic_machine=armeb-unknown
+               ;;
+
+       xscaleel)
+               basic_machine=armel-unknown
+               ;;
 
        # We use `pc' rather than `unknown'
        # because (1) that's what they normally are, and
@@ -290,58 +365,86 @@ case $basic_machine in
        # 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]-* | amd64-* | arc-* \
+       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
        | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-       | avr-* \
-       | bs2000-* \
-       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
-       | clipper-* | cydra-* \
+       | avr-* | avr32-* \
+       | be32-* | be64-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* \
+       | c8051-* | clipper-* | craynv-* | cydra-* \
        | d10v-* | d30v-* | dlx-* \
        | elxsi-* \
-       | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+       | 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-* \
-       | m32r-* \
+       | ip2k-* | iq2000-* \
+       | k1om-* \
+       | le32-* | le64-* \
+       | lm32-* \
+       | m32c-* | m32r-* | m32rle-* \
        | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-       | m88110-* | m88k-* | mcore-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+       | microblaze-* | microblazeel-* \
        | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
        | mips16-* \
        | mips64-* | mips64el-* \
-       | mips64vr-* | mips64vrel-* \
+       | 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-* \
-       | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
+       | nds32-* | nds32le-* | nds32be-* \
+       | nios-* | nios2-* | nios2eb-* | nios2el-* \
+       | none-* | np1-* | ns16k-* | ns32k-* \
+       | open8-* \
+       | or1k*-* \
        | orion-* \
        | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
        | pyramid-* \
-       | romp-* | rs6000-* \
-       | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+       | 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-* | sparc86x-* | sparclet-* | sparclite-* \
-       | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
-       | tahoe-* | thumb-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+       | tahoe-* \
        | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+       | tile*-* \
        | tron-* \
-       | v850-* | v850e-* | vax-* \
+       | ubicom32-* \
+       | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+       | vax-* \
        | we32k-* \
-       | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
-       | xtensa-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* \
+       | xstormy16-* | xtensa*-* \
        | ymp-* \
-       | z8k-*)
+       | 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.
@@ -359,6 +462,9 @@ case $basic_machine in
                basic_machine=a29k-amd
                os=-udi
                ;;
+       abacus)
+               basic_machine=abacus-unknown
+               ;;
        adobe68k)
                basic_machine=m68010-adobe
                os=-scout
@@ -376,6 +482,9 @@ case $basic_machine in
        amd64)
                basic_machine=x86_64-pc
                ;;
+       amd64-*)
+               basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        amdahl)
                basic_machine=580-amdahl
                os=-sysv
@@ -399,6 +508,10 @@ case $basic_machine in
                basic_machine=m68k-apollo
                os=-bsd
                ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
        aux)
                basic_machine=m68k-apple
                os=-aux
@@ -407,10 +520,35 @@ case $basic_machine in
                basic_machine=ns32k-sequent
                os=-dynix
                ;;
+       blackfin)
+               basic_machine=bfin-unknown
+               os=-linux
+               ;;
+       blackfin-*)
+               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       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
@@ -435,12 +573,27 @@ case $basic_machine in
                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
                ;;
@@ -463,6 +616,14 @@ case $basic_machine in
                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
@@ -574,7 +735,6 @@ case $basic_machine in
        i370-ibm* | ibm*)
                basic_machine=i370-ibm
                ;;
-# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
        i*86v32)
                basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
                os=-sysv32
@@ -613,6 +773,14 @@ case $basic_machine in
                basic_machine=m68k-isi
                os=-sysv
                ;;
+       m68knommu)
+               basic_machine=m68k-unknown
+               os=-linux
+               ;;
+       m68knommu-*)
+               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
        m88k-omron*)
                basic_machine=m88k-omron
                ;;
@@ -624,10 +792,21 @@ case $basic_machine in
                basic_machine=ns32k-utek
                os=-sysv
                ;;
+       microblaze*)
+               basic_machine=microblaze-xilinx
+               ;;
+       mingw64)
+               basic_machine=x86_64-pc
+               os=-mingw64
+               ;;
        mingw32)
-               basic_machine=i386-pc
+               basic_machine=i686-pc
                os=-mingw32
                ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
        miniframe)
                basic_machine=m68000-convergent
                ;;
@@ -641,10 +820,6 @@ case $basic_machine in
        mips3*)
                basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
                ;;
-       mmix*)
-               basic_machine=mmix-knuth
-               os=-mmixware
-               ;;
        monitor)
                basic_machine=m68k-rom68k
                os=-coff
@@ -653,14 +828,29 @@ case $basic_machine in
                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
@@ -725,9 +915,11 @@ case $basic_machine in
        np1)
                basic_machine=np1-gould
                ;;
-       nv1)
-               basic_machine=nv1-cray
-               os=-unicosmp
+       neo-tandem)
+               basic_machine=neo-tandem
+               ;;
+       nse-tandem)
+               basic_machine=nse-tandem
                ;;
        nsr-tandem)
                basic_machine=nsr-tandem
@@ -736,9 +928,12 @@ case $basic_machine in
                basic_machine=hppa1.1-oki
                os=-proelf
                ;;
-       or32 | or32-*)
+       openrisc | openrisc-*)
                basic_machine=or32-unknown
-               os=-coff
+               ;;
+       os400)
+               basic_machine=powerpc-ibm
+               os=-os400
                ;;
        OSE68000 | ose68000)
                basic_machine=m68000-ericsson
@@ -756,6 +951,14 @@ case $basic_machine in
                basic_machine=i860-intel
                os=-osf
                ;;
+       parisc)
+               basic_machine=hppa-unknown
+               os=-linux
+               ;;
+       parisc-*)
+               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
        pbd)
                basic_machine=sparc-tti
                ;;
@@ -765,6 +968,12 @@ case $basic_machine in
        pc532 | pc532-*)
                basic_machine=ns32k-pc532
                ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        pentium | p5 | k5 | k6 | nexgen | viac3)
                basic_machine=i586-pc
                ;;
@@ -794,9 +1003,10 @@ case $basic_machine in
                ;;
        power)  basic_machine=power-ibm
                ;;
-       ppc)    basic_machine=powerpc-unknown
+       ppc | ppcbe)    basic_machine=powerpc-unknown
                ;;
-       ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+       ppc-* | ppcbe-*)
+               basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
        ppcle | powerpclittle | ppc-le | powerpc-little)
                basic_machine=powerpcle-unknown
@@ -806,7 +1016,7 @@ case $basic_machine in
                ;;
        ppc64)  basic_machine=powerpc64-unknown
                ;;
-       ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+       ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
        ppc64le | powerpc64little | ppc64-le | powerpc64-little)
                basic_machine=powerpc64le-unknown
@@ -821,6 +1031,14 @@ case $basic_machine in
                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
@@ -847,6 +1065,10 @@ case $basic_machine in
        sb1el)
                basic_machine=mipsisa64sb1el-unknown
                ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
        sei)
                basic_machine=mips-sei
                os=-seiux
@@ -858,6 +1080,9 @@ case $basic_machine in
                basic_machine=sh-hitachi
                os=-hms
                ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
        sh64)
                basic_machine=sh64-unknown
                ;;
@@ -879,6 +1104,9 @@ case $basic_machine in
                basic_machine=i860-stratus
                os=-sysv4
                ;;
+       strongarm-* | thumb-*)
+               basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        sun2)
                basic_machine=m68000-sun
                ;;
@@ -935,17 +1163,9 @@ case $basic_machine in
                basic_machine=t90-cray
                os=-unicos
                ;;
-       tic54x | c54x*)
-               basic_machine=tic54x-unknown
-               os=-coff
-               ;;
-       tic55x | c55x*)
-               basic_machine=tic55x-unknown
-               os=-coff
-               ;;
-       tic6x | c6x*)
-               basic_machine=tic6x-unknown
-               os=-coff
+       tile*)
+               basic_machine=$basic_machine-unknown
+               os=-linux-gnu
                ;;
        tx39)
                basic_machine=mipstx39-unknown
@@ -960,6 +1180,10 @@ case $basic_machine in
        tower | tower-32)
                basic_machine=m68k-ncr
                ;;
+       tpf)
+               basic_machine=s390x-ibm
+               os=-tpf
+               ;;
        udi29k)
                basic_machine=a29k-amd
                os=-udi
@@ -1003,9 +1227,16 @@ case $basic_machine in
                basic_machine=hppa1.1-winbond
                os=-proelf
                ;;
+       xbox)
+               basic_machine=i686-pc
+               os=-mingw32
+               ;;
        xps | xps100)
                basic_machine=xps100-honeywell
                ;;
+       xscale-* | xscalee[bl]-*)
+               basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+               ;;
        ymp)
                basic_machine=ymp-cray
                os=-unicos
@@ -1014,6 +1245,10 @@ case $basic_machine in
                basic_machine=z8k-unknown
                os=-sim
                ;;
+       z80-*-coff)
+               basic_machine=z80-unknown
+               os=-sim
+               ;;
        none)
                basic_machine=none-none
                os=-none
@@ -1033,6 +1268,9 @@ case $basic_machine in
        romp)
                basic_machine=romp-ibm
                ;;
+       mmix)
+               basic_machine=mmix-knuth
+               ;;
        rs6000)
                basic_machine=rs6000-ibm
                ;;
@@ -1049,13 +1287,10 @@ case $basic_machine in
        we32k)
                basic_machine=we32k-att
                ;;
-       sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
+       sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
                basic_machine=sh-unknown
                ;;
-       sh64)
-               basic_machine=sh64-unknown
-               ;;
-       sparc | sparcv9 | sparcv9b)
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
                basic_machine=sparc-sun
                ;;
        cydra)
@@ -1099,9 +1334,12 @@ esac
 if [ x"$os" != x"" ]
 then
 case $os in
-        # First match some system type aliases
-        # that might get confused with valid system types.
+       # 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
+               ;;
        -solaris1 | -solaris1.*)
                os=`echo $os | sed -e 's|solaris1|sunos4|'`
                ;;
@@ -1122,25 +1360,31 @@ case $os in
        # 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* | -sunos | -sunos[34]*\
-             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+             | -*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* \
+             | -aos* | -aros* \
              | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-             | -hiux* | -386bsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
-             | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -bitrig* | -openbsd* | -solidbsd* \
+             | -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* \
-             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-             | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+             | -chorusos* | -chorusrdb* | -cegcc* \
+             | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -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*)
+             | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+             | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
        -qnx*)
@@ -1158,12 +1402,15 @@ case $os in
                os=`echo $os | sed -e 's|nto|nto-qnx|'`
                ;;
        -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-             | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+             | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
              | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
                ;;
        -mac*)
                os=`echo $os | sed -e 's|mac|macos|'`
                ;;
+       -linux-dietlibc)
+               os=-linux-dietlibc
+               ;;
        -linux*)
                os=`echo $os | sed -e 's|linux|linux-gnu|'`
                ;;
@@ -1176,6 +1423,9 @@ case $os in
        -opened*)
                os=-openedition
                ;;
+       -os400*)
+               os=-os400
+               ;;
        -wince*)
                os=-wince
                ;;
@@ -1197,6 +1447,9 @@ case $os in
        -atheos*)
                os=-atheos
                ;;
+       -syllable*)
+               os=-syllable
+               ;;
        -386bsd)
                os=-bsd
                ;;
@@ -1219,6 +1472,9 @@ case $os in
        -sinix*)
                os=-sysv4
                ;;
+       -tpf*)
+               os=-tpf
+               ;;
        -triton*)
                os=-sysv3
                ;;
@@ -1252,8 +1508,13 @@ case $os in
        -aros*)
                os=-aros
                ;;
-       -kaos*)
-               os=-kaos
+       -zvmoe)
+               os=-zvmoe
+               ;;
+       -dicos*)
+               os=-dicos
+               ;;
+       -nacl*)
                ;;
        -none)
                ;;
@@ -1277,6 +1538,12 @@ else
 # system, and we'll never get to this point.
 
 case $basic_machine in
+       score-*)
+               os=-elf
+               ;;
+       spu-*)
+               os=-elf
+               ;;
        *-acorn)
                os=-riscix1.2
                ;;
@@ -1286,9 +1553,24 @@ case $basic_machine in
        arm*-semi)
                os=-aout
                ;;
-    c4x-* | tic4x-*)
-        os=-coff
-        ;;
+       c4x-* | tic4x-*)
+               os=-coff
+               ;;
+       c8051-*)
+               os=-elf
+               ;;
+       hexagon-*)
+               os=-elf
+               ;;
+       tic54x-*)
+               os=-coff
+               ;;
+       tic55x-*)
+               os=-coff
+               ;;
+       tic6x-*)
+               os=-coff
+               ;;
        # This must come before the *-dec entry.
        pdp10-*)
                os=-tops20
@@ -1307,13 +1589,13 @@ case $basic_machine in
                ;;
        m68000-sun)
                os=-sunos3
-               # This also exists in the configure program, but was not the
-               # default.
-               # os=-sunos4
                ;;
        m68*-cisco)
                os=-aout
                ;;
+       mep-*)
+               os=-elf
+               ;;
        mips*-cisco)
                os=-elf
                ;;
@@ -1332,9 +1614,15 @@ case $basic_machine in
        *-be)
                os=-beos
                ;;
+       *-haiku)
+               os=-haiku
+               ;;
        *-ibm)
                os=-aix
                ;;
+       *-knuth)
+               os=-mmixware
+               ;;
        *-wec)
                os=-proelf
                ;;
@@ -1437,7 +1725,7 @@ case $basic_machine in
                        -sunos*)
                                vendor=sun
                                ;;
-                       -aix*)
+                       -cnk*|-aix*)
                                vendor=ibm
                                ;;
                        -beos*)
@@ -1467,9 +1755,15 @@ case $basic_machine in
                        -mvs* | -opened*)
                                vendor=ibm
                                ;;
+                       -os400*)
+                               vendor=ibm
+                               ;;
                        -ptx*)
                                vendor=sequent
                                ;;
+                       -tpf*)
+                               vendor=ibm
+                               ;;
                        -vxsim* | -vxworks* | -windiss*)
                                vendor=wrs
                                ;;
@@ -1494,7 +1788,7 @@ case $basic_machine in
 esac
 
 echo $basic_machine$os
-exit 0
+exit
 
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
similarity index 50%
rename from build/aux/depcomp
rename to build/ac-aux/depcomp
index df8eea7..4ebd5b3 100755 (executable)
@@ -1,10 +1,9 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2013-05-30.07; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
-# Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -28,9 +27,9 @@ scriptversion=2009-04-28.21; # UTC
 
 case $1 in
   '')
-     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
-     exit 1;
-     ;;
+    echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+    exit 1;
+    ;;
   -h | --h*)
     cat <<\EOF
 Usage: depcomp [--help] [--version] PROGRAM [ARGS]
@@ -40,11 +39,11 @@ as side-effects.
 
 Environment variables:
   depmode     Dependency tracking mode.
-  source      Source file read by `PROGRAMS ARGS'.
-  object      Object file output by `PROGRAMS ARGS'.
+  source      Source file read by 'PROGRAMS ARGS'.
+  object      Object file output by 'PROGRAMS ARGS'.
   DEPDIR      directory where to store dependencies.
   depfile     Dependency file to output.
-  tmpdepfile  Temporary file to use when outputing dependencies.
+  tmpdepfile  Temporary file to use when outputting dependencies.
   libtool     Whether libtool is used (yes/no).
 
 Report bugs to <bug-automake@gnu.org>.
@@ -57,6 +56,66 @@ EOF
     ;;
 esac
 
+# Get the directory component of the given path, and save it in the
+# global variables '$dir'.  Note that this directory component will
+# be either empty or ending with a '/' character.  This is deliberate.
+set_dir_from ()
+{
+  case $1 in
+    */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+      *) dir=;;
+  esac
+}
+
+# Get the suffix-stripped basename of the given path, and save it the
+# global variable '$base'.
+set_base_from ()
+{
+  base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
+}
+
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+  echo "#dummy" > "$depfile"
+}
+
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+  # If the compiler actually managed to produce a dependency file,
+  # post-process it.
+  if test -f "$tmpdepfile"; then
+    # Each line is of the form 'foo.o: dependency.h'.
+    # Do two passes, one to just change these to
+    #   $object: dependency.h
+    # and one to simply output
+    #   dependency.h:
+    # which is needed to avoid the deleted-header problem.
+    { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+      sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+    } > "$depfile"
+    rm -f "$tmpdepfile"
+  else
+    make_dummy_depfile
+  fi
+}
+
+# A tabulation character.
+tab='  '
+# A newline character.
+nl='
+'
+# Character ranges might be problematic outside the C locale.
+# These definitions help.
+upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+lower=abcdefghijklmnopqrstuvwxyz
+digits=0123456789
+alpha=${upper}${lower}
+
 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
   echo "depcomp: Variables source, object and depmode must be set" 1>&2
   exit 1
@@ -69,6 +128,9 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
 
 rm -f "$tmpdepfile"
 
+# Avoid interferences from the environment.
+gccflag= dashmflag=
+
 # Some modes work just like other modes, but use different flags.  We
 # parameterize here, but still list the modes in the big case below,
 # to make depend.m4 easier to write.  Note that we *cannot* use a case
@@ -80,18 +142,32 @@ if test "$depmode" = hp; then
 fi
 
 if test "$depmode" = dashXmstdout; then
-   # This is just like dashmstdout with a different argument.
-   dashmflag=-xM
-   depmode=dashmstdout
+  # This is just like dashmstdout with a different argument.
+  dashmflag=-xM
+  depmode=dashmstdout
 fi
 
 cygpath_u="cygpath -u -f -"
 if test "$depmode" = msvcmsys; then
-   # This is just like msvisualcpp but w/o cygpath translation.
-   # Just convert the backslash-escaped backslashes to single forward
-   # slashes to satisfy depend.m4
-   cygpath_u="sed s,\\\\\\\\,/,g"
-   depmode=msvisualcpp
+  # This is just like msvisualcpp but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvisualcpp
+fi
+
+if test "$depmode" = msvc7msys; then
+  # This is just like msvc7 but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+  # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
+  gccflag=-qmakedep=gcc,-MF
+  depmode=gcc
 fi
 
 case "$depmode" in
@@ -114,8 +190,7 @@ gcc3)
   done
   "$@"
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -123,13 +198,17 @@ gcc3)
   ;;
 
 gcc)
+## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
+## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
+## (see the conditional assignment to $gccflag above).
 ## There are various ways to get dependency output from gcc.  Here's
 ## why we pick this rather obscure method:
 ## - Don't want to use -MD because we'd like the dependencies to end
 ##   up in a subdir.  Having to rename by hand is ugly.
 ##   (We might end up doing this anyway to support other compilers.)
 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-##   -MM, not -M (despite what the docs say).
+##   -MM, not -M (despite what the docs say).  Also, it might not be
+##   supported by the other compilers which use the 'gcc' depmode.
 ## - Using -M directly means running the compiler twice (even worse
 ##   than renaming).
   if test -z "$gccflag"; then
@@ -137,31 +216,31 @@ gcc)
   fi
   "$@" -Wp,"$gccflag$tmpdepfile"
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
-  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
-## The second -e expression handles DOS-style file names with drive letters.
+  # The second -e expression handles DOS-style file names with drive
+  # letters.
   sed -e 's/^[^:]*: / /' \
       -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the `deleted header file' problem.
+## This next piece of magic avoids the "deleted header file" problem.
 ## The problem is that when a header file which appears in a .P file
 ## is deleted, the dependency causes make to die (because there is
 ## typically no way to rebuild the header).  We avoid this by adding
 ## dummy dependencies for each header file.  Too bad gcc doesn't do
 ## this for us directly.
-  tr ' ' '
-' < "$tmpdepfile" |
-## Some versions of gcc put a space before the `:'.  On the theory
+## Some versions of gcc put a space before the ':'.  On the theory
 ## that the space means something, we add a space to the output as
-## well.
+## well.  hp depmode also adds that space, but also prefixes the VPATH
+## to the object.  Take care to not repeat it in the output.
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -179,8 +258,7 @@ sgi)
     "$@" -MDupdate "$tmpdepfile"
   fi
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -188,43 +266,41 @@ sgi)
 
   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
+    # the IRIX cc adds comments like '#:fec' to the end of the
     # dependency line.
-    tr ' ' '
-' < "$tmpdepfile" \
-    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
-    tr '
-' ' ' >> "$depfile"
+    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 ' ' '
-' < "$tmpdepfile" \
-   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
-   >> "$depfile"
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+      >> "$depfile"
   else
-    # The sourcefile does not contain any dependencies, so just
-    # store a dummy comment line, to avoid errors with the Makefile
-    # "include basename.Plo" scheme.
-    echo "#dummy" > "$depfile"
+    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,
+  # since it is checked for above.
+  exit 1
+  ;;
+
 aix)
   # The C for AIX Compiler uses -M and outputs the dependencies
   # in a .u file.  In older versions, this file always lives in the
-  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # current directory.  Also, the AIX compiler puts '$object:' at the
   # start of each line; $object doesn't have directory information.
   # Version 6 uses the directory in both cases.
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
-  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  set_dir_from "$object"
+  set_base_from "$object"
   if test "$libtool" = yes; then
     tmpdepfile1=$dir$base.u
     tmpdepfile2=$base.u
@@ -237,9 +313,7 @@ aix)
     "$@" -M
   fi
   stat=$?
-
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
     exit $stat
   fi
@@ -248,44 +322,100 @@ aix)
   do
     test -f "$tmpdepfile" && break
   done
-  if test -f "$tmpdepfile"; then
-    # Each line is of the form `foo.o: dependent.h'.
-    # Do two passes, one to just change these to
-    # `$object: dependent.h' and one to simply `dependent.h:'.
-    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-    # That's a tab and a space in the [].
-    sed -e 's,^.*\.[a-z]*:[     ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
-  else
-    # The sourcefile does not contain any dependencies, so just
-    # store a dummy comment line, to avoid errors with the Makefile
-    # "include basename.Plo" scheme.
-    echo "#dummy" > "$depfile"
+  aix_post_process_depfile
+  ;;
+
+tcc)
+  # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+  # FIXME: That version still under development at the moment of writing.
+  #        Make that this statement remains true also for stable, released
+  #        versions.
+  # It will wrap lines (doesn't matter whether long or short) with a
+  # trailing '\', as in:
+  #
+  #   foo.o : \
+  #    foo.c \
+  #    foo.h \
+  #
+  # It will put a trailing '\' even on the last line, and will use leading
+  # spaces rather than leading tabs (at least since its commit 0394caf7
+  # "Emit spaces for -MD").
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
   fi
+  rm -f "$depfile"
+  # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+  # We have to change lines of the first kind to '$object: \'.
+  sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+  # And for each line of the second kind, we have to emit a 'dep.h:'
+  # dummy dependency, to avoid the deleted-header problem.
+  sed -n -e 's|^  *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
-icc)
-  # Intel's C compiler understands `-MD -MF file'.  However on
-  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
-  # ICC 7.0 will fill foo.d with something like
-  #    foo.o: sub/foo.c
-  #    foo.o: sub/foo.h
-  # which is wrong.  We want:
-  #    sub/foo.o: sub/foo.c
-  #    sub/foo.o: sub/foo.h
-  #    sub/foo.c:
-  #    sub/foo.h:
-  # ICC 7.1 will output
+## The order of this option in the case statement is important, since the
+## shell code in configure will try each of these formats in the order
+## listed in this file.  A plain '-MD' option would be understood by many
+## compilers, so we must ensure this comes after the gcc and icc options.
+pgcc)
+  # Portland's C compiler understands '-MD'.
+  # Will always output deps to 'file.d' where file is the root name of the
+  # source file under compilation, even if file resides in a subdirectory.
+  # The object file name does not affect the name of the '.d' file.
+  # pgcc 10.2 will output
   #    foo.o: sub/foo.c sub/foo.h
-  # and will wrap long lines using \ :
+  # and will wrap long lines using '\' :
   #    foo.o: sub/foo.c ... \
   #     sub/foo.h ... \
   #     ...
+  set_dir_from "$object"
+  # Use the source, not the object, to determine the base name, since
+  # that's sadly what pgcc will do too.
+  set_base_from "$source"
+  tmpdepfile=$base.d
+
+  # For projects that build the same source file twice into different object
+  # files, the pgcc approach of using the *source* file root name can cause
+  # problems in parallel builds.  Use a locking strategy to avoid stomping on
+  # the same $tmpdepfile.
+  lockdir=$base.d-lock
+  trap "
+    echo '$0: caught signal, cleaning up...' >&2
+    rmdir '$lockdir'
+    exit 1
+  " 1 2 13 15
+  numtries=100
+  i=$numtries
+  while test $i -gt 0; do
+    # mkdir is a portable test-and-set.
+    if mkdir "$lockdir" 2>/dev/null; then
+      # This process acquired the lock.
+      "$@" -MD
+      stat=$?
+      # Release the lock.
+      rmdir "$lockdir"
+      break
+    else
+      # If the lock is being held by a different process, wait
+      # until the winning process is done or we timeout.
+      while test -d "$lockdir" && test $i -gt 0; do
+        sleep 1
+        i=`expr $i - 1`
+      done
+    fi
+    i=`expr $i - 1`
+  done
+  trap - 1 2 13 15
+  if test $i -le 0; then
+    echo "$0: failed to acquire lock after $numtries attempts" >&2
+    echo "$0: check lockdir '$lockdir'" >&2
+    exit 1
+  fi
 
-  "$@" -MD -MF "$tmpdepfile"
-  stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -297,8 +427,8 @@ icc)
   sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
   # Some versions of the HPUX 10.20 sed can't process this invocation
   # correctly.  Breaking it into two sed invocations is a workaround.
-  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
-    sed -e 's/$/ :/' >> "$depfile"
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
+    sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -309,9 +439,8 @@ hp2)
   # 'foo.d', which lands next to the object file, wherever that
   # happens to be.
   # Much of this is similar to the tru64 case; see comments there.
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
-  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  set_dir_from  "$object"
+  set_base_from "$object"
   if test "$libtool" = yes; then
     tmpdepfile1=$dir$base.d
     tmpdepfile2=$dir.libs/$base.d
@@ -322,8 +451,7 @@ hp2)
     "$@" +Maked
   fi
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
      rm -f "$tmpdepfile1" "$tmpdepfile2"
      exit $stat
   fi
@@ -333,77 +461,107 @@ hp2)
     test -f "$tmpdepfile" && break
   done
   if test -f "$tmpdepfile"; then
-    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
-    # Add `dependent.h:' lines.
+    sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add 'dependent.h:' lines.
     sed -ne '2,${
-              s/^ *//
-              s/ \\*$//
-              s/$/:/
-              p
-            }' "$tmpdepfile" >> "$depfile"
+               s/^ *//
+               s/ \\*$//
+               s/$/:/
+               p
+             }' "$tmpdepfile" >> "$depfile"
   else
-    echo "#dummy" > "$depfile"
+    make_dummy_depfile
   fi
   rm -f "$tmpdepfile" "$tmpdepfile2"
   ;;
 
 tru64)
-   # The Tru64 compiler uses -MD to generate dependencies as a side
-   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
-   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
-   # dependencies in `foo.d' instead, so we check for that too.
-   # Subdirectories are respected.
-   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-   test "x$dir" = "x$object" && dir=
-   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
-
-   if test "$libtool" = yes; then
-      # With Tru64 cc, shared objects can also be used to make a
-      # static library.  This mechanism is used in libtool 1.4 series to
-      # handle both shared and static libraries in a single compilation.
-      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
-      #
-      # With libtool 1.5 this exception was removed, and libtool now
-      # generates 2 separate objects for the 2 libraries.  These two
-      # compilations output dependencies in $dir.libs/$base.o.d and
-      # in $dir$base.o.d.  We have to check for both files, because
-      # one of the two compilations can be disabled.  We should prefer
-      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
-      # automatically cleaned when .libs/ is deleted, while ignoring
-      # the former would cause a distcleancheck panic.
-      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
-      tmpdepfile2=$dir$base.o.d          # libtool 1.5
-      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
-      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
-      "$@" -Wc,-MD
-   else
-      tmpdepfile1=$dir$base.o.d
-      tmpdepfile2=$dir$base.d
-      tmpdepfile3=$dir$base.d
-      tmpdepfile4=$dir$base.d
-      "$@" -MD
-   fi
-
-   stat=$?
-   if test $stat -eq 0; then :
-   else
-      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
-      exit $stat
-   fi
-
-   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
-   do
-     test -f "$tmpdepfile" && break
-   done
-   if test -f "$tmpdepfile"; then
-      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-      # That's a tab and a space in the [].
-      sed -e 's,^.*\.[a-z]*:[   ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
-   else
-      echo "#dummy" > "$depfile"
-   fi
-   rm -f "$tmpdepfile"
-   ;;
+  # The Tru64 compiler uses -MD to generate dependencies as a side
+  # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+  # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+  # dependencies in 'foo.d' instead, so we check for that too.
+  # Subdirectories are respected.
+  set_dir_from  "$object"
+  set_base_from "$object"
+
+  if test "$libtool" = yes; then
+    # Libtool generates 2 separate objects for the 2 libraries.  These
+    # two compilations output dependencies in $dir.libs/$base.o.d and
+    # in $dir$base.o.d.  We have to check for both files, because
+    # one of the two compilations can be disabled.  We should prefer
+    # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+    # automatically cleaned when .libs/ is deleted, while ignoring
+    # the former would cause a distcleancheck panic.
+    tmpdepfile1=$dir$base.o.d          # libtool 1.5
+    tmpdepfile2=$dir.libs/$base.o.d    # Likewise.
+    tmpdepfile3=$dir.libs/$base.d      # Compaq CCC V6.2-504
+    "$@" -Wc,-MD
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    tmpdepfile3=$dir$base.d
+    "$@" -MD
+  fi
+
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  # Same post-processing that is required for AIX mode.
+  aix_post_process_depfile
+  ;;
+
+msvc7)
+  if test "$libtool" = yes; then
+    showIncludes=-Wc,-showIncludes
+  else
+    showIncludes=-showIncludes
+  fi
+  "$@" $showIncludes > "$tmpdepfile"
+  stat=$?
+  grep -v '^Note: including file: ' "$tmpdepfile"
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # The first sed program below extracts the file names and escapes
+  # backslashes for cygpath.  The second sed program outputs the file
+  # name when reading, but also accumulates all include files in the
+  # hold buffer in order to output them again at the end.  This only
+  # works with sed implementations that can handle large buffers.
+  sed < "$tmpdepfile" -n '
+/^Note: including file:  *\(.*\)/ {
+  s//\1/
+  s/\\/\\\\/g
+  p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+  s/.*/'"$tab"'/
+  G
+  p
+}' >> "$depfile"
+  echo >> "$depfile" # make sure the fragment doesn't end with a backslash
+  rm -f "$tmpdepfile"
+  ;;
+
+msvc7msys)
+  # 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,
+  # since it is checked for above.
+  exit 1
+  ;;
 
 #nosideeffect)
   # This comment above is used by automake to tell side-effect
@@ -422,7 +580,7 @@ dashmstdout)
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -442,18 +600,18 @@ dashmstdout)
   done
 
   test -z "$dashmflag" && dashmflag=-M
-  # Require at least two characters before searching for `:'
+  # Require at least two characters before searching for ':'
   # in the target name.  This is to cope with DOS-style filenames:
-  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
   "$@" $dashmflag |
-    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+    sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
   rm -f "$depfile"
   cat < "$tmpdepfile" > "$depfile"
-  tr ' ' '
-' < "$tmpdepfile" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this sed invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -503,12 +661,15 @@ makedepend)
   touch "$tmpdepfile"
   ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
   rm -f "$depfile"
-  cat < "$tmpdepfile" > "$depfile"
-  sed '1,2d' "$tmpdepfile" | tr ' ' '
-' | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  # makedepend may prepend the VPATH from the source file name to the object.
+  # No need to regex-escape $object, excess matching of '.' is harmless.
+  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process the last invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed '1,2d' "$tmpdepfile" \
+    | tr ' ' "$nl" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile" "$tmpdepfile".bak
   ;;
 
@@ -525,7 +686,7 @@ cpp)
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -544,10 +705,10 @@ cpp)
     esac
   done
 
-  "$@" -E |
-    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
-    sed '$ s: \\$::' > "$tmpdepfile"
+  "$@" -E \
+    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+             -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+    sed '$ s: \\$::' > "$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
   cat < "$tmpdepfile" >> "$depfile"
@@ -579,23 +740,23 @@ msvisualcpp)
       shift
       ;;
     "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
-       set fnord "$@"
-       shift
-       shift
-       ;;
+        set fnord "$@"
+        shift
+        shift
+        ;;
     *)
-       set fnord "$@" "$arg"
-       shift
-       shift
-       ;;
+        set fnord "$@" "$arg"
+        shift
+        shift
+        ;;
     esac
   done
   "$@" -E 2>/dev/null |
   sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
-  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::     \1 \\:p' >> "$depfile"
-  echo "       " >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+  echo "$tab" >> "$depfile"
   sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
diff --git a/build/ac-aux/gitlog-to-changelog b/build/ac-aux/gitlog-to-changelog
new file mode 100755 (executable)
index 0000000..d79e7aa
--- /dev/null
@@ -0,0 +1,407 @@
+eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
+  & eval 'exec perl -wS "$0" $argv:q'
+    if 0;
+# Convert git log output to ChangeLog format.
+
+my $VERSION = '2012-07-16 18:34'; # 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-2012 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# 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
+
+use strict;
+use warnings;
+use Getopt::Long;
+use POSIX qw(strftime);
+
+(my $ME = $0) =~ s|.*/||;
+
+# use File::Coda; # http://meyering.net/code/Coda/
+END {
+  defined fileno STDOUT or return;
+  close STDOUT and return;
+  warn "$ME: failed to close standard output: $!\n";
+  $? ||= 1;
+}
+
+sub usage ($)
+{
+  my ($exit_code) = @_;
+  my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
+  if ($exit_code != 0)
+    {
+      print $STREAM "Try '$ME --help' for more information.\n";
+    }
+  else
+    {
+      print $STREAM <<EOF;
+Usage: $ME [OPTIONS] [ARGS]
+
+Convert git log output to ChangeLog format.  If present, any ARGS
+are passed to "git log".  To avoid ARGS being parsed as options to
+$ME, they may be preceded by '--'.
+
+OPTIONS:
+
+   --amend=FILE FILE maps from an SHA1 to perl code (i.e., s/old/new/) that
+                  makes a change to SHA1's commit log text or metadata.
+   --append-dot append a dot to the first line of each commit message if
+                  there is no other punctuation or blank at the end.
+   --no-cluster never cluster commit messages under the same date/author
+                  header; the default is to cluster adjacent commit messages
+                  if their headers are the same and neither commit message
+                  contains multiple paragraphs.
+   --srcdir=DIR the root of the source tree, containing the '.git' directory.
+   --since=DATE convert only the logs since DATE;
+                  the default is to convert all log entries.
+   --format=FMT set format string for commit subject and body;
+                  see 'man git-log' for the list of format metacharacters;
+                  the default is '%s%n%b%n'
+   --strip-tab  remove one additional leading TAB from commit message lines.
+   --strip-cherry-pick  remove data inserted by "git cherry-pick";
+                  this includes the "cherry picked from commit ..." line,
+                  and the possible final "Conflicts:" paragraph.
+   --help       display this help and exit
+   --version    output version information and exit
+
+EXAMPLE:
+
+  $ME --since=2008-01-01 > ChangeLog
+  $ME -- -n 5 foo > last-5-commits-to-branch-foo
+
+SPECIAL SYNTAX:
+
+The following types of strings are interpreted specially when they appear
+at the beginning of a log message line.  They are not copied to the output.
+
+  Copyright-paperwork-exempt: Yes
+    Append the "(tiny change)" notation to the usual "date name email"
+    ChangeLog header to mark a change that does not require a copyright
+    assignment.
+  Co-authored-by: Joe User <user\@example.com>
+    List the specified name and email address on a second
+    ChangeLog header, denoting a co-author.
+  Signed-off-by: Joe User <user\@example.com>
+    These lines are simply elided.
+
+In a FILE specified via --amend, comment lines (starting with "#") are ignored.
+FILE must consist of <SHA,CODE+> pairs where SHA is a 40-byte SHA1 (alone on
+a line) referring to a commit in the current project, and CODE refers to one
+or more consecutive lines of Perl code.  Pairs must be separated by one or
+more blank line.
+
+Here is sample input for use with --amend=FILE, from coreutils:
+
+3a169f4c5d9159283548178668d2fae6fced3030
+# fix typo in title:
+s/all tile types/all file types/
+
+1379ed974f1fa39b12e2ffab18b3f7a607082202
+# Due to a bug in vc-dwim, I mis-attributed a patch by Paul to myself.
+# Change the author to be Paul.  Note the escaped "@":
+s,Jim .*>,Paul Eggert <eggert\\\@cs.ucla.edu>,
+
+EOF
+    }
+  exit $exit_code;
+}
+
+# If the string $S is a well-behaved file name, simply return it.
+# If it contains white space, quotes, etc., quote it, and return the new string.
+sub shell_quote($)
+{
+  my ($s) = @_;
+  if ($s =~ m![^\w+/.,-]!)
+    {
+      # Convert each single quote to '\''
+      $s =~ s/\'/\'\\\'\'/g;
+      # Then single quote the string.
+      $s = "'$s'";
+    }
+  return $s;
+}
+
+sub quoted_cmd(@)
+{
+  return join (' ', map {shell_quote $_} @_);
+}
+
+# Parse file F.
+# Comment lines (starting with "#") are ignored.
+# F must consist of <SHA,CODE+> pairs where SHA is a 40-byte SHA1
+# (alone on a line) referring to a commit in the current project, and
+# CODE refers to one or more consecutive lines of Perl code.
+# Pairs must be separated by one or more blank line.
+sub parse_amend_file($)
+{
+  my ($f) = @_;
+
+  open F, '<', $f
+    or die "$ME: $f: failed to open for reading: $!\n";
+
+  my $fail;
+  my $h = {};
+  my $in_code = 0;
+  my $sha;
+  while (defined (my $line = <F>))
+    {
+      $line =~ /^\#/
+        and next;
+      chomp $line;
+      $line eq ''
+        and $in_code = 0, next;
+
+      if (!$in_code)
+        {
+          $line =~ /^([0-9a-fA-F]{40})$/
+            or (warn "$ME: $f:$.: invalid line; expected an SHA1\n"),
+              $fail = 1, next;
+          $sha = lc $1;
+          $in_code = 1;
+          exists $h->{$sha}
+            and (warn "$ME: $f:$.: duplicate SHA1\n"),
+              $fail = 1, next;
+        }
+      else
+        {
+          $h->{$sha} ||= '';
+          $h->{$sha} .= "$line\n";
+        }
+    }
+  close F;
+
+  $fail
+    and exit 1;
+
+  return $h;
+}
+
+{
+  my $since_date;
+  my $format_string = '%s%n%b%n';
+  my $amend_file;
+  my $append_dot = 0;
+  my $cluster = 1;
+  my $strip_tab = 0;
+  my $strip_cherry_pick = 0;
+  my $srcdir;
+  GetOptions
+    (
+     help => sub { usage 0 },
+     version => sub { print "$ME version $VERSION\n"; exit },
+     'since=s' => \$since_date,
+     'format=s' => \$format_string,
+     'amend=s' => \$amend_file,
+     'append-dot' => \$append_dot,
+     'cluster!' => \$cluster,
+     'strip-tab' => \$strip_tab,
+     'strip-cherry-pick' => \$strip_cherry_pick,
+     'srcdir=s' => \$srcdir,
+    ) or usage 1;
+
+  defined $since_date
+    and unshift @ARGV, "--since=$since_date";
+
+  # This is a hash that maps an SHA1 to perl code (i.e., s/old/new/)
+  # that makes a correction in the log or attribution of that commit.
+  my $amend_code = defined $amend_file ? parse_amend_file $amend_file : {};
+
+  my @cmd = ('git',
+             defined $srcdir ? ("--git-dir=$srcdir/.git") : (),
+             qw(log --log-size),
+             '--pretty=format:%H:%ct  %an  <%ae>%n%n'.$format_string, @ARGV);
+  open PIPE, '-|', @cmd
+    or die ("$ME: failed to run '". quoted_cmd (@cmd) ."': $!\n"
+            . "(Is your Git too old?  Version 1.5.1 or later is required.)\n");
+
+  my $prev_multi_paragraph;
+  my $prev_date_line = '';
+  my @prev_coauthors = ();
+  while (1)
+    {
+      defined (my $in = <PIPE>)
+        or last;
+      $in =~ /^log size (\d+)$/
+        or die "$ME:$.: Invalid line (expected log size):\n$in";
+      my $log_nbytes = $1;
+
+      my $log;
+      my $n_read = read PIPE, $log, $log_nbytes;
+      $n_read == $log_nbytes
+        or die "$ME:$.: unexpected EOF\n";
+
+      # Extract leading hash.
+      my ($sha, $rest) = split ':', $log, 2;
+      defined $sha
+        or die "$ME:$.: malformed log entry\n";
+      $sha =~ /^[0-9a-fA-F]{40}$/
+        or die "$ME:$.: invalid SHA1: $sha\n";
+
+      # If this commit's log requires any transformation, do it now.
+      my $code = $amend_code->{$sha};
+      if (defined $code)
+        {
+          eval 'use Safe';
+          my $s = new Safe;
+          # Put the unpreprocessed entry into "$_".
+          $_ = $rest;
+
+          # Let $code operate on it, safely.
+          my $r = $s->reval("$code")
+            or die "$ME:$.:$sha: failed to eval \"$code\":\n$@\n";
+
+          # Note that we've used this entry.
+          delete $amend_code->{$sha};
+
+          # Update $rest upon success.
+          $rest = $_;
+        }
+
+      # Remove lines inserted by "git cherry-pick".
+      if ($strip_cherry_pick)
+        {
+          $rest =~ s/^\s*Conflicts:\n.*//sm;
+          $rest =~ s/^\s*\(cherry picked from commit [\da-f]+\)\n//m;
+        }
+
+      my @line = split "\n", $rest;
+      my $author_line = shift @line;
+      defined $author_line
+        or die "$ME:$.: unexpected EOF\n";
+      $author_line =~ /^(\d+)  (.*>)$/
+        or die "$ME:$.: Invalid line "
+          . "(expected date/author/email):\n$author_line\n";
+
+      # Format 'Copyright-paperwork-exempt: Yes' as a standard ChangeLog
+      # `(tiny change)' annotation.
+      my $tiny = (grep (/^Copyright-paperwork-exempt:\s+[Yy]es$/, @line)
+                  ? '  (tiny change)' : '');
+
+      my $date_line = sprintf "%s  %s$tiny\n",
+        strftime ("%F", localtime ($1)), $2;
+
+      my @coauthors = grep /^Co-authored-by:.*$/, @line;
+      # Omit meta-data lines we've already interpreted.
+      @line = grep !/^(?:Signed-off-by:[ ].*>$
+                       |Co-authored-by:[ ]
+                       |Copyright-paperwork-exempt:[ ]
+                       )/x, @line;
+
+      # Remove leading and trailing blank lines.
+      if (@line)
+        {
+          while ($line[0] =~ /^\s*$/) { shift @line; }
+          while ($line[$#line] =~ /^\s*$/) { pop @line; }
+        }
+
+      # Record whether there are two or more paragraphs.
+      my $multi_paragraph = grep /^\s*$/, @line;
+
+      # Format 'Co-authored-by: A U Thor <email@example.com>' lines in
+      # standard multi-author ChangeLog format.
+      for (@coauthors)
+        {
+          s/^Co-authored-by:\s*/\t    /;
+          s/\s*</  </;
+
+          /<.*?@.*\..*>/
+            or warn "$ME: warning: missing email address for "
+              . substr ($_, 5) . "\n";
+        }
+
+      # If clustering of commit messages has been disabled, if this header
+      # would be different from the previous date/name/email/coauthors header,
+      # or if this or the previous entry consists of two or more paragraphs,
+      # then print the header.
+      if ( ! $cluster
+          || $date_line ne $prev_date_line
+          || "@coauthors" ne "@prev_coauthors"
+          || $multi_paragraph
+          || $prev_multi_paragraph)
+        {
+          $prev_date_line eq ''
+            or print "\n";
+          print $date_line;
+          @coauthors
+            and print join ("\n", @coauthors), "\n";
+        }
+      $prev_date_line = $date_line;
+      @prev_coauthors = @coauthors;
+      $prev_multi_paragraph = $multi_paragraph;
+
+      # If there were any lines
+      if (@line == 0)
+        {
+          warn "$ME: warning: empty commit message:\n  $date_line\n";
+        }
+      else
+        {
+          if ($append_dot)
+            {
+              # If the first line of the message has enough room, then
+              if (length $line[0] < 72)
+                {
+                  # append a dot if there is no other punctuation or blank
+                  # at the end.
+                  $line[0] =~ /[[:punct:]\s]$/
+                    or $line[0] .= '.';
+                }
+            }
+
+          # Remove one additional leading TAB from each line.
+          $strip_tab
+            and map { s/^\t// } @line;
+
+          # Prefix each non-empty line with a TAB.
+          @line = map { length $_ ? "\t$_" : '' } @line;
+
+          print "\n", join ("\n", @line), "\n";
+        }
+
+      defined ($in = <PIPE>)
+        or last;
+      $in ne "\n"
+        and die "$ME:$.: unexpected line:\n$in";
+    }
+
+  close PIPE
+    or die "$ME: error closing pipe from " . quoted_cmd (@cmd) . "\n";
+  # FIXME-someday: include $PROCESS_STATUS in the diagnostic
+
+  # Complain about any unused entry in the --amend=F specified file.
+  my $fail = 0;
+  foreach my $sha (keys %$amend_code)
+    {
+      warn "$ME:$amend_file: unused entry: $sha\n";
+      $fail = 1;
+    }
+
+  exit $fail;
+}
+
+# Local Variables:
+# mode: perl
+# indent-tabs-mode: nil
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "my $VERSION = '"
+# time-stamp-format: "%:y-%02m-%02d %02H:%02M"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "'; # UTC"
+# End:
similarity index 94%
rename from build/aux/install-sh
rename to build/ac-aux/install-sh
index 6781b98..377bb86 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2011-11-20.07; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -35,7 +35,7 @@ scriptversion=2009-04-28.21; # UTC
 # FSF changes to this file are in the public domain.
 #
 # Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
+# 'make' implicit rules from creating a file called install from it
 # when there is no Makefile.
 #
 # This script is compatible with the BSD install script, but was written
@@ -156,6 +156,10 @@ while test $# -ne 0; do
     -s) stripcmd=$stripprog;;
 
     -t) dst_arg=$2
+       # Protect names problematic for 'test' and other utilities.
+       case $dst_arg in
+         -* | [=\(\)!]) dst_arg=./$dst_arg;;
+       esac
        shift;;
 
     -T) no_target_directory=true;;
@@ -186,6 +190,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
     fi
     shift # arg
     dst_arg=$arg
+    # Protect names problematic for 'test' and other utilities.
+    case $dst_arg in
+      -* | [=\(\)!]) dst_arg=./$dst_arg;;
+    esac
   done
 fi
 
@@ -194,13 +202,17 @@ if test $# -eq 0; then
     echo "$0: no input file specified." >&2
     exit 1
   fi
-  # It's OK to call `install-sh -d' without argument.
+  # It's OK to call 'install-sh -d' without argument.
   # This can happen when creating conditional directories.
   exit 0
 fi
 
 if test -z "$dir_arg"; then
-  trap '(exit $?); exit' 1 2 13 15
+  do_exit='(exit $ret); exit $ret'
+  trap "ret=129; $do_exit" 1
+  trap "ret=130; $do_exit" 2
+  trap "ret=141; $do_exit" 13
+  trap "ret=143; $do_exit" 15
 
   # Set umask so as not to create temps with too-generous modes.
   # However, 'strip' requires both read and write access to temps.
@@ -228,9 +240,9 @@ fi
 
 for src
 do
-  # Protect names starting with `-'.
+  # Protect names problematic for 'test' and other utilities.
   case $src in
-    -*) src=./$src;;
+    -* | [=\(\)!]) src=./$src;;
   esac
 
   if test -n "$dir_arg"; then
@@ -252,12 +264,7 @@ do
       echo "$0: no destination specified." >&2
       exit 1
     fi
-
     dst=$dst_arg
-    # Protect names starting with `-'.
-    case $dst in
-      -*) dst=./$dst;;
-    esac
 
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
@@ -347,7 +354,7 @@ do
              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-writeable bit of parent directory when it shouldn't.
+                  # 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
@@ -385,7 +392,7 @@ do
 
       case $dstdir in
        /*) prefix='/';;
-       -*) prefix='./';;
+       [-=\(\)!]*) prefix='./';;
        *)  prefix='';;
       esac
 
@@ -403,7 +410,7 @@ do
 
       for d
       do
-       test -z "$d" && continue
+       test X"$d" = X && continue
 
        prefix=$prefix$d
        if test -d "$prefix"; then
old mode 100755 (executable)
new mode 100644 (file)
similarity index 99%
rename from build/aux/ltmain.sh
rename to build/ac-aux/ltmain.sh
index aa5624c..63ae69d
@@ -1,9 +1,9 @@
 
-# libtool (GNU libtool) 2.4
+# libtool (GNU libtool) 2.4.2
 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# 2007, 2008, 2009, 2010, 2011 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.
 
@@ -41,6 +41,7 @@
 #       --quiet, --silent    don't print informational messages
 #       --no-quiet, --no-silent
 #                            print informational messages (default)
+#       --no-warn            don't display warning messages
 #       --tag=TAG            use configuration variables from tag TAG
 #   -v, --verbose            print more informational messages than default
 #       --no-verbose         don't print the extra informational messages
@@ -69,7 +70,7 @@
 #         compiler:            $LTCC
 #         compiler flags:              $LTCFLAGS
 #         linker:              $LD (gnu? $with_gnu_ld)
-#         $progname:   (GNU libtool) 2.4
+#         $progname:   (GNU libtool) 2.4.2
 #         automake:    $automake_version
 #         autoconf:    $autoconf_version
 #
@@ -79,9 +80,9 @@
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION=2.4
+VERSION=2.4.2
 TIMESTAMP=""
-package_revision=1.3293
+package_revision=1.3337
 
 # Be Bourne compatible
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
@@ -136,15 +137,10 @@ progpath="$0"
 
 : ${CP="cp -f"}
 test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
-: ${EGREP="/bin/grep -E"}
-: ${FGREP="/bin/grep -F"}
-: ${GREP="/bin/grep"}
-: ${LN_S="ln -s"}
 : ${MAKE="make"}
 : ${MKDIR="mkdir"}
 : ${MV="mv -f"}
 : ${RM="rm -f"}
-: ${SED="/bin/sed"}
 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
 : ${Xsed="$SED -e 1s/^X//"}
 
@@ -387,7 +383,7 @@ case $progpath in
      ;;
   *)
      save_IFS="$IFS"
-     IFS=:
+     IFS=${PATH_SEPARATOR-:}
      for progdir in $PATH; do
        IFS="$save_IFS"
        test -x "$progdir/$progname" && break
@@ -771,8 +767,8 @@ func_help ()
        s*\$LTCFLAGS*'"$LTCFLAGS"'*
        s*\$LD*'"$LD"'*
        s/\$with_gnu_ld/'"$with_gnu_ld"'/
-       s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
-       s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+       s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
+       s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
        p
        d
      }
@@ -1052,6 +1048,7 @@ opt_finish=false
 opt_help=false
 opt_help_all=false
 opt_silent=:
+opt_warning=:
 opt_verbose=:
 opt_silent=false
 opt_verbose=false
@@ -1120,6 +1117,10 @@ esac
                        opt_silent=false
 func_append preserve_args " $opt"
                        ;;
+      --no-warning|--no-warn)
+                       opt_warning=false
+func_append preserve_args " $opt"
+                       ;;
       --no-verbose)
                        opt_verbose=false
 func_append preserve_args " $opt"
@@ -2059,7 +2060,7 @@ func_mode_compile ()
     *.[cCFSifmso] | \
     *.ada | *.adb | *.ads | *.asm | \
     *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
-    *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
+    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
       func_xform "$libobj"
       libobj=$func_xform_result
       ;;
@@ -3201,11 +3202,13 @@ func_mode_install ()
 
       # Set up the ranlib parameters.
       oldlib="$destdir/$name"
+      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+      tool_oldlib=$func_to_tool_file_result
 
       func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
 
       if test -n "$stripme" && test -n "$old_striplib"; then
-       func_show_eval "$old_striplib $oldlib" 'exit $?'
+       func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
       fi
 
       # Do each command in the postinstall commands.
@@ -3470,7 +3473,7 @@ static const void *lt_preloaded_setup() {
          # linked before any other PIC object.  But we must not use
          # pic_flag when linking with -static.  The problem exists in
          # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
-         *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+         *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
            pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
          *-*-hpux*)
            pic_flag_for_symtable=" $pic_flag"  ;;
@@ -3982,14 +3985,17 @@ func_exec_program_core ()
 # launches target application with the remaining arguments.
 func_exec_program ()
 {
-  for lt_wr_arg
-  do
-    case \$lt_wr_arg in
-    --lt-*) ;;
-    *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
-    esac
-    shift
-  done
+  case \" \$* \" in
+  *\\ --lt-*)
+    for lt_wr_arg
+    do
+      case \$lt_wr_arg in
+      --lt-*) ;;
+      *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+      esac
+      shift
+    done ;;
+  esac
   func_exec_program_core \${1+\"\$@\"}
 }
 
@@ -5057,9 +5063,15 @@ void lt_dump_script (FILE* f)
 {
 EOF
            func_emit_wrapper yes |
-              $SED -e 's/\([\\"]\)/\\\1/g' \
-                  -e 's/^/  fputs ("/' -e 's/$/\\n", f);/'
-
+             $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/  fputs ("\1", f);/p
+g
+D'
             cat <<"EOF"
 }
 EOF
@@ -5643,7 +5655,8 @@ func_mode_link ()
        continue
        ;;
 
-      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+      |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
        func_append compiler_flags " $arg"
        func_append compile_command " $arg"
        func_append finalize_command " $arg"
@@ -6147,7 +6160,8 @@ func_mode_link ()
        lib=
        found=no
        case $deplib in
-       -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+       -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
          if test "$linkmode,$pass" = "prog,link"; then
            compile_deplibs="$deplib $compile_deplibs"
            finalize_deplibs="$deplib $finalize_deplibs"
@@ -6831,7 +6845,7 @@ func_mode_link ()
                 test "$hardcode_direct_absolute" = no; then
                add="$dir/$linklib"
              elif test "$hardcode_minus_L" = yes; then
-               add_dir="-L$dir"
+               add_dir="-L$absdir"
                # Try looking first in the location we're being installed to.
                if test -n "$inst_prefix_dir"; then
                  case $libdir in
@@ -7316,6 +7330,7 @@ func_mode_link ()
          # which has an extra 1 added just for fun
          #
          case $version_type in
+         # correct linux to gnu/linux during the next big refactor
          darwin|linux|osf|windows|none)
            func_arith $number_major + $number_minor
            current=$func_arith_result
@@ -7432,7 +7447,7 @@ func_mode_link ()
          versuffix="$major.$revision"
          ;;
 
-       linux)
+       linux) # correct to gnu/linux during the next big refactor
          func_arith $current - $age
          major=.$func_arith_result
          versuffix="$major.$age.$revision"
@@ -8020,6 +8035,11 @@ EOF
 
       # Test again, we may have decided not to build it any more
       if test "$build_libtool_libs" = yes; then
+       # Remove ${wl} instances when linking with ld.
+       # FIXME: should test the right _cmds variable.
+       case $archive_cmds in
+         *\$LD\ *) wl= ;;
+        esac
        if test "$hardcode_into_libs" = yes; then
          # Hardcode the library paths
          hardcode_libdirs=
@@ -8050,7 +8070,7 @@ EOF
            elif test -n "$runpath_var"; then
              case "$perm_rpath " in
              *" $libdir "*) ;;
-             *) func_apped perm_rpath " $libdir" ;;
+             *) func_append perm_rpath " $libdir" ;;
              esac
            fi
          done
@@ -8058,11 +8078,7 @@ EOF
          if test -n "$hardcode_libdir_separator" &&
             test -n "$hardcode_libdirs"; then
            libdir="$hardcode_libdirs"
-           if test -n "$hardcode_libdir_flag_spec_ld"; then
-             eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
-           else
-             eval dep_rpath=\"$hardcode_libdir_flag_spec\"
-           fi
+           eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
          fi
          if test -n "$runpath_var" && test -n "$perm_rpath"; then
            # We should set the runpath_var.
@@ -9152,6 +9168,8 @@ EOF
            esac
          done
        fi
+       func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+       tool_oldlib=$func_to_tool_file_result
        eval cmds=\"$old_archive_cmds\"
 
        func_len " $cmds"
@@ -9261,7 +9279,8 @@ EOF
              *.la)
                func_basename "$deplib"
                name="$func_basename_result"
-               eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+               func_resolve_sysroot "$deplib"
+               eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
                test -z "$libdir" && \
                  func_fatal_error "\`$deplib' is not a valid libtool archive"
                func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
diff --git a/build/ac-aux/missing b/build/ac-aux/missing
new file mode 100755 (executable)
index 0000000..cdea514
--- /dev/null
@@ -0,0 +1,215 @@
+#! /bin/sh
+# Common wrapper for a few potentially missing GNU programs.
+
+scriptversion=2012-06-26.16; # UTC
+
+# Copyright (C) 1996-2013 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
+# 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.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try '$0 --help' for more information"
+  exit 1
+fi
+
+case $1 in
+
+  --is-lightweight)
+    # Used by our autoconf macros to check whether the available missing
+    # script is modern enough.
+    exit 0
+    ;;
+
+  --run)
+    # Back-compat with the calling convention used by older automake.
+    shift
+    ;;
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+
+Supported PROGRAM values:
+  aclocal   autoconf  autoheader   autom4te  automake  makeinfo
+  bison     yacc      flex         lex       help2man
+
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: unknown '$1' option"
+    echo 1>&2 "Try '$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch.  This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+  msg="probably too old"
+elif test $st -eq 127; then
+  # Program was missing.
+  msg="missing on your system"
+else
+  # Program was found and executed, but failed.  Give up.
+  exit $st
+fi
+
+perl_URL=http://www.perl.org/
+flex_URL=http://flex.sourceforge.net/
+gnu_software_URL=http://www.gnu.org/software
+
+program_details ()
+{
+  case $1 in
+    aclocal|automake)
+      echo "The '$1' program is part of the GNU Automake package:"
+      echo "<$gnu_software_URL/automake>"
+      echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/autoconf>"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+    autoconf|autom4te|autoheader)
+      echo "The '$1' program is part of the GNU Autoconf package:"
+      echo "<$gnu_software_URL/autoconf/>"
+      echo "It also requires GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+  esac
+}
+
+give_advice ()
+{
+  # Normalize program name to check for.
+  normalized_program=`echo "$1" | sed '
+    s/^gnu-//; t
+    s/^gnu//; t
+    s/^g//; t'`
+
+  printf '%s\n' "'$1' is $msg."
+
+  configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+  case $normalized_program in
+    autoconf*)
+      echo "You should only need it if you modified 'configure.ac',"
+      echo "or m4 files included by it."
+      program_details 'autoconf'
+      ;;
+    autoheader*)
+      echo "You should only need it if you modified 'acconfig.h' or"
+      echo "$configure_deps."
+      program_details 'autoheader'
+      ;;
+    automake*)
+      echo "You should only need it if you modified 'Makefile.am' or"
+      echo "$configure_deps."
+      program_details 'automake'
+      ;;
+    aclocal*)
+      echo "You should only need it if you modified 'acinclude.m4' or"
+      echo "$configure_deps."
+      program_details 'aclocal'
+      ;;
+   autom4te*)
+      echo "You might have modified some maintainer files that require"
+      echo "the 'automa4te' program to be rebuilt."
+      program_details 'autom4te'
+      ;;
+    bison*|yacc*)
+      echo "You should only need it if you modified a '.y' file."
+      echo "You may want to install the GNU Bison package:"
+      echo "<$gnu_software_URL/bison/>"
+      ;;
+    lex*|flex*)
+      echo "You should only need it if you modified a '.l' file."
+      echo "You may want to install the Fast Lexical Analyzer package:"
+      echo "<$flex_URL>"
+      ;;
+    help2man*)
+      echo "You should only need it if you modified a dependency" \
+           "of a man page."
+      echo "You may want to install the GNU Help2man package:"
+      echo "<$gnu_software_URL/help2man/>"
+    ;;
+    makeinfo*)
+      echo "You should only need it if you modified a '.texi' file, or"
+      echo "any other file indirectly affecting the aspect of the manual."
+      echo "You might want to install the Texinfo package:"
+      echo "<$gnu_software_URL/texinfo/>"
+      echo "The spurious makeinfo call might also be the consequence of"
+      echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+      echo "want to install GNU make:"
+      echo "<$gnu_software_URL/make/>"
+      ;;
+    *)
+      echo "You might have modified some files without having the proper"
+      echo "tools for further handling them.  Check the 'README' file, it"
+      echo "often tells you about the needed prerequisites for installing"
+      echo "this package.  You may also peek at any GNU archive site, in"
+      echo "case some other package contains this missing '$1' program."
+      ;;
+  esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+                       -e '2,$s/^/         /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
similarity index 80%
rename from build/aux/move-if-change
rename to build/ac-aux/move-if-change
index a542417..fb6a451 100755 (executable)
@@ -2,13 +2,13 @@
 # Like mv $1 $2, but if the files are the same, just delete $1.
 # Status is zero if successful, nonzero otherwise.
 
-VERSION='2007-09-28 23:10'; # UTC
+VERSION='2011-01-28 20: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-2007 Free Software Foundation, Inc.
+# Copyright (C) 2002-2007, 2009-2012 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -32,15 +32,18 @@ If SOURCE is different than DEST, then move it to DEST; else remove SOURCE.
   --help     display this help and exit
   --version  output version information and exit
 
+The variable CMPPROG can be used to specify an alternative to \`cmp'.
+
 Report bugs to <bug-gnulib@gnu.org>."
 
 version=`expr "$VERSION" : '\([^ ]*\)'`
 version="move-if-change (gnulib) $version
-Copyright (C) 2007 Free Software Foundation, Inc.
+Copyright (C) 2011 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later <http://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."
 
+cmpprog=${CMPPROG-cmp}
 
 for arg
 do
@@ -60,12 +63,15 @@ do
   esac
 done
 
-test $# = 2 || { echo "$0: $usage" >&2; exit 1; }
+test $# -eq 2 || { echo "$0: $usage" >&2; exit 1; }
 
-if test -r "$2" && cmp -s -- "$1" "$2"; then
+if test -r "$2" && $cmpprog -- "$1" "$2" >/dev/null; then
   rm -f -- "$1"
 else
-  mv -f -- "$1" "$2"
+  if mv -f -- "$1" "$2"; then :; else
+    # Ignore failure due to a concurrent move-if-change.
+    test -r "$2" && $cmpprog -- "$1" "$2" >/dev/null && rm -f -- "$1"
+  fi
 fi
 
 ## Local Variables:
diff --git a/build/ac-aux/snippet/_Noreturn.h b/build/ac-aux/snippet/_Noreturn.h
new file mode 100644 (file)
index 0000000..c44ad89
--- /dev/null
@@ -0,0 +1,10 @@
+#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
similarity index 95%
rename from build/aux/arg-nonnull.h
rename to build/ac-aux/snippet/arg-nonnull.h
index 6c2f1e8..3a9dd26 100644 (file)
@@ -1,5 +1,5 @@
 /* A C macro for declaring that specific arguments must not be NULL.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published
similarity index 99%
rename from build/aux/c++defs.h
rename to build/ac-aux/snippet/c++defs.h
index b6821a6..96da94b 100644 (file)
@@ -1,5 +1,5 @@
 /* C++ compatible function declaration macros.
-   Copyright (C) 2010-2011 Free Software Foundation, Inc.
+   Copyright (C) 2010-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published
similarity index 96%
rename from build/aux/unused-parameter.h
rename to build/ac-aux/snippet/unused-parameter.h
index c8d2071..1c8d61f 100644 (file)
@@ -1,5 +1,5 @@
 /* A C macro for declaring that specific function parameters are not used.
-   Copyright (C) 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published
similarity index 98%
rename from build/aux/warn-on-use.h
rename to build/ac-aux/snippet/warn-on-use.h
index 2cdeec3..d4cb94f 100644 (file)
@@ -1,5 +1,5 @@
 /* A C macro for emitting warnings if a function is used.
-   Copyright (C) 2010-2011 Free Software Foundation, Inc.
+   Copyright (C) 2010-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published
diff --git a/build/ac-aux/test-driver b/build/ac-aux/test-driver
new file mode 100755 (executable)
index 0000000..32bf39e
--- /dev/null
@@ -0,0 +1,127 @@
+#! /bin/sh
+# test-driver - basic testsuite driver script.
+
+scriptversion=2012-06-27.10; # UTC
+
+# Copyright (C) 2011-2013 Free Software Foundation, Inc.
+#
+# This program is free software; you can 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>.
+
+# Make unconditional expansion of undefined variables an error.  This
+# helps a lot in preventing typo-related bugs.
+set -u
+
+usage_error ()
+{
+  echo "$0: $*" >&2
+  print_usage >&2
+  exit 2
+}
+
+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-SCRIPT
+The '--test-name', '--log-file' and '--trs-file' options are mandatory.
+END
+}
+
+# TODO: better error handling in option parsing (in particular, ensure
+# TODO: $log_file, $trs_file and $test_name are defined).
+test_name= # Used for reporting.
+log_file=  # Where to save the output of the test script.
+trs_file=  # Where to save the metadata of the test run.
+expect_failure=no
+color_tests=no
+enable_hard_errors=yes
+while test $# -gt 0; do
+  case $1 in
+  --help) print_usage; exit $?;;
+  --version) echo "test-driver $scriptversion"; exit $?;;
+  --test-name) test_name=$2; shift;;
+  --log-file) log_file=$2; shift;;
+  --trs-file) trs_file=$2; shift;;
+  --color-tests) color_tests=$2; shift;;
+  --expect-failure) expect_failure=$2; shift;;
+  --enable-hard-errors) enable_hard_errors=$2; shift;;
+  --) shift; break;;
+  -*) usage_error "invalid option: '$1'";;
+  esac
+  shift
+done
+
+if test $color_tests = yes; then
+  # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
+  red='\e[0;31m' # Red.
+  grn='\e[0;32m' # Green.
+  lgn='\e[1;32m' # Light green.
+  blu='\e[1;34m' # Blue.
+  mgn='\e[0;35m' # Magenta.
+  std='\e[m'     # No color.
+else
+  red= grn= lgn= blu= mgn= std=
+fi
+
+do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
+trap "st=129; $do_exit" 1
+trap "st=130; $do_exit" 2
+trap "st=141; $do_exit" 13
+trap "st=143; $do_exit" 15
+
+# Test script is run here.
+"$@" >$log_file 2>&1
+estatus=$?
+if test $enable_hard_errors = no && test $estatus -eq 99; then
+  estatus=1
+fi
+
+case $estatus:$expect_failure in
+  0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
+  0:*)   col=$grn res=PASS  recheck=no  gcopy=no;;
+  77:*)  col=$blu res=SKIP  recheck=no  gcopy=yes;;
+  99:*)  col=$mgn res=ERROR recheck=yes gcopy=yes;;
+  *:yes) col=$lgn res=XFAIL recheck=no  gcopy=yes;;
+  *:*)   col=$red res=FAIL  recheck=yes gcopy=yes;;
+esac
+
+# Report outcome to console.
+echo "${col}${res}${std}: $test_name"
+
+# Register the test result, and other relevant metadata.
+echo ":test-result: $res" > $trs_file
+echo ":global-test-result: $res" >> $trs_file
+echo ":recheck: $recheck" >> $trs_file
+echo ":copy-in-global-log: $gcopy" >> $trs_file
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build/ac-aux/ylwrap b/build/ac-aux/ylwrap
new file mode 100755 (executable)
index 0000000..1c4d776
--- /dev/null
@@ -0,0 +1,249 @@
+#! /bin/sh
+# ylwrap - wrapper for lex/yacc invocations.
+
+scriptversion=2012-12-21.17; # UTC
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# Written by Tom Tromey <tromey@cygnus.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, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# 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>.
+
+get_dirname ()
+{
+  case $1 in
+    */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';;
+    # Otherwise,  we want the empty string (not ".").
+  esac
+}
+
+# guard FILE
+# ----------
+# The CPP macro used to guard inclusion of FILE.
+guard()
+{
+  printf '%s\n' "$1"                                                    \
+    | sed                                                               \
+        -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'   \
+        -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'                        \
+        -e 's/__*/_/g'
+}
+
+# quote_for_sed [STRING]
+# ----------------------
+# Return STRING (or stdin) quoted to be used as a sed pattern.
+quote_for_sed ()
+{
+  case $# in
+    0) cat;;
+    1) printf '%s\n' "$1";;
+  esac \
+    | sed -e 's|[][\\.*]|\\&|g'
+}
+
+case "$1" in
+  '')
+    echo "$0: No files given.  Try '$0 --help' for more information." 1>&2
+    exit 1
+    ;;
+  --basedir)
+    basedir=$2
+    shift 2
+    ;;
+  -h|--h*)
+    cat <<\EOF
+Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...
+
+Wrapper for lex/yacc invocations, renaming files as desired.
+
+  INPUT is the input file
+  OUTPUT is one file PROG generates
+  DESIRED is the file we actually want instead of OUTPUT
+  PROGRAM is program to run
+  ARGS are passed to PROG
+
+Any number of OUTPUT,DESIRED pairs may be used.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v|--v*)
+    echo "ylwrap $scriptversion"
+    exit $?
+    ;;
+esac
+
+
+# The input.
+input="$1"
+shift
+# We'll later need for a correct munging of "#line" directives.
+input_sub_rx=`get_dirname "$input" | quote_for_sed`
+case "$input" in
+  [\\/]* | ?:[\\/]*)
+    # Absolute path; do nothing.
+    ;;
+  *)
+    # Relative path.  Make it absolute.
+    input="`pwd`/$input"
+    ;;
+esac
+input_rx=`get_dirname "$input" | quote_for_sed`
+
+# Since DOS filename conventions don't allow two dots,
+# the DOS version of Bison writes out y_tab.c instead of y.tab.c
+# and y_tab.h instead of y.tab.h. Test to see if this is the case.
+y_tab_nodot=false
+if test -f y_tab.c || test -f y_tab.h; then
+  y_tab_nodot=true
+fi
+
+# The parser itself, the first file, is the destination of the .y.c
+# rule in the Makefile.
+parser=$1
+
+# A sed program to s/FROM/TO/g for all the FROM/TO so that, for
+# instance, we rename #include "y.tab.h" into #include "parse.h"
+# during the conversion from y.tab.c to parse.c.
+sed_fix_filenames=
+
+# Also rename header guards, as Bison 2.7 for instance uses its header
+# guard in its implementation file.
+sed_fix_header_guards=
+
+while test "$#" -ne 0; do
+  if test "$1" = "--"; then
+    shift
+    break
+  fi
+  from=$1
+  # Handle y_tab.c and y_tab.h output by DOS
+  if $y_tab_nodot; then
+    case $from in
+      "y.tab.c") from=y_tab.c;;
+      "y.tab.h") from=y_tab.h;;
+    esac
+  fi
+  shift
+  to=$1
+  shift
+  sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;"
+  sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;"
+done
+
+# The program to run.
+prog="$1"
+shift
+# Make any relative path in $prog absolute.
+case "$prog" in
+  [\\/]* | ?:[\\/]*) ;;
+  *[\\/]*) prog="`pwd`/$prog" ;;
+esac
+
+# FIXME: add hostname here for parallel makes that run commands on
+# other machines.  But that might take us over the 14-char limit.
+dirname=ylwrap$$
+do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret'
+trap "ret=129; $do_exit" 1
+trap "ret=130; $do_exit" 2
+trap "ret=141; $do_exit" 13
+trap "ret=143; $do_exit" 15
+mkdir $dirname || exit 1
+
+cd $dirname
+
+case $# in
+  0) "$prog" "$input" ;;
+  *) "$prog" "$@" "$input" ;;
+esac
+ret=$?
+
+if test $ret -eq 0; then
+  for from in *
+  do
+    to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"`
+    if test -f "$from"; then
+      # If $2 is an absolute path name, then just use that,
+      # otherwise prepend '../'.
+      case $to in
+        [\\/]* | ?:[\\/]*) target=$to;;
+        *) target="../$to";;
+      esac
+
+      # Do not overwrite unchanged header files to avoid useless
+      # recompilations.  Always update the parser itself: it is the
+      # destination of the .y.c rule in the Makefile.  Divert the
+      # output of all other files to a temporary file so we can
+      # compare them to existing versions.
+      if test $from != $parser; then
+        realtarget="$target"
+        target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'`
+      fi
+
+      # Munge "#line" or "#" directives.  Don't let the resulting
+      # debug information point at an absolute srcdir.  Use the real
+      # output file name, not yy.lex.c for instance.  Adjust the
+      # include guards too.
+      sed -e "/^#/!b"                           \
+          -e "s|$input_rx|$input_sub_rx|"       \
+          -e "$sed_fix_filenames"               \
+          -e "$sed_fix_header_guards"           \
+        "$from" >"$target" || ret=$?
+
+      # Check whether files must be updated.
+      if test "$from" != "$parser"; then
+        if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
+          echo "$to is unchanged"
+          rm -f "$target"
+        else
+          echo "updating $to"
+          mv -f "$target" "$realtarget"
+        fi
+      fi
+    else
+      # A missing file is only an error for the parser.  This is a
+      # blatant hack to let us support using "yacc -d".  If -d is not
+      # specified, don't fail when the header file is "missing".
+      if test "$from" = "$parser"; then
+        ret=1
+      fi
+    fi
+  done
+fi
+
+# Remove the directory.
+cd ..
+rm -rf $dirname
+
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build/aux/gitlog-to-changelog b/build/aux/gitlog-to-changelog
deleted file mode 100755 (executable)
index 4559704..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
-  & eval 'exec perl -wS "$0" $argv:q'
-    if 0;
-# Convert git log output to ChangeLog format.
-
-my $VERSION = '2009-10-30 13:46'; # 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-2011 Free Software Foundation, Inc.
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# 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
-
-use strict;
-use warnings;
-use Getopt::Long;
-use POSIX qw(strftime);
-
-(my $ME = $0) =~ s|.*/||;
-
-# use File::Coda; # http://meyering.net/code/Coda/
-END {
-  defined fileno STDOUT or return;
-  close STDOUT and return;
-  warn "$ME: failed to close standard output: $!\n";
-  $? ||= 1;
-}
-
-sub usage ($)
-{
-  my ($exit_code) = @_;
-  my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
-  if ($exit_code != 0)
-    {
-      print $STREAM "Try `$ME --help' for more information.\n";
-    }
-  else
-    {
-      print $STREAM <<EOF;
-Usage: $ME [OPTIONS] [ARGS]
-
-Convert git log output to ChangeLog format.  If present, any ARGS
-are passed to "git log".  To avoid ARGS being parsed as options to
-$ME, they may be preceded by '--'.
-
-OPTIONS:
-
-   --since=DATE convert only the logs since DATE;
-                  the default is to convert all log entries.
-   --format=FMT set format string for commit subject and body;
-                  see 'man git-log' for the list of format metacharacters;
-                  the default is '%s%n%b%n'
-
-   --help       display this help and exit
-   --version    output version information and exit
-
-EXAMPLE:
-
-  $ME --since=2008-01-01 > ChangeLog
-  $ME -- -n 5 foo > last-5-commits-to-branch-foo
-
-EOF
-    }
-  exit $exit_code;
-}
-
-# If the string $S is a well-behaved file name, simply return it.
-# If it contains white space, quotes, etc., quote it, and return the new string.
-sub shell_quote($)
-{
-  my ($s) = @_;
-  if ($s =~ m![^\w+/.,-]!)
-    {
-      # Convert each single quote to '\''
-      $s =~ s/\'/\'\\\'\'/g;
-      # Then single quote the string.
-      $s = "'$s'";
-    }
-  return $s;
-}
-
-sub quoted_cmd(@)
-{
-  return join (' ', map {shell_quote $_} @_);
-}
-
-{
-  my $since_date = '1970-01-01 UTC';
-  my $format_string = '%s%n%b%n';
-  GetOptions
-    (
-     help => sub { usage 0 },
-     version => sub { print "$ME version $VERSION\n"; exit },
-     'since=s' => \$since_date,
-     'format=s' => \$format_string,
-    ) or usage 1;
-
-  my @cmd = (qw (git log --log-size), "--since=$since_date",
-             '--pretty=format:%ct  %an  <%ae>%n%n'.$format_string, @ARGV);
-  open PIPE, '-|', @cmd
-    or die ("$ME: failed to run `". quoted_cmd (@cmd) ."': $!\n"
-            . "(Is your Git too old?  Version 1.5.1 or later is required.)\n");
-
-  my $prev_date_line = '';
-  while (1)
-    {
-      defined (my $in = <PIPE>)
-        or last;
-      $in =~ /^log size (\d+)$/
-        or die "$ME:$.: Invalid line (expected log size):\n$in";
-      my $log_nbytes = $1;
-
-      my $log;
-      my $n_read = read PIPE, $log, $log_nbytes;
-      $n_read == $log_nbytes
-        or die "$ME:$.: unexpected EOF\n";
-
-      my @line = split "\n", $log;
-      my $author_line = shift @line;
-      defined $author_line
-        or die "$ME:$.: unexpected EOF\n";
-      $author_line =~ /^(\d+)  (.*>)$/
-        or die "$ME:$.: Invalid line "
-          . "(expected date/author/email):\n$author_line\n";
-
-      my $date_line = sprintf "%s  $2\n", strftime ("%F", localtime ($1));
-      # If this line would be the same as the previous date/name/email
-      # line, then arrange not to print it.
-      if ($date_line ne $prev_date_line)
-        {
-          $prev_date_line eq ''
-            or print "\n";
-          print $date_line;
-        }
-      $prev_date_line = $date_line;
-
-      # Omit "Signed-off-by..." lines.
-      @line = grep !/^Signed-off-by: .*>$/, @line;
-
-      # If there were any lines
-      if (@line == 0)
-        {
-          warn "$ME: warning: empty commit message:\n  $date_line\n";
-        }
-      else
-        {
-          # Remove leading and trailing blank lines.
-          while ($line[0] =~ /^\s*$/) { shift @line; }
-          while ($line[$#line] =~ /^\s*$/) { pop @line; }
-
-          # Prefix each non-empty line with a TAB.
-          @line = map { length $_ ? "\t$_" : '' } @line;
-
-          print "\n", join ("\n", @line), "\n";
-        }
-
-      defined ($in = <PIPE>)
-        or last;
-      $in ne "\n"
-        and die "$ME:$.: unexpected line:\n$in";
-    }
-
-  close PIPE
-    or die "$ME: error closing pipe from " . quoted_cmd (@cmd) . "\n";
-  # FIXME-someday: include $PROCESS_STATUS in the diagnostic
-}
-
-# Local Variables:
-# mode: perl
-# indent-tabs-mode: nil
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "my $VERSION = '"
-# time-stamp-format: "%:y-%02m-%02d %02H:%02M"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "'; # UTC"
-# End:
diff --git a/build/aux/missing b/build/aux/missing
deleted file mode 100755 (executable)
index 28055d2..0000000
+++ /dev/null
@@ -1,376 +0,0 @@
-#! /bin/sh
-# Common stub for a few missing GNU programs while installing.
-
-scriptversion=2009-04-28.21; # UTC
-
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
-# 2008, 2009 Free Software Foundation, Inc.
-# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
-
-# This program is free software; you can 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.
-
-if test $# -eq 0; then
-  echo 1>&2 "Try \`$0 --help' for more information"
-  exit 1
-fi
-
-run=:
-sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
-sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
-
-# In the cases where this matters, `missing' is being run in the
-# srcdir already.
-if test -f configure.ac; then
-  configure_ac=configure.ac
-else
-  configure_ac=configure.in
-fi
-
-msg="missing on your system"
-
-case $1 in
---run)
-  # Try to run requested program, and just exit if it succeeds.
-  run=
-  shift
-  "$@" && exit 0
-  # Exit code 63 means version mismatch.  This often happens
-  # when the user try to use an ancient version of a tool on
-  # a file that requires a minimum version.  In this case we
-  # we should proceed has if the program had been absent, or
-  # if --run hadn't been passed.
-  if test $? = 63; then
-    run=:
-    msg="probably too old"
-  fi
-  ;;
-
-  -h|--h|--he|--hel|--help)
-    echo "\
-$0 [OPTION]... PROGRAM [ARGUMENT]...
-
-Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
-error status if there is no known handling for PROGRAM.
-
-Options:
-  -h, --help      display this help and exit
-  -v, --version   output version information and exit
-  --run           try to run the given command, and emulate it if it fails
-
-Supported PROGRAM values:
-  aclocal      touch file \`aclocal.m4'
-  autoconf     touch file \`configure'
-  autoheader   touch file \`config.h.in'
-  autom4te     touch the output file, or create a stub one
-  automake     touch all \`Makefile.in' files
-  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
-  flex         create \`lex.yy.c', if possible, from existing .c
-  help2man     touch the output file
-  lex          create \`lex.yy.c', if possible, from existing .c
-  makeinfo     touch the output file
-  tar          try tar, gnutar, gtar, then tar without non-portable flags
-  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
-
-Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
-\`g' are ignored when checking the name.
-
-Send bug reports to <bug-automake@gnu.org>."
-    exit $?
-    ;;
-
-  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
-    echo "missing $scriptversion (GNU Automake)"
-    exit $?
-    ;;
-
-  -*)
-    echo 1>&2 "$0: Unknown \`$1' option"
-    echo 1>&2 "Try \`$0 --help' for more information"
-    exit 1
-    ;;
-
-esac
-
-# normalize program name to check for.
-program=`echo "$1" | sed '
-  s/^gnu-//; t
-  s/^gnu//; t
-  s/^g//; t'`
-
-# Now exit if we have it, but it failed.  Also exit now if we
-# don't have it and --version was passed (most likely to detect
-# the program).  This is about non-GNU programs, so use $1 not
-# $program.
-case $1 in
-  lex*|yacc*)
-    # Not GNU programs, they don't have --version.
-    ;;
-
-  tar*)
-    if test -n "$run"; then
-       echo 1>&2 "ERROR: \`tar' requires --run"
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       exit 1
-    fi
-    ;;
-
-  *)
-    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
-       # We have it, but it failed.
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       # Could not run --version or --help.  This is probably someone
-       # running `$TOOL --version' or `$TOOL --help' to check whether
-       # $TOOL exists and not knowing $TOOL uses missing.
-       exit 1
-    fi
-    ;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case $program in
-  aclocal*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
-         to install the \`Automake' and \`Perl' packages.  Grab them from
-         any GNU archive site."
-    touch aclocal.m4
-    ;;
-
-  autoconf*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`${configure_ac}'.  You might want to install the
-         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
-         archive site."
-    touch configure
-    ;;
-
-  autoheader*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
-         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
-         from any GNU archive site."
-    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
-    test -z "$files" && files="config.h"
-    touch_files=
-    for f in $files; do
-      case $f in
-      *:*) touch_files="$touch_files "`echo "$f" |
-                                      sed -e 's/^[^:]*://' -e 's/:.*//'`;;
-      *) touch_files="$touch_files $f.in";;
-      esac
-    done
-    touch $touch_files
-    ;;
-
-  automake*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
-         You might want to install the \`Automake' and \`Perl' packages.
-         Grab them from any GNU archive site."
-    find . -type f -name Makefile.am -print |
-          sed 's/\.am$/.in/' |
-          while read f; do touch "$f"; done
-    ;;
-
-  autom4te*)
-    echo 1>&2 "\
-WARNING: \`$1' is needed, but is $msg.
-         You might have modified some files without having the
-         proper tools for further handling them.
-         You can get \`$1' as part of \`Autoconf' from any GNU
-         archive site."
-
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -f "$file"; then
-       touch $file
-    else
-       test -z "$file" || exec >$file
-       echo "#! /bin/sh"
-       echo "# Created by GNU Automake missing as a replacement of"
-       echo "#  $ $@"
-       echo "exit 0"
-       chmod +x $file
-       exit 1
-    fi
-    ;;
-
-  bison*|yacc*)
-    echo 1>&2 "\
-WARNING: \`$1' $msg.  You should only need it if
-         you modified a \`.y' file.  You may need the \`Bison' package
-         in order for those modifications to take effect.  You can get
-         \`Bison' from any GNU archive site."
-    rm -f y.tab.c y.tab.h
-    if test $# -ne 1; then
-        eval LASTARG="\${$#}"
-       case $LASTARG in
-       *.y)
-           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
-           if test -f "$SRCFILE"; then
-                cp "$SRCFILE" y.tab.c
-           fi
-           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
-           if test -f "$SRCFILE"; then
-                cp "$SRCFILE" y.tab.h
-           fi
-         ;;
-       esac
-    fi
-    if test ! -f y.tab.h; then
-       echo >y.tab.h
-    fi
-    if test ! -f y.tab.c; then
-       echo 'main() { return 0; }' >y.tab.c
-    fi
-    ;;
-
-  lex*|flex*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified a \`.l' file.  You may need the \`Flex' package
-         in order for those modifications to take effect.  You can get
-         \`Flex' from any GNU archive site."
-    rm -f lex.yy.c
-    if test $# -ne 1; then
-        eval LASTARG="\${$#}"
-       case $LASTARG in
-       *.l)
-           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
-           if test -f "$SRCFILE"; then
-                cp "$SRCFILE" lex.yy.c
-           fi
-         ;;
-       esac
-    fi
-    if test ! -f lex.yy.c; then
-       echo 'main() { return 0; }' >lex.yy.c
-    fi
-    ;;
-
-  help2man*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-        you modified a dependency of a manual page.  You may need the
-        \`Help2man' package in order for those modifications to take
-        effect.  You can get \`Help2man' from any GNU archive site."
-
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -f "$file"; then
-       touch $file
-    else
-       test -z "$file" || exec >$file
-       echo ".ab help2man is required to generate this page"
-       exit $?
-    fi
-    ;;
-
-  makeinfo*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified a \`.texi' or \`.texinfo' file, or any other file
-         indirectly affecting the aspect of the manual.  The spurious
-         call might also be the consequence of using a buggy \`make' (AIX,
-         DU, IRIX).  You might want to install the \`Texinfo' package or
-         the \`GNU make' package.  Grab either from any GNU archive site."
-    # The file to touch is that specified with -o ...
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -z "$file"; then
-      # ... or it is the one specified with @setfilename ...
-      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
-      file=`sed -n '
-       /^@setfilename/{
-         s/.* \([^ ]*\) *$/\1/
-         p
-         q
-       }' $infile`
-      # ... or it is derived from the source name (dir/f.texi becomes f.info)
-      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
-    fi
-    # If the file does not exist, the user really needs makeinfo;
-    # let's fail without touching anything.
-    test -f $file || exit 1
-    touch $file
-    ;;
-
-  tar*)
-    shift
-
-    # We have already tried tar in the generic part.
-    # Look for gnutar/gtar before invocation to avoid ugly error
-    # messages.
-    if (gnutar --version > /dev/null 2>&1); then
-       gnutar "$@" && exit 0
-    fi
-    if (gtar --version > /dev/null 2>&1); then
-       gtar "$@" && exit 0
-    fi
-    firstarg="$1"
-    if shift; then
-       case $firstarg in
-       *o*)
-           firstarg=`echo "$firstarg" | sed s/o//`
-           tar "$firstarg" "$@" && exit 0
-           ;;
-       esac
-       case $firstarg in
-       *h*)
-           firstarg=`echo "$firstarg" | sed s/h//`
-           tar "$firstarg" "$@" && exit 0
-           ;;
-       esac
-    fi
-
-    echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
-         You may want to install GNU tar or Free paxutils, or check the
-         command line arguments."
-    exit 1
-    ;;
-
-  *)
-    echo 1>&2 "\
-WARNING: \`$1' is needed, and is $msg.
-         You might have modified some files without having the
-         proper tools for further handling them.  Check the \`README' file,
-         it often tells you about the needed prerequisites for installing
-         this package.  You may also peek at any GNU archive site, in case
-         some other package would contain this missing \`$1' program."
-    exit 1
-    ;;
-esac
-
-exit 0
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/build/aux/ylwrap b/build/aux/ylwrap
deleted file mode 100755 (executable)
index 84d5634..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-#! /bin/sh
-# ylwrap - wrapper for lex/yacc invocations.
-
-scriptversion=2009-04-28.21; # UTC
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005,
-# 2007, 2009 Free Software Foundation, Inc.
-#
-# Written by Tom Tromey <tromey@cygnus.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, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# 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>.
-
-case "$1" in
-  '')
-    echo "$0: No files given.  Try \`$0 --help' for more information." 1>&2
-    exit 1
-    ;;
-  --basedir)
-    basedir=$2
-    shift 2
-    ;;
-  -h|--h*)
-    cat <<\EOF
-Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...
-
-Wrapper for lex/yacc invocations, renaming files as desired.
-
-  INPUT is the input file
-  OUTPUT is one file PROG generates
-  DESIRED is the file we actually want instead of OUTPUT
-  PROGRAM is program to run
-  ARGS are passed to PROG
-
-Any number of OUTPUT,DESIRED pairs may be used.
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
-    exit $?
-    ;;
-  -v|--v*)
-    echo "ylwrap $scriptversion"
-    exit $?
-    ;;
-esac
-
-
-# The input.
-input="$1"
-shift
-case "$input" in
-  [\\/]* | ?:[\\/]*)
-    # Absolute path; do nothing.
-    ;;
-  *)
-    # Relative path.  Make it absolute.
-    input="`pwd`/$input"
-    ;;
-esac
-
-pairlist=
-while test "$#" -ne 0; do
-  if test "$1" = "--"; then
-    shift
-    break
-  fi
-  pairlist="$pairlist $1"
-  shift
-done
-
-# The program to run.
-prog="$1"
-shift
-# Make any relative path in $prog absolute.
-case "$prog" in
-  [\\/]* | ?:[\\/]*) ;;
-  *[\\/]*) prog="`pwd`/$prog" ;;
-esac
-
-# FIXME: add hostname here for parallel makes that run commands on
-# other machines.  But that might take us over the 14-char limit.
-dirname=ylwrap$$
-trap "cd '`pwd`'; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15
-mkdir $dirname || exit 1
-
-cd $dirname
-
-case $# in
-  0) "$prog" "$input" ;;
-  *) "$prog" "$@" "$input" ;;
-esac
-ret=$?
-
-if test $ret -eq 0; then
-  set X $pairlist
-  shift
-  first=yes
-  # Since DOS filename conventions don't allow two dots,
-  # the DOS version of Bison writes out y_tab.c instead of y.tab.c
-  # and y_tab.h instead of y.tab.h. Test to see if this is the case.
-  y_tab_nodot="no"
-  if test -f y_tab.c || test -f y_tab.h; then
-    y_tab_nodot="yes"
-  fi
-
-  # The directory holding the input.
-  input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
-  # Quote $INPUT_DIR so we can use it in a regexp.
-  # FIXME: really we should care about more than `.' and `\'.
-  input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`
-
-  while test "$#" -ne 0; do
-    from="$1"
-    # Handle y_tab.c and y_tab.h output by DOS
-    if test $y_tab_nodot = "yes"; then
-      if test $from = "y.tab.c"; then
-       from="y_tab.c"
-      else
-       if test $from = "y.tab.h"; then
-         from="y_tab.h"
-       fi
-      fi
-    fi
-    if test -f "$from"; then
-      # If $2 is an absolute path name, then just use that,
-      # otherwise prepend `../'.
-      case "$2" in
-       [\\/]* | ?:[\\/]*) target="$2";;
-       *) target="../$2";;
-      esac
-
-      # We do not want to overwrite a header file if it hasn't
-      # changed.  This avoid useless recompilations.  However the
-      # parser itself (the first file) should always be updated,
-      # because it is the destination of the .y.c rule in the
-      # Makefile.  Divert the output of all other files to a temporary
-      # file so we can compare them to existing versions.
-      if test $first = no; then
-       realtarget="$target"
-       target="tmp-`echo $target | sed s/.*[\\/]//g`"
-      fi
-      # Edit out `#line' or `#' directives.
-      #
-      # We don't want the resulting debug information to point at
-      # an absolute srcdir; it is better for it to just mention the
-      # .y file with no path.
-      #
-      # We want to use the real output file name, not yy.lex.c for
-      # instance.
-      #
-      # We want the include guards to be adjusted too.
-      FROM=`echo "$from" | sed \
-            -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
-            -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
-      TARGET=`echo "$2" | sed \
-            -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
-            -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
-
-      sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \
-          -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$?
-
-      # Check whether header files must be updated.
-      if test $first = no; then
-       if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
-         echo "$2" is unchanged
-         rm -f "$target"
-       else
-          echo updating "$2"
-          mv -f "$target" "$realtarget"
-        fi
-      fi
-    else
-      # A missing file is only an error for the first file.  This
-      # is a blatant hack to let us support using "yacc -d".  If -d
-      # is not specified, we don't want an error when the header
-      # file is "missing".
-      if test $first = yes; then
-        ret=1
-      fi
-    fi
-    shift
-    shift
-    first=no
-  done
-else
-  ret=$?
-fi
-
-# Remove the directory.
-cd ..
-rm -rf $dirname
-
-exit $ret
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
index adddf6f..6e64abf 100644 (file)
@@ -1,5 +1,8 @@
 /* config.h.in.  Generated from configure.ac by autoheader.  */
 
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
 /* Define to the number of bits in type 'ptrdiff_t'. */
 #undef BITSIZEOF_PTRDIFF_T
 
 /* Define to 1 if using `alloca.c'. */
 #undef C_ALLOCA
 
+/* Define as the bit index in the word where to find bit 0 of the exponent of
+   'double'. */
+#undef DBL_EXPBIT0_BIT
+
+/* Define as the word index where to find the exponent of 'double'. */
+#undef DBL_EXPBIT0_WORD
+
 /* Define to 1 if // is a file system root distinct from /. */
 #undef DOUBLE_SLASH_IS_DISTINCT_ROOT
 
 /* whether debugging is enabled */
 #undef ENABLE_DEBUG
 
+/* Enable compile-time and run-time bounds-checking, and some warnings,
+        without upsetting newer glibc. */
+     #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
+     # define _FORTIFY_SOURCE 2
+     #endif
+    
+
 /* Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string. */
 #undef FUNC_NL_LANGINFO_YESEXPR_WORKS
 
    and handles trailing slash correctly. */
 #undef FUNC_REALPATH_WORKS
 
+/* 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-lgpl shall be considered present. */
 #undef GNULIB_CANONICALIZE_LGPL
 
 /* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module fscanf shall be considered present. */
+#undef GNULIB_FSCANF
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
    whether the gnulib module malloc-gnu shall be considered present. */
 #undef GNULIB_MALLOC_GNU
 
+/* 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
+
 /* Define to 1 when the gnulib module btowc should be tested. */
 #undef GNULIB_TEST_BTOWC
 
    */
 #undef GNULIB_TEST_CANONICALIZE_FILE_NAME
 
+/* Define to 1 when the gnulib module close should be tested. */
+#undef GNULIB_TEST_CLOSE
+
 /* Define to 1 when the gnulib module dup2 should be tested. */
 #undef GNULIB_TEST_DUP2
 
 /* Define to 1 when the gnulib module environ should be tested. */
 #undef GNULIB_TEST_ENVIRON
 
+/* Define to 1 when the gnulib module fdopen should be tested. */
+#undef GNULIB_TEST_FDOPEN
+
+/* Define to 1 when the gnulib module fstat should be tested. */
+#undef GNULIB_TEST_FSTAT
+
+/* Define to 1 when the gnulib module getcwd should be tested. */
+#undef GNULIB_TEST_GETCWD
+
 /* Define to 1 when the gnulib module getdelim should be tested. */
 #undef GNULIB_TEST_GETDELIM
 
 /* Define to 1 when the gnulib module getpagesize should be tested. */
 #undef GNULIB_TEST_GETPAGESIZE
 
+/* Define to 1 when the gnulib module gettimeofday should be tested. */
+#undef GNULIB_TEST_GETTIMEOFDAY
+
+/* Define to 1 when the gnulib module localeconv should be tested. */
+#undef GNULIB_TEST_LOCALECONV
+
 /* Define to 1 when the gnulib module lstat should be tested. */
 #undef GNULIB_TEST_LSTAT
 
 /* Define to 1 when the gnulib module mempcpy should be tested. */
 #undef GNULIB_TEST_MEMPCPY
 
+/* Define to 1 when the gnulib module mkstemp should be tested. */
+#undef GNULIB_TEST_MKSTEMP
+
 /* Define to 1 when the gnulib module nl_langinfo should be tested. */
 #undef GNULIB_TEST_NL_LANGINFO
 
 /* Define to 1 when the gnulib module putenv should be tested. */
 #undef GNULIB_TEST_PUTENV
 
+/* Define to 1 when the gnulib module rawmemchr should be tested. */
+#undef GNULIB_TEST_RAWMEMCHR
+
 /* Define to 1 when the gnulib module readlink should be tested. */
 #undef GNULIB_TEST_READLINK
 
 /* Define to 1 when the gnulib module stpncpy should be tested. */
 #undef GNULIB_TEST_STPNCPY
 
+/* Define to 1 when the gnulib module strchrnul should be tested. */
+#undef GNULIB_TEST_STRCHRNUL
+
 /* Define to 1 when the gnulib module strndup should be tested. */
 #undef GNULIB_TEST_STRNDUP
 
 /* 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. */
+/* Define to 1 if you have the 'btowc' function. */
 #undef HAVE_BTOWC
 
-/* Define to 1 if you have the `canonicalize_file_name' function. */
+/* Define to 1 if you have the 'canonicalize_file_name' function. */
 #undef HAVE_CANONICALIZE_FILE_NAME
 
-/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
+/* 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 MacOS X function CFPreferencesCopyAppValue in
+/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in
    the CoreFoundation framework. */
 #undef HAVE_CFPREFERENCESCOPYAPPVALUE
 
    don't. */
 #undef HAVE_DECL_ISBLANK
 
+/* Define to 1 if you have the declaration of `mbrtowc', and to 0 if you
+   don't. */
+#undef HAVE_DECL_MBRTOWC
+
+/* Define to 1 if you have the declaration of `mbsinit', and to 0 if you
+   don't. */
+#undef HAVE_DECL_MBSINIT
+
+/* Define to 1 if you have the declaration of `mbsrtowcs', and to 0 if you
+   don't. */
+#undef HAVE_DECL_MBSRTOWCS
+
 /* Define to 1 if you have the declaration of `setenv', and to 0 if you don't.
    */
 #undef HAVE_DECL_SETENV
    don't. */
 #undef HAVE_DECL_STRNLEN
 
+/* Define to 1 if you have the declaration of `towlower', and to 0 if you
+   don't. */
+#undef HAVE_DECL_TOWLOWER
+
 /* Define to 1 if you have the declaration of `unsetenv', and to 0 if you
    don't. */
 #undef HAVE_DECL_UNSETENV
 
+/* Define to 1 if you have the declaration of `wcrtomb', and to 0 if you
+   don't. */
+#undef HAVE_DECL_WCRTOMB
+
 /* 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 <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
-/* Define to 1 if you have the `dup2' function. */
+/* Define to 1 if you have the 'dup2' function. */
 #undef HAVE_DUP2
 
 /* Define if you have the declaration of environ. */
 /* Define to 1 if the system has the type `error_t'. */
 #undef HAVE_ERROR_T
 
-/* Define to 1 if you have the `fcntl' function. */
-#undef HAVE_FCNTL
-
 /* Define to 1 if you have the <features.h> header file. */
 #undef HAVE_FEATURES_H
 
 /* Define to 1 if you have the `funlockfile' function. */
 #undef HAVE_FUNLOCKFILE
 
-/* Define to 1 if you have the `getcwd' function. */
+/* Define to 1 if you have the 'getcwd' function. */
 #undef HAVE_GETCWD
 
-/* Define to 1 if you have the `getdelim' function. */
+/* Define to 1 if you have the 'getdelim' function. */
 #undef HAVE_GETDELIM
 
 /* Define to 1 if you have the <getopt.h> header file. */
 /* Define to 1 if you have the `getpagesize' function. */
 #undef HAVE_GETPAGESIZE
 
+/* Define to 1 if you have the 'gettimeofday' function. */
+#undef HAVE_GETTIMEOFDAY
+
 /* 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 `isblank' function. */
+/* Define to 1 if you have the 'isblank' function. */
 #undef HAVE_ISBLANK
 
-/* Define to 1 if you have the `iswcntrl' function. */
+/* Define to 1 if you have the 'iswcntrl' function. */
 #undef HAVE_ISWCNTRL
 
-/* Define to 1 if you have the `iswctype' function. */
+/* Define to 1 if you have the 'iswctype' function. */
 #undef HAVE_ISWCTYPE
 
 /* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
 /* Define to 1 if you have the <libintl.h> header file. */
 #undef HAVE_LIBINTL_H
 
-/* 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 'lstat' function. */
 #undef HAVE_LSTAT
 
 /* Define to 1 if your system has a GNU libc compatible 'malloc' function, and
 /* Define to 1 if you have the `mbrtowc' function. */
 #undef HAVE_MBRTOWC
 
-/* Define to 1 if you have the `mbsinit' function. */
+/* Define to 1 if you have the 'mbsinit' function. */
 #undef HAVE_MBSINIT
 
-/* Define to 1 if you have the `mbsrtowcs' function. */
+/* Define to 1 if you have the 'mbsrtowcs' function. */
 #undef HAVE_MBSRTOWCS
 
 /* Define to 1 if <wchar.h> declares mbstate_t. */
 #undef HAVE_MBSTATE_T
 
-/* Define to 1 if you have the `memchr' function. */
-#undef HAVE_MEMCHR
-
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
 /* Define to 1 if you have the `mempcpy' function. */
 #undef HAVE_MEMPCPY
 
-/* Define to 1 if you have the `mprotect' function. */
+/* Define to 1 if you have the 'mkstemp' function. */
+#undef HAVE_MKSTEMP
+
+/* Define to 1 if you have the 'mprotect' function. */
 #undef HAVE_MPROTECT
 
-/* Define to 1 if you have the `newlocale' function. */
+/* Define to 1 on MSVC platforms that have the "invalid parameter handler"
+   concept. */
+#undef HAVE_MSVC_INVALID_PARAMETER_HANDLER
+
+/* Define to 1 if you have the 'newlocale' function. */
 #undef HAVE_NEWLOCALE
 
-/* Define to 1 if you have the `nl_langinfo' function. */
+/* Define to 1 if you have the 'nl_langinfo' function. */
 #undef HAVE_NL_LANGINFO
 
 /* Define to 1 if you have the `open_memstream' function. */
 /* Define to 1 if you have the <OS.h> header file. */
 #undef HAVE_OS_H
 
-/* Define to 1 if you have the `pathconf' function. */
-#undef HAVE_PATHCONF
-
 /* Define to 1 if you have the `pthread_atfork' function. */
 #undef HAVE_PTHREAD_ATFORK
 
 /* Define if the POSIX multithreading library has read/write locks. */
 #undef HAVE_PTHREAD_RWLOCK
 
+/* Define to 1 if you have the `rawmemchr' function. */
+#undef HAVE_RAWMEMCHR
+
 /* Define to 1 if atoll is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_ATOLL
 
    macros. */
 #undef HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
 
+/* Define to 1 if chdir is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_CHDIR
+
 /* Define to 1 if chown is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_CHOWN
 
 /* Define to 1 if dprintf is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_DPRINTF
 
+/* Define to 1 if dup is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_DUP
+
 /* Define to 1 if dup2 is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_DUP2
 
 /* Define to 1 if fcntl is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_FCNTL
 
+/* Define to 1 if fdatasync is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FDATASYNC
+
+/* Define to 1 if ffsl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FFSL
+
+/* Define to 1 if ffsll is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FFSLL
+
 /* Define to 1 if fpurge is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_FPURGE
 
 /* Define to 1 if fseeko is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_FSEEKO
 
+/* Define to 1 if fstat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FSTAT
+
 /* Define to 1 if fstatat is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_FSTATAT
 
 /* Define to 1 if getpagesize is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_GETPAGESIZE
 
+/* Define to 1 if gets is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETS
+
 /* Define to 1 if getsubopt is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_GETSUBOPT
 
+/* Define to 1 if gettimeofday is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETTIMEOFDAY
+
 /* Define to 1 if getusershell is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_GETUSERSHELL
 
 /* Define to 1 if grantpt is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_GRANTPT
 
-/* Define to 1 if initstat_r is declared even after undefining macros. */
-#undef HAVE_RAW_DECL_INITSTAT_R
+/* Define to 1 if group_member is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GROUP_MEMBER
+
+/* Define to 1 if imaxabs is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_IMAXABS
+
+/* Define to 1 if imaxdiv is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_IMAXDIV
+
+/* Define to 1 if initstate is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_INITSTATE
+
+/* Define to 1 if initstate_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_INITSTATE_R
+
+/* Define to 1 if isatty is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ISATTY
 
 /* Define to 1 if isblank is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_ISBLANK
 /* Define to 1 if openat is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_OPENAT
 
+/* Define to 1 if pclose is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PCLOSE
+
 /* Define to 1 if pipe is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_PIPE
 
 /* Define to 1 if popen is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_POPEN
 
+/* Define to 1 if posix_openpt is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_POSIX_OPENPT
+
 /* Define to 1 if pread is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_PREAD
 
 /* Define to 1 if ptsname is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_PTSNAME
 
+/* Define to 1 if ptsname_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PTSNAME_R
+
 /* Define to 1 if pwrite is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_PWRITE
 
+/* Define to 1 if random is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RANDOM
+
 /* Define to 1 if random_r is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_RANDOM_R
 
 /* Define to 1 if setenv is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_SETENV
 
+/* Define to 1 if sethostname is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SETHOSTNAME
+
 /* Define to 1 if setlocale is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_SETLOCALE
 
+/* Define to 1 if setstate is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SETSTATE
+
 /* Define to 1 if setstate_r is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_SETSTATE_R
 
 /* Define to 1 if snprintf is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_SNPRINTF
 
+/* Define to 1 if srandom is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SRANDOM
+
 /* Define to 1 if srandom_r is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_SRANDOM_R
 
 /* Define to 1 if strtod is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_STRTOD
 
+/* Define to 1 if strtoimax is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRTOIMAX
+
 /* Define to 1 if strtok_r is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_STRTOK_R
 
 /* Define to 1 if strtoull is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_STRTOULL
 
+/* Define to 1 if strtoumax is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRTOUMAX
+
 /* Define to 1 if strverscmp is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_STRVERSCMP
 
 /* Define to 1 if you have the <readline/readline.h> header file. */
 #undef HAVE_READLINE_READLINE_H
 
-/* Define to 1 if you have the `readlink' function. */
+/* Define to 1 if you have the 'readlink' function. */
 #undef HAVE_READLINK
 
 /* Define if the 'realloc' function is POSIX compliant. */
 #undef HAVE_REALLOC_POSIX
 
-/* Define to 1 if you have the `realpath' function. */
+/* Define to 1 if you have the 'realpath' function. */
 #undef HAVE_REALPATH
 
 /* Define to 1 if you have the `rl_completion_matches' function. */
 /* Define to 1 if you have the <selinux/selinux.h> header file. */
 #undef HAVE_SELINUX_SELINUX_H
 
-/* Define to 1 if you have the `setenv' function. */
+/* Define to 1 if you have the 'setenv' function. */
 #undef HAVE_SETENV
 
 /* Define to 1 if you have the `setlocale' function. */
 /* Define to 1 if 'wint_t' is a signed integer type. */
 #undef HAVE_SIGNED_WINT_T
 
-/* Define to 1 if you have the `snprintf' function. */
+/* Define to 1 if you have the 'snprintf' function. */
 #undef HAVE_SNPRINTF
 
 /* Define if the return value of the snprintf function is the number of of
 /* Define if you have the stpncpy() function and it works. */
 #undef HAVE_STPNCPY
 
+/* Define to 1 if you have the `strchrnul' function. */
+#undef HAVE_STRCHRNUL
+
 /* Define to 1 if you have the `strerror_r' function. */
 #undef HAVE_STRERROR_R
 
 /* Define to 1 if you have the <string.h> header file. */
 #undef HAVE_STRING_H
 
-/* Define to 1 if you have the `strndup' function. */
+/* Define to 1 if you have the 'strndup' function. */
 #undef HAVE_STRNDUP
 
 /* Define to 1 if you have the `strnlen' function. */
 #undef HAVE_STRNLEN
 
-/* Define to 1 if you have the `symlink' function. */
+/* Define to 1 if `decimal_point' is a member of `struct lconv'. */
+#undef HAVE_STRUCT_LCONV_DECIMAL_POINT
+
+/* Define to 1 if you have the 'symlink' function. */
 #undef HAVE_SYMLINK
 
 /* Define to 1 if you have the <sys/bitypes.h> header file. */
 /* 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/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/wait.h> header file. */
 #undef HAVE_SYS_WAIT_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 `unsetenv' function. */
 #undef HAVE_UNSETENV
 
-/* Define to 1 if the system has the type `unsigned long long int'. */
+/* Define to 1 if the system has the type 'unsigned long long int'. */
 #undef HAVE_UNSIGNED_LONG_LONG_INT
 
 /* Define to 1 if you have the `uselocale' function. */
 #undef HAVE_USELOCALE
 
-/* Define to 1 if you have the `vasnprintf' function. */
+/* Define to 1 if you have the 'vasnprintf' function. */
 #undef HAVE_VASNPRINTF
 
 /* Define to 1 if you have the `vasprintf' function. */
 /* Define if you have the 'wchar_t' type. */
 #undef HAVE_WCHAR_T
 
-/* Define to 1 if you have the `wcrtomb' function. */
+/* Define to 1 if you have the 'wcrtomb' function. */
 #undef HAVE_WCRTOMB
 
-/* Define to 1 if you have the `wcscoll' function. */
+/* Define to 1 if you have the 'wcscoll' function. */
 #undef HAVE_WCSCOLL
 
 /* Define to 1 if you have the `wcslen' function. */
 /* Define to 1 if you have the `wcsnlen' function. */
 #undef HAVE_WCSNLEN
 
-/* Define to 1 if you have the `wctob' function. */
+/* Define to 1 if you have the 'wctob' function. */
 #undef HAVE_WCTOB
 
 /* Define to 1 if you have the <wctype.h> header file. */
 #undef HAVE_WCTYPE_H
 
+/* 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 you have the `wmemchr' function. */
+/* Define to 1 if you have the 'wmemchr' function. */
 #undef HAVE_WMEMCHR
 
-/* Define to 1 if you have the `wmemcpy' function. */
+/* Define to 1 if you have the 'wmemcpy' function. */
 #undef HAVE_WMEMCPY
 
-/* Define to 1 if you have the `wmempcpy' function. */
+/* Define to 1 if you have the 'wmempcpy' function. */
 #undef HAVE_WMEMPCPY
 
 /* This value is set to 1 to indicate that the system argz facility works */
 /* Define to 1 if the system has the type `_Bool'. */
 #undef HAVE__BOOL
 
-/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
+/* 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 'lstat' dereferences a symlink specified with a trailing
    slash. */
 #undef LSTAT_FOLLOWS_SLASHED_SYMLINK
 
 /* 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
    made weak. */
 #undef USE_SOLARIS_THREADS_WEAK
 
-/* Define if the Win32 multithreading API can be used. */
-#undef USE_WIN32_THREADS
+/* Define if the native Windows multithreading API can be used. */
+#undef USE_WINDOWS_THREADS
 
 /* Version number of package */
 #undef VERSION
    'wint_t'. */
 #undef WINT_T_SUFFIX
 
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+   significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+#  define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+#  undef WORDS_BIGENDIAN
+# endif
+#endif
+
 /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
    `char[]'. */
 #undef YYTEXT_POINTER
 
+/* Enable large inode numbers on Mac OS X 10.5.  */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
 /* 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
+
 /* Define for large files, on AIX-style hosts. */
 #undef _LARGE_FILES
 
+/* Define to 1 on Solaris. */
+#undef _LCONV_C99
+
 /* Define to 1 if on MINIX. */
 #undef _MINIX
 
+/* 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)
+#  define _Noreturn __attribute__ ((__noreturn__))
+# elif defined _MSC_VER && 1200 <= _MSC_VER
+#  define _Noreturn __declspec (noreturn)
+# else
+#  define _Noreturn
+# endif
+#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. */
+/* Define to 1 if you need to in order for 'stat' and other things to work. */
 #undef _POSIX_SOURCE
 
+/* Define if you want <regex.h> to include <limits.h>, so that it consistently
+   overrides <limits.h>'s RE_DUP_MAX. */
+#undef _REGEX_INCLUDE_LIMITS_H
+
 /* Define if you want regoff_t to be at least as wide POSIX requires. */
 #undef _REGEX_LARGE_OFFSETS
 
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
 #endif
+/* Enable general extensions on Mac OS X.  */
+#ifndef _DARWIN_C_SOURCE
+# undef _DARWIN_C_SOURCE
+#endif
 /* Enable GNU extensions on systems that have them.  */
 #ifndef _GNU_SOURCE
 # undef _GNU_SOURCE
 /* Define so that glibc/gnulib argp.h does not typedef error_t. */
 #undef __error_t_defined
 
-/* Define to a type to use for `error_t' if it is not otherwise available. */
+/* Define to a type to use for 'error_t' if it is not otherwise available. */
 #undef error_t
 
 /* Always use our fgetfilecon wrapper. */
 /* Always use our getfilecon wrapper. */
 #undef getfilecon
 
+/* Define to rpl_gmtime if the replacement function should be used. */
+#undef gmtime
+
 /* Define to `__inline__' or `__inline' if that's what the C compiler
    calls it, or to nothing if 'inline' is not supported under any name.  */
 #ifndef __cplusplus
 /* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
    the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
    earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
-   __APPLE__ && __MACH__ test for MacOS X.
+   __APPLE__ && __MACH__ test for Mac OS X.
    __APPLE_CC__ tests for the Apple compiler and its version.
    __STDC_VERSION__ tests for the C99 mode.  */
 #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
 /* Always use our lgetfilecon wrapper. */
 #undef lgetfilecon
 
+/* Define to rpl_localtime if the replacement function should be used. */
+#undef localtime
+
 /* Define to a type if <wchar.h> does not define. */
 #undef mbstate_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. */
+#undef pid_t
+
 /* Define as the type of the result of subtracting two pointers, if the system
    doesn't define it. */
 #undef ptrdiff_t
    is a misnomer outside of parameter lists.  */
 #define _UNUSED_PARAMETER_ _GL_UNUSED
 
+/* 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
+
index f67c89d..cbe86fd 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,11 +1,9 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for augeas 0.10.0.
+# Generated by GNU Autoconf 2.69 for augeas 1.3.0.
 #
 #
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
@@ -134,6 +132,31 @@ 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.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+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
+  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 :
   emulate sh
@@ -167,7 +190,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
 else
   exitcode=1; echo positional parameters were not saved.
 fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || 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'\" &&
@@ -220,21 +244,25 @@ IFS=$as_save_IFS
 
 
       if test "x$CONFIG_SHELL" != x; then :
-  # We cannot yet assume a decent shell, so we have to provide a
-       # neutralization value for shells without unset; and this also
-       # works around shells that cannot unset nonexistent variables.
-       # Preserve -v and -x to the replacement shell.
-       BASH_ENV=/dev/null
-       ENV=/dev/null
-       (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-       export CONFIG_SHELL
-       case $- in # ((((
-         *v*x* | *x*v* ) as_opts=-vx ;;
-         *v* ) as_opts=-v ;;
-         *x* ) as_opts=-x ;;
-         * ) as_opts= ;;
-       esac
-       exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+  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
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+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
+exit 255
 fi
 
     if test x$as_have_required = xno; then :
@@ -336,6 +364,14 @@ $as_echo X"$as_dir" |
 
 
 } # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
 # as_fn_append VAR VALUE
 # ----------------------
 # Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -457,6 +493,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
   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; }
 
+  # 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
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensitive to this).
@@ -491,16 +531,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -512,28 +552,8 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-       test -d "$1/.";
-      else
-       case $1 in #(
-       -*)set "./$1";;
-       esac;
-       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-       ???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -567,8 +587,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='augeas'
 PACKAGE_TARNAME='augeas'
-PACKAGE_VERSION='0.10.0'
-PACKAGE_STRING='augeas 0.10.0'
+PACKAGE_VERSION='1.3.0'
+PACKAGE_STRING='augeas 1.3.0'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -638,18 +658,27 @@ LIBPTH_PREFIX
 LTLIBPTH
 LIBPTH
 INTL_MACOSX_LIBS
-NEXT_AS_FIRST_DIRECTIVE_FCNTL_H
-NEXT_FCNTL_H
-REPLACE_OPENAT
-REPLACE_OPEN
-REPLACE_FCNTL
-HAVE_OPENAT
-HAVE_FCNTL
-GNULIB_OPENAT
-GNULIB_OPEN
-GNULIB_FCNTL
+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_STRTOIMAX
+HAVE_DECL_STRTOUMAX
+HAVE_DECL_STRTOIMAX
+HAVE_DECL_IMAXDIV
+HAVE_DECL_IMAXABS
+GNULIB_STRTOUMAX
+GNULIB_STRTOIMAX
+GNULIB_IMAXDIV
+GNULIB_IMAXABS
+HAVE_MSVC_INVALID_PARAMETER_HANDLER
 LOCALE_TR_UTF8
 gltests_WITNESS
+REPLACE_TOWLOWER
 REPLACE_ISWCNTRL
 HAVE_WCTYPE_H
 NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H
@@ -692,6 +721,10 @@ GNULIB_MKTIME
 NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H
 NEXT_SYS_WAIT_H
 GNULIB_WAITPID
+WINDOWS_64_BIT_OFF_T
+NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H
+NEXT_SYS_TYPES_H
+WINDOWS_64_BIT_ST_SIZE
 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H
 NEXT_SYS_STAT_H
 NEXT_AS_FIRST_DIRECTIVE_STRING_H
@@ -700,6 +733,8 @@ 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
 WINT_T_SUFFIX
 WCHAR_T_SUFFIX
@@ -725,7 +760,11 @@ HAVE_WCHAR_H
 HAVE_UNSIGNED_LONG_LONG_INT
 HAVE_LONG_LONG_INT
 HAVE__BOOL
+GL_GENERATE_STDBOOL_H_FALSE
+GL_GENERATE_STDBOOL_H_TRUE
 STDBOOL_H
+GL_GENERATE_SELINUX_CONTEXT_H_FALSE
+GL_GENERATE_SELINUX_CONTEXT_H_TRUE
 SELINUX_CONTEXT_H
 NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H
 NEXT_SELINUX_SELINUX_H
@@ -739,6 +778,7 @@ REPLACE_STRNDUP
 REPLACE_STRNCAT
 REPLACE_STRERROR_R
 REPLACE_STRERROR
+REPLACE_STRCHRNUL
 REPLACE_STRCASESTR
 REPLACE_STRSTR
 REPLACE_STRDUP
@@ -763,6 +803,8 @@ HAVE_DECL_MEMRCHR
 HAVE_MEMPCPY
 HAVE_DECL_MEMMEM
 HAVE_MEMCHR
+HAVE_FFSLL
+HAVE_FFSL
 HAVE_MBSLEN
 GNULIB_STRVERSCMP
 GNULIB_STRSIGNAL
@@ -799,6 +841,8 @@ GNULIB_MEMRCHR
 GNULIB_MEMPCPY
 GNULIB_MEMMEM
 GNULIB_MEMCHR
+GNULIB_FFSLL
+GNULIB_FFSL
 LOCALE_FR_UTF8
 LOCALE_ZH_CN
 LOCALE_JA
@@ -833,20 +877,26 @@ GNULIB_LSTAT
 GNULIB_LCHMOD
 GNULIB_FUTIMENS
 GNULIB_FSTATAT
+GNULIB_FSTAT
 GNULIB_FCHMODAT
 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H
 NEXT_LOCALE_H
 HAVE_XLOCALE_H
 NEXT_AS_FIRST_DIRECTIVE_STDDEF_H
 NEXT_STDDEF_H
+GL_GENERATE_STDDEF_H_FALSE
+GL_GENERATE_STDDEF_H_TRUE
 STDDEF_H
 HAVE_WCHAR_T
 REPLACE_NULL
+REPLACE_STRUCT_LCONV
 REPLACE_DUPLOCALE
 REPLACE_SETLOCALE
+REPLACE_LOCALECONV
 HAVE_DUPLOCALE
 GNULIB_DUPLOCALE
 GNULIB_SETLOCALE
+GNULIB_LOCALECONV
 LOCALCHARSET_TESTS_ENVIRONMENT
 GLIBC21
 HAVE_LANGINFO_YESEXPR
@@ -859,8 +909,18 @@ NEXT_LANGINFO_H
 REPLACE_NL_LANGINFO
 HAVE_NL_LANGINFO
 GNULIB_NL_LANGINFO
+HAVE_WINSOCK2_H
+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
+GNULIB_GETTIMEOFDAY
 LTLIBINTL
 LIBINTL
+GNULIB_GL_UNISTD_H_GETOPT
 GETOPT_H
 HAVE_GETOPT_H
 NEXT_AS_FIRST_DIRECTIVE_GETOPT_H
@@ -876,17 +936,20 @@ REPLACE_SYMLINK
 REPLACE_SLEEP
 REPLACE_RMDIR
 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_GETDOMAINNAME
 REPLACE_GETCWD
+REPLACE_FTRUNCATE
 REPLACE_FCHOWNAT
 REPLACE_DUP2
 REPLACE_DUP
@@ -895,10 +958,12 @@ 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_GETDOMAINNAME
+HAVE_DECL_FDATASYNC
 HAVE_DECL_FCHDIR
 HAVE_DECL_ENVIRON
 HAVE_USLEEP
@@ -906,6 +971,7 @@ HAVE_UNLINKAT
 HAVE_SYMLINKAT
 HAVE_SYMLINK
 HAVE_SLEEP
+HAVE_SETHOSTNAME
 HAVE_READLINKAT
 HAVE_READLINK
 HAVE_PWRITE
@@ -915,6 +981,7 @@ HAVE_PIPE
 HAVE_LINKAT
 HAVE_LINK
 HAVE_LCHOWN
+HAVE_GROUP_MEMBER
 HAVE_GETPAGESIZE
 HAVE_GETLOGIN
 HAVE_GETHOSTNAME
@@ -922,6 +989,7 @@ HAVE_GETGROUPS
 HAVE_GETDTABLESIZE
 HAVE_FTRUNCATE
 HAVE_FSYNC
+HAVE_FDATASYNC
 HAVE_FCHOWNAT
 HAVE_FCHDIR
 HAVE_FACCESSAT
@@ -934,14 +1002,16 @@ GNULIB_USLEEP
 GNULIB_UNLINKAT
 GNULIB_UNLINK
 GNULIB_UNISTD_H_SIGPIPE
-GNULIB_UNISTD_H_GETOPT
+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
@@ -950,6 +1020,8 @@ GNULIB_LSEEK
 GNULIB_LINKAT
 GNULIB_LINK
 GNULIB_LCHOWN
+GNULIB_ISATTY
+GNULIB_GROUP_MEMBER
 GNULIB_GETUSERSHELL
 GNULIB_GETPAGESIZE
 GNULIB_GETLOGIN_R
@@ -961,6 +1033,7 @@ GNULIB_GETDOMAINNAME
 GNULIB_GETCWD
 GNULIB_FTRUNCATE
 GNULIB_FSYNC
+GNULIB_FDATASYNC
 GNULIB_FCHOWNAT
 GNULIB_FCHDIR
 GNULIB_FACCESSAT
@@ -968,8 +1041,10 @@ GNULIB_EUIDACCESS
 GNULIB_ENVIRON
 GNULIB_DUP3
 GNULIB_DUP2
+GNULIB_DUP
 GNULIB_CLOSE
 GNULIB_CHOWN
+GNULIB_CHDIR
 REPLACE_VSPRINTF
 REPLACE_VSNPRINTF
 REPLACE_VPRINTF
@@ -978,6 +1053,7 @@ REPLACE_VDPRINTF
 REPLACE_VASPRINTF
 REPLACE_TMPFILE
 REPLACE_STDIO_WRITE_FUNCS
+REPLACE_STDIO_READ_FUNCS
 REPLACE_SPRINTF
 REPLACE_SNPRINTF
 REPLACE_RENAMEAT
@@ -998,11 +1074,14 @@ REPLACE_FPURGE
 REPLACE_FPRINTF
 REPLACE_FOPEN
 REPLACE_FFLUSH
+REPLACE_FDOPEN
 REPLACE_FCLOSE
 REPLACE_DPRINTF
 HAVE_VDPRINTF
 HAVE_VASPRINTF
 HAVE_RENAMEAT
+HAVE_POPEN
+HAVE_PCLOSE
 HAVE_FTELLO
 HAVE_FSEEKO
 HAVE_DPRINTF
@@ -1021,11 +1100,15 @@ 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
@@ -1036,35 +1119,61 @@ 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
+GL_GENERATE_FNMATCH_H_FALSE
+GL_GENERATE_FNMATCH_H_TRUE
 FNMATCH_H
+REPLACE_ITOLD
+GL_GENERATE_FLOAT_H_FALSE
+GL_GENERATE_FLOAT_H_TRUE
 FLOAT_H
 NEXT_AS_FIRST_DIRECTIVE_FLOAT_H
 NEXT_FLOAT_H
+NEXT_AS_FIRST_DIRECTIVE_FCNTL_H
+NEXT_FCNTL_H
+REPLACE_OPENAT
+REPLACE_OPEN
+REPLACE_FCNTL
+HAVE_OPENAT
+HAVE_FCNTL
+GNULIB_OPENAT
+GNULIB_OPEN
+GNULIB_NONBLOCKING
+GNULIB_FCNTL
 EOVERFLOW_VALUE
 EOVERFLOW_HIDDEN
 ENOLINK_VALUE
 ENOLINK_HIDDEN
 EMULTIHOP_VALUE
 EMULTIHOP_HIDDEN
+GL_GENERATE_ERRNO_H_FALSE
+GL_GENERATE_ERRNO_H_TRUE
 ERRNO_H
 NEXT_AS_FIRST_DIRECTIVE_ERRNO_H
 NEXT_ERRNO_H
@@ -1084,7 +1193,9 @@ REPLACE_STRTOD
 REPLACE_SETENV
 REPLACE_REALPATH
 REPLACE_REALLOC
+REPLACE_RANDOM_R
 REPLACE_PUTENV
+REPLACE_PTSNAME_R
 REPLACE_MKSTEMP
 REPLACE_MBTOWC
 REPLACE_MALLOC
@@ -1103,7 +1214,10 @@ HAVE_RPMATCH
 HAVE_REALPATH
 HAVE_RANDOM_R
 HAVE_RANDOM_H
+HAVE_RANDOM
+HAVE_PTSNAME_R
 HAVE_PTSNAME
+HAVE_POSIX_OPENPT
 HAVE_MKSTEMPS
 HAVE_MKSTEMP
 HAVE_MKOSTEMPS
@@ -1127,8 +1241,11 @@ GNULIB_RPMATCH
 GNULIB_REALPATH
 GNULIB_REALLOC_POSIX
 GNULIB_RANDOM_R
+GNULIB_RANDOM
 GNULIB_PUTENV
+GNULIB_PTSNAME_R
 GNULIB_PTSNAME
+GNULIB_POSIX_OPENPT
 GNULIB_MKSTEMPS
 GNULIB_MKSTEMP
 GNULIB_MKOSTEMPS
@@ -1235,7 +1352,11 @@ GNULIB_MBRTOWC
 GNULIB_MBSINIT
 GNULIB_WCTOB
 GNULIB_BTOWC
+GL_GENERATE_ARGZ_H_FALSE
+GL_GENERATE_ARGZ_H_TRUE
 ARGZ_H
+GL_GENERATE_ALLOCA_H_FALSE
+GL_GENERATE_ALLOCA_H_TRUE
 ALLOCA_H
 ALLOCA
 LTALLOCA
@@ -1259,7 +1380,6 @@ NMEDIT
 DSYMUTIL
 MANIFEST_TOOL
 ac_ct_AR
-AR
 DLLTOOL
 OBJDUMP
 LN_S
@@ -1271,12 +1391,15 @@ FGREP
 SED
 LIBTOOL
 RANLIB
+ARFLAGS
+AR
 EGREP
 GREP
 CPP
 am__fastdepCC_FALSE
 am__fastdepCC_TRUE
 CCDEPMODE
+am__nodep
 AMDEPBACKSLASH
 AMDEP_FALSE
 AMDEP_TRUE
@@ -1313,6 +1436,8 @@ ND_ENABLED_TRUE
 ND_PROG
 AM_BACKSLASH
 AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
 am__untar
 am__tar
 AMTAR
@@ -1383,8 +1508,8 @@ with_pdfdocs
 with_failmalloc
 enable_debug
 enable_dependency_tracking
-enable_threads
 enable_largefile
+enable_threads
 enable_shared
 enable_static
 with_pic
@@ -1870,8 +1995,6 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used" >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1957,7 +2080,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 augeas 0.10.0 to adapt to many kinds of systems.
+\`configure' configures augeas 1.3.0 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -2027,7 +2150,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of augeas 0.10.0:";;
+     short | recursive ) echo "Configuration of augeas 1.3.0:";;
    esac
   cat <<\_ACEOF
 
@@ -2035,15 +2158,17 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --enable-silent-rules          less verbose build output (undo: `make V=1')
-  --disable-silent-rules         verbose build output (undo: `make V=0')
+  --enable-silent-rules   less verbose build output (undo: "make V=1")
+  --disable-silent-rules  verbose build output (undo: "make V=0")
   --enable-debug=no/yes   enable debugging output
-  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors
-  --enable-threads={posix|solaris|pth|win32}
+  --enable-dependency-tracking
+                          do not reject slow dependency extractors
+  --disable-dependency-tracking
+                          speeds up one-time build
+  --disable-largefile     omit support for large files
+  --enable-threads={posix|solaris|pth|windows}
                           specify multithreading API
   --disable-threads       build without multithread safety
-  --disable-largefile     omit support for large files
   --enable-shared[=PKGS]  build shared libraries [default=yes]
   --enable-static[=PKGS]  build static libraries [default=yes]
   --enable-fast-install[=PKGS]
@@ -2064,7 +2189,7 @@ Optional Packages:
   --with-failmalloc=FAILMALLOC
                           enable failmalloc test targets and use the
                           failmalloc library FAILMALLOC
-  --with-pic              try to use only PIC/non-PIC objects [default=use
+  --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
                           both]
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-sysroot=DIR Search for dependent libraries within DIR
@@ -2168,10 +2293,10 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-augeas configure 0.10.0
-generated by GNU Autoconf 2.68
+augeas configure 1.3.0
+generated by GNU Autoconf 2.69
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -2444,7 +2569,7 @@ $as_echo "$ac_try_echo"; } >&5
         test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
         test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
+        test -x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
@@ -2601,7 +2726,8 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) >= 0)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -2617,7 +2743,8 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -2643,7 +2770,8 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) < 0)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -2659,7 +2787,8 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) >= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -2693,7 +2822,8 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -2807,12 +2937,69 @@ $as_echo "$ac_res" >&6; }
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_decl
+
+# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
+# ----------------------------------------------------
+# Tries to find if the field MEMBER exists in type AGGR, after including
+# INCLUDES, setting cache variable VAR accordingly.
+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
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (ac_aggr.$3)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$4=yes"
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (sizeof ac_aggr.$3)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$4=yes"
+else
+  eval "$4=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
+eval ac_res=\$$4
+              { $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_member
 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 augeas $as_me 0.10.0, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+It was created by augeas $as_me 1.3.0, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 
@@ -3097,6 +3284,8 @@ gl_func_list="$gl_func_list getcwd"
 gl_func_list="$gl_func_list readlink"
 gl_func_list="$gl_func_list realpath"
 gl_header_list="$gl_header_list sys/param.h"
+gl_header_list="$gl_header_list unistd.h"
+gl_func_list="$gl_func_list symlink"
 gl_func_list="$gl_func_list isblank"
 gl_func_list="$gl_func_list iswctype"
 gl_func_list="$gl_func_list mbsrtowcs"
@@ -3108,6 +3297,9 @@ gl_header_list="$gl_header_list wctype.h"
 gl_func_list="$gl_func_list getdelim"
 gl_getopt_required=GNU
 gl_header_list="$gl_header_list getopt.h"
+gl_header_list="$gl_header_list sys/time.h"
+gl_header_list="$gl_header_list sys/socket.h"
+gl_func_list="$gl_func_list gettimeofday"
 gl_header_list="$gl_header_list langinfo.h"
 gl_header_list="$gl_header_list xlocale.h"
 gl_func_list="$gl_func_list lstat"
@@ -3115,9 +3307,8 @@ gl_func_list="$gl_func_list mbsinit"
 gl_func_list="$gl_func_list mbrtowc"
 gl_header_list="$gl_header_list sys/mman.h"
 gl_func_list="$gl_func_list mprotect"
-gl_func_list="$gl_func_list memchr"
+gl_func_list="$gl_func_list mkstemp"
 gl_func_list="$gl_func_list nl_langinfo"
-gl_func_list="$gl_func_list pathconf"
 gl_func_list="$gl_func_list wcscoll"
 gl_header_list="$gl_header_list selinux/selinux.h"
 gl_header_list="$gl_header_list wchar.h"
@@ -3126,17 +3317,15 @@ gl_func_list="$gl_func_list stpncpy"
 gl_func_list="$gl_func_list strndup"
 gl_header_list="$gl_header_list sys/stat.h"
 gl_header_list="$gl_header_list sys/wait.h"
-gl_header_list="$gl_header_list sys/time.h"
-gl_header_list="$gl_header_list unistd.h"
 gl_func_list="$gl_func_list vasnprintf"
 gl_header_list="$gl_header_list features.h"
+gl_func_list="$gl_func_list snprintf"
 gl_func_list="$gl_func_list wcrtomb"
 gl_func_list="$gl_func_list iswcntrl"
-gl_func_list="$gl_func_list dup2"
-gl_func_list="$gl_func_list fcntl"
+gl_func_list="$gl_func_list _set_invalid_parameter_handler"
+gl_header_list="$gl_header_list inttypes.h"
 gl_func_list="$gl_func_list newlocale"
 gl_func_list="$gl_func_list setenv"
-gl_func_list="$gl_func_list symlink"
 gl_func_list="$gl_func_list wctob"
 # Check that the precious variables saved in the cache have kept the same
 # value.
@@ -3208,7 +3397,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 ac_aux_dir=
-for ac_dir in build/aux "$srcdir"/build/aux; do
+for ac_dir in build/ac-aux "$srcdir"/build/ac-aux; do
   if test -f "$ac_dir/install-sh"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install-sh -c"
@@ -3224,7 +3413,7 @@ for ac_dir in build/aux "$srcdir"/build/aux; do
   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
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in build/ac-aux \"$srcdir\"/build/ac-aux" "$LINENO" 5
 fi
 
 # These three variables are undocumented and unsupported,
@@ -3238,7 +3427,7 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 ac_config_headers="$ac_config_headers config.h"
 
-am__api_version='1.11'
+am__api_version='1.13'
 
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
@@ -3277,7 +3466,7 @@ case $as_dir/ in #((
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-       if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
            # AIX install.  It has an incompatible calling convention.
@@ -3335,9 +3524,6 @@ 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; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
 # Reject unsafe characters in $srcdir or the absolute working directory
 # name.  Accept space and tab only in the latter.
 am_lf='
@@ -3348,32 +3534,40 @@ case `pwd` in
 esac
 case $srcdir in
   *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
-    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
 esac
 
-# Do `set' in a subshell so we don't clobber the current shell's
+# Do 'set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
-   if test "$*" = "X"; then
-      # -L didn't work.
-      set X `ls -t "$srcdir/configure" conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$*" != "X $srcdir/configure conftest.file" \
-      && test "$*" != "X conftest.file $srcdir/configure"; then
-
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
-alias in your environment" "$LINENO" 5
-   fi
-
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$*" = "X"; then
+       # -L didn't work.
+       set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$*" != "X $srcdir/configure conftest.file" \
+       && test "$*" != "X conftest.file $srcdir/configure"; then
+
+       # If neither matched, then we have a broken ls.  This can happen
+       # if, for instance, CONFIG_SHELL is bash and it inherits a
+       # broken ls alias from the environment.  This has actually
+       # happened.  Such a system could not be considered "sane".
+       as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment" "$LINENO" 5
+     fi
+     if test "$2" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
    test "$2" = conftest.file
    )
 then
@@ -3385,6 +3579,16 @@ Check your system clock" "$LINENO" 5
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "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=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
 test "$program_prefix" != NONE &&
   program_transform_name="s&^&$program_prefix&;$program_transform_name"
 # Use a double $ so make ignores it.
@@ -3407,12 +3611,12 @@ if test x"${MISSING+set}" != xset; then
   esac
 fi
 # Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
+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;}
+  { $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;}
 fi
 
 if test x"${install_sh}" != xset; then
@@ -3424,10 +3628,10 @@ if test x"${install_sh}" != xset; then
   esac
 fi
 
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
 # tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
+# will honor the 'STRIP' environment variable to overrule this program.
 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.
@@ -3446,7 +3650,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
     break 2
@@ -3486,7 +3690,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
     break 2
@@ -3537,7 +3741,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_prog in mkdir gmkdir; do
         for ac_exec_ext in '' $ac_executable_extensions; do
-          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          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) '* | \
@@ -3567,12 +3771,6 @@ fi
 $as_echo "$MKDIR_P" >&6; }
 
 
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
-  [\\/$]* | ?:[\\/]*) ;;
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-
 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.
@@ -3591,7 +3789,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
     break 2
@@ -3655,6 +3853,45 @@ else
 fi
 rmdir .tst 2>/dev/null
 
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) 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))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+       @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+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; }
+if test $am_cv_make_support_nested_variables = yes; then
+    AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
 if test "`cd $srcdir && pwd`" != "`pwd`"; then
   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
   # is not polluted with repeated "-I."
@@ -3677,7 +3914,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='augeas'
- VERSION='0.10.0'
+ VERSION='1.3.0'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3705,13 +3942,24 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 
 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>
+mkdir_p='$(MKDIR_P)'
+
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
-# Always define AMTAR for backward compatibility.
+# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
 
-AMTAR=${AMTAR-"${am_missing_run}tar"}
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar  pax cpio none'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
 
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
 
 
 
@@ -3722,11 +3970,38 @@ if test "${enable_silent_rules+set}" = set; then :
   enableval=$enable_silent_rules;
 fi
 
-case $enable_silent_rules in
-yes) AM_DEFAULT_VERBOSITY=0;;
-no)  AM_DEFAULT_VERBOSITY=1;;
-*)   AM_DEFAULT_VERBOSITY=0;;
+case $enable_silent_rules in # (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) 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))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+       @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+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; }
+if test $am_cv_make_support_nested_variables = yes; then
+    AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
 AM_BACKSLASH='\'
  # make --enable-silent-rules the default.
 
@@ -3751,7 +4026,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_ND_PROG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3830,7 +4105,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PDFLATEX="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3904,9 +4179,9 @@ $as_echo "#define ENABLE_DEBUG 1" >>confdefs.h
 
 fi
 
-LIBAUGEAS_VERSION_INFO=15:0:15
+LIBAUGEAS_VERSION_INFO=19:0:19
 
-LIBFA_VERSION_INFO=4:5:3
+LIBFA_VERSION_INFO=5:0:4
 
 
 # Make sure we can run config.sub.
@@ -3999,7 +4274,7 @@ am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# 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
@@ -4032,6 +4307,7 @@ fi
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
+  am__nodep='_no'
 fi
  if test "x$enable_dependency_tracking" != xno; then
   AMDEP_TRUE=
@@ -4064,7 +4340,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
     break 2
@@ -4104,7 +4380,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
     break 2
@@ -4157,7 +4433,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
     break 2
@@ -4198,7 +4474,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; 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
@@ -4256,7 +4532,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
     break 2
@@ -4300,7 +4576,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
     break 2
@@ -4746,8 +5022,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.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);
@@ -4843,8 +5118,9 @@ else
   # 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'.
+  # 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.
@@ -4878,16 +5154,16 @@ else
     : > 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 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # 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"
+    # 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
+    # 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
@@ -4896,16 +5172,16 @@ else
       test "$am__universal" = false || continue
       ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # 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
       ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+    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}
@@ -5114,7 +5390,7 @@ do
     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"
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+      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
 case `"$ac_path_GREP" --version 2>&1` in
@@ -5180,7 +5456,7 @@ do
     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"
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+      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
 case `"$ac_path_EGREP" --version 2>&1` in
@@ -5421,6 +5697,8 @@ $as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
 
   $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
@@ -5452,7 +5730,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
     break 2
@@ -5492,7 +5770,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
     break 2
@@ -5545,7 +5823,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
     break 2
@@ -5586,7 +5864,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; 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
@@ -5644,7 +5922,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
     break 2
@@ -5688,7 +5966,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
     break 2
@@ -5884,8 +6162,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.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);
@@ -5981,8 +6258,9 @@ else
   # 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'.
+  # 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.
@@ -6016,16 +6294,16 @@ else
     : > 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 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # 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"
+    # 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
+    # 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
@@ -6034,16 +6312,16 @@ else
       test "$am__universal" = false || continue
       ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # 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
       ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+    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}
@@ -6097,7 +6375,149 @@ else
 fi
 
 
-if test -n "$ac_tool_prefix"; then
+
+
+  { $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
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef __ACK__
+Amsterdam
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Amsterdam" >/dev/null 2>&1; then :
+  gl_cv_c_amsterdam_compiler=yes
+else
+  gl_cv_c_amsterdam_compiler=no
+fi
+rm -f conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5
+$as_echo "$gl_cv_c_amsterdam_compiler" >&6; }
+  if test -z "$AR"; then
+    if test $gl_cv_c_amsterdam_compiler = yes; then
+      AR='cc -c.a'
+      if test -z "$ARFLAGS"; then
+        ARFLAGS='-o'
+      fi
+    else
+                  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
+  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}ar"
+    $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
+
+
+fi
+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
+  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="ar"
+    $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
+
+  if test "x$ac_ct_AR" = x; then
+    AR="ar"
+  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
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+      if test -z "$ARFLAGS"; then
+        ARFLAGS='cru'
+      fi
+    fi
+  else
+    if test -z "$ARFLAGS"; then
+      ARFLAGS='cru'
+    fi
+  fi
+
+
+  if test -z "$RANLIB"; then
+    if test $gl_cv_c_amsterdam_compiler = yes; then
+      RANLIB=':'
+    else
+            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
@@ -6114,7 +6534,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
     break 2
@@ -6154,7 +6574,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
     break 2
@@ -6189,6 +6609,8 @@ else
   RANLIB="$ac_cv_prog_RANLIB"
 fi
 
+    fi
+  fi
 
 
 
 
 
 
-  # 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>:
-    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
-  fi
-
-
-
-  # Code from module alloca:
-  # Code from module alloca-opt:
-  # Code from module alloca-opt-tests:
-  # Code from module arg-nonnull:
-  # Code from module argz:
-  # Code from module binary-io:
-  # Code from module binary-io-tests:
-  # Code from module btowc:
-  # Code from module btowc-tests:
-  # Code from module c++defs:
-  # Code from module c-ctype:
-  # Code from module c-ctype-tests:
-  # Code from module c-strcase:
-  # Code from module c-strcase-tests:
-  # Code from module canonicalize-lgpl:
-  # Code from module canonicalize-lgpl-tests:
-  # Code from module configmake:
-  # Code from module ctype:
-  # Code from module ctype-tests:
-  # Code from module dosname:
-  # Code from module dup2:
-  # Code from module dup2-tests:
-  # Code from module environ:
-  # Code from module environ-tests:
-  # Code from module errno:
-  # Code from module errno-tests:
-  # Code from module extensions:
-
-  # Code from module fcntl-h:
-  # Code from module fcntl-h-tests:
-  # Code from module float:
-  # Code from module fnmatch:
-  # Code from module fnmatch-tests:
-  # Code from module getdelim:
-  # Code from module getdelim-tests:
-  # Code from module getline:
-  # Code from module getline-tests:
-  # Code from module getopt-gnu:
-  # Code from module getopt-posix:
-  # Code from module getopt-posix-tests:
-  # Code from module getpagesize:
-  # Code from module gettext-h:
-  # Code from module gitlog-to-changelog:
-  # Code from module havelib:
-  # Code from module ignore-value:
-  # Code from module ignore-value-tests:
-  # Code from module include_next:
-  # Code from module intprops:
-  # Code from module isblank:
-  # Code from module isblank-tests:
-  # Code from module langinfo:
-  # Code from module langinfo-tests:
-  # Code from module localcharset:
-  # Code from module locale:
-  # Code from module locale-tests:
-  # Code from module localename:
-  # Code from module localename-tests:
-  # Code from module lock:
-  # Code from module lock-tests:
-  # Code from module lstat:
-  # Code from module lstat-tests:
-  # 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:
-  # Code from module mbrtowc:
-  # Code from module mbrtowc-tests:
-  # Code from module mbsinit:
-  # Code from module mbsinit-tests:
-  # Code from module mbsrtowcs:
-  # Code from module mbsrtowcs-tests:
-  # Code from module mbtowc:
-  # Code from module memchr:
-  # Code from module memchr-tests:
-  # Code from module mempcpy:
-  # Code from module multiarch:
-  # Code from module nl_langinfo:
-  # Code from module nl_langinfo-tests:
-  # Code from module open:
-  # Code from module open-tests:
-  # Code from module pathmax:
-  # Code from module putenv:
-  # Code from module readlink:
-  # Code from module readlink-tests:
-  # Code from module realloc-posix:
-  # Code from module regex:
-  # Code from module safe-alloc:
-  # Code from module safe-alloc-tests:
-  # Code from module same-inode:
-  # Code from module selinux-h:
-  # Code from module setenv:
-  # Code from module setenv-tests:
-  # Code from module setlocale:
-  # Code from module setlocale-tests:
-  # Code from module size_max:
-  # Code from module ssize_t:
-  # Code from module stat:
-  # Code from module stat-tests:
-  # Code from module stdbool:
-  # Code from module stdbool-tests:
-  # Code from module stddef:
-  # Code from module stddef-tests:
-  # Code from module stdint:
-  # Code from module stdint-tests:
-  # Code from module stdio:
-  # Code from module stdio-tests:
-  # Code from module stdlib:
-  # Code from module stdlib-tests:
-  # Code from module stpcpy:
-  # Code from module stpncpy:
-  # Code from module streq:
-  # Code from module string:
-  # 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 strstr:
-  # Code from module strstr-simple:
-  # Code from module strstr-tests:
-  # Code from module symlink:
-  # Code from module symlink-tests:
-  # Code from module sys_stat:
-  # Code from module sys_stat-tests:
-  # Code from module sys_wait:
-  # Code from module sys_wait-tests:
-  # Code from module thread:
-  # Code from module threadlib:
-
-
-
-  # Code from module time:
-  # Code from module time-tests:
-  # Code from module unistd:
-  # Code from module unistd-tests:
-  # Code from module unsetenv:
-  # Code from module unsetenv-tests:
-  # Code from module unused-parameter:
-  # Code from module vasnprintf:
-  # Code from module vasnprintf-tests:
-  # Code from module vasprintf:
-  # Code from module vasprintf-tests:
-  # Code from module verify:
-  # Code from module verify-tests:
-  # Code from module warn-on-use:
-  # Code from module wchar:
-  # Code from module wchar-tests:
-  # Code from module wcrtomb:
-  # Code from module wcrtomb-tests:
-  # Code from module wctob:
-  # Code from module wctomb:
-  # Code from module wctype-h:
-  # Code from module wctype-h-tests:
-  # Code from module xsize:
-  # Code from module yield:
+  # IEEE behaviour is the default on all CPUs except Alpha and SH
+  # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4
+  # and the GCC 4.1.2 manual).
+  case "$host_cpu" in
+    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>
+      if test -n "$GCC"; then
+        # GCC has the option -mieee.
+        # For full IEEE compliance (rarely needed), use option -mieee-with-inexact.
+        CPPFLAGS="$CPPFLAGS -mieee"
+      else
+        # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact.
+        # For full IEEE compliance (rarely needed), use option -ieee_with_inexact.
+        CPPFLAGS="$CPPFLAGS -ieee"
+      fi
+      ;;
+    sh*)
+      if test -n "$GCC"; then
+        # GCC has the option -mieee.
+        CPPFLAGS="$CPPFLAGS -mieee"
+      fi
+      ;;
+  esac
 
 # Check whether --enable-largefile was given.
 if test "${enable_largefile+set}" = set; then :
@@ -6597,6 +6843,460 @@ _ACEOF
 esac
 rm -rf conftest*
   fi
+
+
+fi
+
+
+
+
+
+
+  # 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>:
+    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
+  fi
+
+
+
+  # Code from module alloca:
+  # Code from module alloca-opt:
+  # Code from module alloca-opt-tests:
+  # Code from module argz:
+  # Code from module binary-io:
+  # Code from module binary-io-tests:
+  # Code from module btowc:
+  # Code from module btowc-tests:
+  # Code from module c-ctype:
+  # Code from module c-ctype-tests:
+  # Code from module c-strcase:
+  # Code from module c-strcase-tests:
+  # Code from module canonicalize-lgpl:
+  # Code from module canonicalize-lgpl-tests:
+  # Code from module close:
+  # Code from module close-tests:
+  # Code from module configmake:
+  # Code from module ctype:
+  # Code from module ctype-tests:
+  # Code from module dosname:
+  # Code from module dup2:
+  # Code from module dup2-tests:
+  # Code from module environ:
+  # Code from module environ-tests:
+  # Code from module errno:
+  # Code from module errno-tests:
+  # Code from module extensions:
+
+  # Code from module fcntl-h:
+  # Code from module fcntl-h-tests:
+  # Code from module fd-hook:
+  # Code from module fdopen:
+  # Code from module fdopen-tests:
+  # Code from module fgetc-tests:
+  # Code from module float:
+  # Code from module float-tests:
+  # Code from module fnmatch:
+  # Code from module fnmatch-tests:
+  # Code from module fpieee:
+
+  # Code from module fpucw:
+  # Code from module fputc-tests:
+  # Code from module fread-tests:
+  # Code from module fstat:
+  # Code from module fstat-tests:
+  # Code from module fwrite-tests:
+  # Code from module getcwd-lgpl:
+  # Code from module getcwd-lgpl-tests:
+  # Code from module getdelim:
+  # Code from module getdelim-tests:
+  # Code from module getline:
+  # Code from module getline-tests:
+  # Code from module getopt-gnu:
+  # Code from module getopt-posix:
+  # Code from module getopt-posix-tests:
+  # Code from module getpagesize:
+  # Code from module gettext-h:
+  # Code from module gettimeofday:
+  # Code from module gettimeofday-tests:
+  # Code from module gitlog-to-changelog:
+  # Code from module havelib:
+  # Code from module ignore-value:
+  # Code from module ignore-value-tests:
+  # Code from module include_next:
+  # Code from module intprops:
+  # Code from module intprops-tests:
+  # Code from module inttypes:
+  # Code from module inttypes-incomplete:
+  # Code from module inttypes-tests:
+  # Code from module isblank:
+  # Code from module isblank-tests:
+  # Code from module langinfo:
+  # Code from module langinfo-tests:
+  # Code from module largefile:
+
+  # Code from module localcharset:
+  # Code from module locale:
+  # Code from module locale-tests:
+  # Code from module localeconv:
+  # Code from module localeconv-tests:
+  # Code from module localename:
+  # Code from module localename-tests:
+  # Code from module lock:
+  # Code from module lock-tests:
+  # Code from module lstat:
+  # Code from module lstat-tests:
+  # 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:
+  # Code from module mbrtowc:
+  # Code from module mbrtowc-tests:
+  # Code from module mbsinit:
+  # Code from module mbsinit-tests:
+  # Code from module mbsrtowcs:
+  # Code from module mbsrtowcs-tests:
+  # Code from module mbtowc:
+  # Code from module memchr:
+  # Code from module memchr-tests:
+  # Code from module mempcpy:
+  # Code from module mkstemp:
+  # Code from module msvc-inval:
+  # Code from module msvc-nothrow:
+  # Code from module multiarch:
+  # Code from module nl_langinfo:
+  # Code from module nl_langinfo-tests:
+  # Code from module nocrash:
+  # Code from module open:
+  # Code from module open-tests:
+  # Code from module pathmax:
+  # Code from module pathmax-tests:
+  # Code from module putenv:
+  # Code from module rawmemchr:
+  # Code from module rawmemchr-tests:
+  # Code from module readlink:
+  # Code from module readlink-tests:
+  # Code from module realloc-posix:
+  # Code from module regex:
+  # Code from module safe-alloc:
+  # Code from module safe-alloc-tests:
+  # Code from module same-inode:
+  # Code from module selinux-h:
+  # Code from module setenv:
+  # Code from module setenv-tests:
+  # Code from module setlocale:
+  # Code from module setlocale-tests:
+  # Code from module size_max:
+  # Code from module snippet/_Noreturn:
+  # Code from module snippet/arg-nonnull:
+  # Code from module snippet/c++defs:
+  # Code from module snippet/unused-parameter:
+  # Code from module snippet/warn-on-use:
+  # Code from module ssize_t:
+  # Code from module stat:
+  # Code from module stat-tests:
+  # Code from module stdbool:
+  # Code from module stdbool-tests:
+  # Code from module stddef:
+  # Code from module stddef-tests:
+  # Code from module stdint:
+  # Code from module stdint-tests:
+  # Code from module stdio:
+  # Code from module stdio-tests:
+  # Code from module stdlib:
+  # Code from module stdlib-tests:
+  # Code from module stpcpy:
+  # Code from module stpncpy:
+  # Code from module strchrnul:
+  # Code from module strchrnul-tests:
+  # Code from module streq:
+  # Code from module string:
+  # 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 strstr:
+  # Code from module strstr-simple:
+  # Code from module strstr-tests:
+  # Code from module symlink:
+  # Code from module symlink-tests:
+  # Code from module sys_stat:
+  # Code from module sys_stat-tests:
+  # Code from module sys_time:
+  # Code from module sys_time-tests:
+  # Code from module sys_types:
+  # Code from module sys_types-tests:
+  # Code from module sys_wait:
+  # 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-tests:
+  # Code from module threadlib:
+
+
+
+  # Code from module time:
+  # Code from module time-tests:
+  # Code from module unistd:
+  # Code from module unistd-tests:
+  # Code from module unsetenv:
+  # Code from module unsetenv-tests:
+  # Code from module vasnprintf:
+  # Code from module vasnprintf-tests:
+  # Code from module vasprintf:
+  # Code from module vasprintf-tests:
+  # Code from module verify:
+  # Code from module verify-tests:
+  # Code from module wchar:
+  # Code from module wchar-tests:
+  # Code from module wcrtomb:
+  # Code from module wcrtomb-tests:
+  # Code from module wctob:
+  # Code from module wctomb:
+  # Code from module wctype-h:
+  # Code from module wctype-h-tests:
+  # Code from module xsize:
+  # Code from module yield:
+
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; 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
+  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
+/* 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))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+        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 :
+  ac_cv_sys_largefile_CC=' -n32'; break
+fi
+rm -f core conftest.err conftest.$ac_objext
+        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; }
+  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
+  while :; do
+  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))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+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
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#define _FILE_OFFSET_BITS 64
+#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))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+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
+  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; }
+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
+;;
+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
+  while :; do
+  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))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+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
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#define _LARGE_FILES 1
+#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))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+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
+  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; }
+case $ac_cv_sys_large_files in #(
+  no | unknown) ;;
+  *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+;;
+esac
+rm -rf conftest*
+  fi
+
+
 fi
 
 
@@ -6610,8 +7310,8 @@ esac
 
 
 
-macro_version='2.4'
-macro_revision='1.3293'
+macro_version='2.4.2'
+macro_revision='1.3337'
 
 
 
@@ -6718,7 +7418,7 @@ do
     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"
-      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+      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
@@ -6797,7 +7497,7 @@ do
     for ac_prog in fgrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+      as_fn_executable_p "$ac_path_FGREP" || continue
 # Check for GNU ac_path_FGREP and select it if it is found.
   # Check for GNU $ac_path_FGREP
 case `"$ac_path_FGREP" --version 2>&1` in
@@ -7053,7 +7753,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7097,7 +7797,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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_DUMPBIN="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7255,6 +7955,11 @@ else
     lt_cv_sys_max_cmd_len=196608
     ;;
 
+  os2*)
+    # The test takes a long time on OS/2.
+    lt_cv_sys_max_cmd_len=8192
+    ;;
+
   osf*)
     # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
     # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
@@ -7294,7 +7999,7 @@ else
       # If test is not a shell built-in, we'll probably end up computing a
       # maximum length that is only half of the actual maximum length, but
       # we can't tell.
-      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
                 = "X$teststring$teststring"; } >/dev/null 2>&1 &&
              test $i != 17 # 1/2 MB should be enough
       do
@@ -7516,7 +8221,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7556,7 +8261,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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_OBJDUMP="objdump"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7723,7 +8428,7 @@ irix5* | irix6* | nonstopux*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-# This must be Linux ELF.
+# This must be glibc/ELF.
 linux* | k*bsd*-gnu | kopensolaris*-gnu)
   lt_cv_deplibs_check_method=pass_all
   ;;
@@ -7862,7 +8567,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7902,7 +8607,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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_DLLTOOL="dlltool"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -8005,7 +8710,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -8049,7 +8754,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -8174,7 +8879,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
     break 2
@@ -8214,7 +8919,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
     break 2
@@ -8273,7 +8978,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
     break 2
@@ -8313,7 +9018,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
     break 2
@@ -8363,13 +9068,13 @@ old_postuninstall_cmds=
 if test -n "$RANLIB"; then
   case $host_os in
   openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
     ;;
   *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
     ;;
   esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
 fi
 
 case $host_os in
@@ -8516,6 +9221,7 @@ for ac_symprfx in "" "_"; do
     # which start with @ or ?.
     lt_cv_sys_global_symbol_pipe="$AWK '"\
 "     {last_section=section; section=\$ 3};"\
+"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
 "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
 "     \$ 0!~/External *\|/{next};"\
 "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
@@ -8804,7 +9510,7 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
@@ -8822,7 +9528,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
          x86_64-*linux*)
            LD="${LD-ld} -m elf_i386"
            ;;
-         ppc64-*linux*|powerpc64-*linux*)
+         powerpcle-*linux*)
+           LD="${LD-ld} -m elf32lppclinux"
+           ;;
+         powerpc-*linux*)
            LD="${LD-ld} -m elf32ppclinux"
            ;;
          s390x-*linux*)
@@ -8841,7 +9550,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
          x86_64-*linux*)
            LD="${LD-ld} -m elf_x86_64"
            ;;
-         ppc*-*linux*|powerpc*-*linux*)
+         powerpcle-*linux*)
+           LD="${LD-ld} -m elf64lppc"
+           ;;
+         powerpc-*linux*)
            LD="${LD-ld} -m elf64ppc"
            ;;
          s390*-*linux*|s390*-*tpf*)
@@ -8904,7 +9616,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
     CFLAGS="$SAVE_CFLAGS"
   fi
   ;;
-sparc*-*solaris*)
+*-*solaris*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
@@ -8915,7 +9627,20 @@ sparc*-*solaris*)
     case `/usr/bin/file conftest.o` in
     *64-bit*)
       case $lt_cv_prog_gnu_ld in
-      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      yes*)
+        case $host in
+        i?86-*-solaris*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        sparc*-*-solaris*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+        esac
+        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
+        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+          LD="${LD-ld}_sol2"
+        fi
+        ;;
       *)
        if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
          LD="${LD-ld} -64"
@@ -8948,7 +9673,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -8988,7 +9713,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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_MANIFEST_TOOL="mt"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -9068,7 +9793,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -9108,7 +9833,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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_DSYMUTIL="dsymutil"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -9160,7 +9885,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -9200,7 +9925,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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_NMEDIT="nmedit"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -9252,7 +9977,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -9292,7 +10017,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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_LIPO="lipo"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -9344,7 +10069,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -9384,7 +10109,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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_OTOOL="otool"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -9436,7 +10161,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -9476,7 +10201,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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_OTOOL64="otool64"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -9555,7 +10280,13 @@ else
        $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
          -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
         _lt_result=$?
-       if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+       # If there is a non-empty error log, and "single_module"
+       # appears in it, assume the flag caused a linker warning
+        if test -s conftest.err && $GREP single_module conftest.err; then
+         cat conftest.err >&5
+       # Otherwise, if the output was created with a 0 exit code from
+       # the compiler, it worked.
+       elif test -f libconftest.dylib && test $_lt_result -eq 0; then
          lt_cv_apple_cc_single_mod=yes
        else
          cat conftest.err >&5
@@ -9566,6 +10297,7 @@ else
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
 $as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
 if ${lt_cv_ld_exported_symbols_list+:} false; then :
@@ -9598,6 +10330,7 @@ rm -f core conftest.err conftest.$ac_objext \
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
 $as_echo_n "checking for -force_load linker flag... " >&6; }
 if ${lt_cv_ld_force_load+:} false; then :
@@ -9619,7 +10352,9 @@ _LT_EOF
       echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
       $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
       _lt_result=$?
-      if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+      if test -s conftest.err && $GREP force_load conftest.err; then
+       cat conftest.err >&5
+      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
        lt_cv_ld_force_load=yes
       else
        cat conftest.err >&5
@@ -9757,7 +10492,22 @@ fi
 
 # Check whether --with-pic was given.
 if test "${with_pic+set}" = set; then :
-  withval=$with_pic; pic_mode="$withval"
+  withval=$with_pic; lt_p=${PACKAGE-default}
+    case $withval in
+    yes|no) pic_mode=$withval ;;
+    *)
+      pic_mode=default
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for lt_pkg in $withval; do
+       IFS="$lt_save_ifs"
+       if test "X$lt_pkg" = "X$lt_p"; then
+         pic_mode=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
 else
   pic_mode=default
 fi
@@ -9835,6 +10585,10 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 
 
 
+
+
+
+
 test -z "$LN_S" && LN_S="ln -s"
 
 
@@ -10294,7 +11048,9 @@ lt_prog_compiler_static=
     case $cc_basename in
     nvcc*) # Cuda Compiler Driver 2.2
       lt_prog_compiler_wl='-Xlinker '
-      lt_prog_compiler_pic='-Xcompiler -fPIC'
+      if test -n "$lt_prog_compiler_pic"; then
+        lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+      fi
       ;;
     esac
   else
@@ -10385,18 +11141,33 @@ lt_prog_compiler_static=
        ;;
       *)
        case `$CC -V 2>&1 | sed 5q` in
-       *Sun\ F* | *Sun*Fortran*)
+       *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
          # Sun Fortran 8.3 passes all unrecognized flags to the linker
          lt_prog_compiler_pic='-KPIC'
          lt_prog_compiler_static='-Bstatic'
          lt_prog_compiler_wl=''
          ;;
+       *Sun\ F* | *Sun*Fortran*)
+         lt_prog_compiler_pic='-KPIC'
+         lt_prog_compiler_static='-Bstatic'
+         lt_prog_compiler_wl='-Qoption ld '
+         ;;
        *Sun\ C*)
          # Sun C 5.9
          lt_prog_compiler_pic='-KPIC'
          lt_prog_compiler_static='-Bstatic'
          lt_prog_compiler_wl='-Wl,'
          ;;
+        *Intel*\ [CF]*Compiler*)
+         lt_prog_compiler_wl='-Wl,'
+         lt_prog_compiler_pic='-fPIC'
+         lt_prog_compiler_static='-static'
+         ;;
+       *Portland\ Group*)
+         lt_prog_compiler_wl='-Wl,'
+         lt_prog_compiler_pic='-fpic'
+         lt_prog_compiler_static='-Bstatic'
+         ;;
        esac
        ;;
       esac
@@ -10758,7 +11529,6 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   hardcode_direct=no
   hardcode_direct_absolute=no
   hardcode_libdir_flag_spec=
-  hardcode_libdir_flag_spec_ld=
   hardcode_libdir_separator=
   hardcode_minus_L=no
   hardcode_shlibpath_var=unsupported
@@ -11008,8 +11778,7 @@ _LT_EOF
        xlf* | bgf* | bgxlf* | mpixlf*)
          # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
          whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
-         hardcode_libdir_flag_spec=
-         hardcode_libdir_flag_spec_ld='-rpath $libdir'
+         hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
          archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
          if test "x$supports_anon_versioning" = xyes; then
            archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
@@ -11388,6 +12157,7 @@ fi
        # The linker will not automatically build a static lib if we build a DLL.
        # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
        enable_shared_with_static_runtimes=yes
+       exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
        export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
        # Don't use ranlib
        old_postinstall_cmds='chmod 644 $oldlib'
@@ -11433,6 +12203,7 @@ fi
   hardcode_shlibpath_var=unsupported
   if test "$lt_cv_ld_force_load" = "yes"; then
     whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+
   else
     whole_archive_flag_spec=''
   fi
       hardcode_shlibpath_var=no
       ;;
 
-    freebsd1*)
-      ld_shlibs=no
-      ;;
-
     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
     # support.  Future versions do this automatically, but an explicit c++rt0.o
     # does not break anything, and helps significantly (at the cost of a little
@@ -11477,7 +12244,7 @@ fi
       ;;
 
     # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
+    freebsd2.*)
       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
       hardcode_direct=yes
       hardcode_minus_L=yes
@@ -11516,7 +12283,6 @@ fi
       fi
       if test "$with_gnu_ld" = no; then
        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-       hardcode_libdir_flag_spec_ld='+b $libdir'
        hardcode_libdir_separator=:
        hardcode_direct=yes
        hardcode_direct_absolute=yes
@@ -12140,11 +12906,6 @@ esac
 
 
 
-
-
-
-
-
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
 $as_echo_n "checking dynamic linker characteristics... " >&6; }
 
@@ -12234,7 +12995,7 @@ need_version=unknown
 
 case $host_os in
 aix3*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
@@ -12243,7 +13004,7 @@ aix3*)
   ;;
 
 aix[4-9]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
@@ -12308,7 +13069,7 @@ beos*)
   ;;
 
 bsdi[45]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
@@ -12447,7 +13208,7 @@ darwin* | rhapsody*)
   ;;
 
 dgux*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
@@ -12455,10 +13216,6 @@ dgux*)
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
 freebsd* | dragonfly*)
   # DragonFly does not have aout.  When/if they implement a new
   # versioning mechanism, adjust this.
@@ -12466,7 +13223,7 @@ freebsd* | dragonfly*)
     objformat=`/usr/bin/objformat`
   else
     case $host_os in
-    freebsd[123]*) objformat=aout ;;
+    freebsd[23].*) objformat=aout ;;
     *) objformat=elf ;;
     esac
   fi
@@ -12484,7 +13241,7 @@ freebsd* | dragonfly*)
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
-  freebsd2*)
+  freebsd2.*)
     shlibpath_overrides_runpath=yes
     ;;
   freebsd3.[01]* | freebsdelf3.[01]*)
@@ -12504,17 +13261,18 @@ freebsd* | dragonfly*)
   ;;
 
 gnu*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
   ;;
 
 haiku*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   dynamic_linker="$host_os runtime_loader"
@@ -12575,7 +13333,7 @@ hpux9* | hpux10* | hpux11*)
   ;;
 
 interix[3-9]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
@@ -12591,7 +13349,7 @@ irix5* | irix6* | nonstopux*)
     nonstopux*) version_type=nonstopux ;;
     *)
        if test "$lt_cv_prog_gnu_ld" = yes; then
-               version_type=linux
+               version_type=linux # correct to gnu/linux during the next big refactor
        else
                version_type=irix
        fi ;;
@@ -12628,9 +13386,9 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
-# This must be Linux ELF.
+# This must be glibc/ELF.
 linux* | k*bsd*-gnu | kopensolaris*-gnu)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -12716,7 +13474,7 @@ netbsd*)
   ;;
 
 newsos6)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
@@ -12785,7 +13543,7 @@ rdos*)
   ;;
 
 solaris*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -12810,7 +13568,7 @@ sunos4*)
   ;;
 
 sysv4 | sysv4.3*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
@@ -12834,7 +13592,7 @@ sysv4 | sysv4.3*)
 
 sysv4*MP*)
   if test -d /usr/nec ;then
-    version_type=linux
+    version_type=linux # correct to gnu/linux during the next big refactor
     library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
     soname_spec='$libname${shared_ext}.$major'
     shlibpath_var=LD_LIBRARY_PATH
@@ -12865,7 +13623,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
 
 tpf*)
   # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -12875,7 +13633,7 @@ tpf*)
   ;;
 
 uts4*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
@@ -13657,6 +14415,8 @@ CC="$lt_save_CC"
 
 
 
+
+
         ac_config_commands="$ac_config_commands libtool"
 
 
@@ -13683,7 +14443,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_YACC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -13726,7 +14486,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_LEX="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -13758,7 +14518,8 @@ a { ECHO; }
 b { REJECT; }
 c { yymore (); }
 d { yyless (1); }
-e { yyless (input () != 0); }
+e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument.  */
+    yyless ((input () != 0)); }
 f { unput (yytext[0]); }
 . { BEGIN INITIAL; }
 %%
@@ -13879,7 +14640,7 @@ fi
 
     warnCFLAGS=
 
-    common_flags="-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fasynchronous-unwind-tables"
+    common_flags="-fexceptions -fasynchronous-unwind-tables"
 
     case "$enable_compile_warnings" in
     no)
@@ -13905,6 +14666,8 @@ fi
        ;;
     esac
 
+
+
     compiler_flags=
     for option in $try_compiler_flags; do
        SAVE_CFLAGS="$CFLAGS"
 done
 
 
-VERSION_SCRIPT_FLAGS=
-$(/usr/bin/ld --help 2>&1 | grep -- --version-script >/dev/null) && \
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to pass version script to the linker ($LD)" >&5
+$as_echo_n "checking how to pass version script to the linker ($LD)... " >&6; }
+VERSION_SCRIPT_FLAGS=none
+if $LD --help 2>&1 | grep "version-script" >/dev/null 2>/dev/null; then
     VERSION_SCRIPT_FLAGS=-Wl,--version-script=
-test "`uname`" == "SunOS" && \
+elif $LD --help 2>&1 | grep "M mapfile" >/dev/null 2>/dev/null; then
     VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $VERSION_SCRIPT_FLAGS" >&5
+$as_echo "$VERSION_SCRIPT_FLAGS" >&6; }
 
- if test -n "$VERSION_SCRIPT_FLAGS"; then
+ if test "$VERSION_SCRIPT_FLAGS" != none; then
   USE_VERSION_SCRIPT_TRUE=
   USE_VERSION_SCRIPT_FALSE='#'
 else
@@ -14205,6 +14973,7 @@ fi
 
 
 
+
           LIBC_FATAL_STDERR_=1
   export LIBC_FATAL_STDERR_
 
@@ -14374,23 +15143,20 @@ else
 /* end confdefs.h.  */
 $ac_includes_default
 int
-find_stack_direction ()
+find_stack_direction (int *addr, int depth)
 {
-  static char *addr = 0;
-  auto char dummy;
-  if (addr == 0)
-    {
-      addr = &dummy;
-      return find_stack_direction ();
-    }
-  else
-    return (&dummy > addr) ? 1 : -1;
+  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 ()
+main (int argc, char **argv)
 {
-  return find_stack_direction () < 0;
+  return find_stack_direction (0, argc + !argv + 20) < 0;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -14703,9 +15469,9 @@ char buf[16];
 int main () {
   /* Check whether the given locale name is recognized by the system.  */
 #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -14714,7 +15480,7 @@ int main () {
   if (setlocale (LC_ALL, "") == NULL) return 1;
 #endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -14740,10 +15506,12 @@ int main () {
      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;
 }
 
@@ -14761,7 +15529,7 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the native Win32 locale name.
+          # 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
@@ -14771,7 +15539,7 @@ _ACEOF
           ;;
         *)
           # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -14813,6 +15581,81 @@ $as_echo "$gt_cv_locale_fr" >&6; }
 
 
 
+  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_RANDOM=0;
+  GNULIB_RANDOM_R=0;
+  GNULIB_REALLOC_POSIX=0;
+  GNULIB_REALPATH=0;
+  GNULIB_RPMATCH=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_RANDOM=1;
+  HAVE_RANDOM_H=1;
+  HAVE_RANDOM_R=1;
+  HAVE_REALPATH=1;
+  HAVE_RPMATCH=1;
+  HAVE_SETENV=1;
+  HAVE_DECL_SETENV=1;
+  HAVE_STRTOD=1;
+  HAVE_STRTOLL=1;
+  HAVE_STRTOULL=1;
+  HAVE_STRUCT_RANDOM_DATA=1;
+  HAVE_SYS_LOADAVG_H=0;
+  HAVE_UNLOCKPT=1;
+  HAVE_DECL_UNSETENV=1;
+  REPLACE_CALLOC=0;
+  REPLACE_CANONICALIZE_FILE_NAME=0;
+  REPLACE_MALLOC=0;
+  REPLACE_MBTOWC=0;
+  REPLACE_MKSTEMP=0;
+  REPLACE_PTSNAME_R=0;
+  REPLACE_PUTENV=0;
+  REPLACE_RANDOM_R=0;
+  REPLACE_REALLOC=0;
+  REPLACE_REALPATH=0;
+  REPLACE_SETENV=0;
+  REPLACE_STRTOD=0;
+  REPLACE_UNSETENV=0;
+  REPLACE_WCTOMB=0;
+
+
 
 
 
@@ -14879,21 +15722,142 @@ $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 "$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
 
     touch conftest.a
+    mkdir conftest.d
     if test "$cross_compiling" = yes; then :
-  gl_cv_func_realpath_works="guessing no"
+  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" ;;
+      esac
+
 else
   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 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>
+/* 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 <stdlib.h>
+        #include <string.h>
 
 int
 main ()
@@ -14915,6 +15879,12 @@ main ()
           if (name != NULL)
             result |= 4;
         }
+        {
+          char *name1 = realpath (".", NULL);
+          char *name2 = realpath ("conftest.d//./..", NULL);
+          if (strcmp (name1, name2) != 0)
+            result |= 8;
+        }
         return result;
 
   ;
@@ -14931,15 +15901,18 @@ 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
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_realpath_works" >&5
 $as_echo "$gl_cv_func_realpath_works" >&6; }
-  if test "$gl_cv_func_realpath_works" = yes; then
+  case "$gl_cv_func_realpath_works" in
+    *yes)
 
 $as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h
 
-  fi
+      ;;
+  esac
 
 
 
@@ -14988,73 +15961,6 @@ done
 
 
 
-  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_PTSNAME=0;
-  GNULIB_PUTENV=0;
-  GNULIB_RANDOM_R=0;
-  GNULIB_REALLOC_POSIX=0;
-  GNULIB_REALPATH=0;
-  GNULIB_RPMATCH=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_PTSNAME=1;
-  HAVE_RANDOM_H=1;
-  HAVE_RANDOM_R=1;
-  HAVE_REALPATH=1;
-  HAVE_RPMATCH=1;
-  HAVE_SETENV=1;
-  HAVE_DECL_SETENV=1;
-  HAVE_STRTOD=1;
-  HAVE_STRTOLL=1;
-  HAVE_STRTOULL=1;
-  HAVE_STRUCT_RANDOM_DATA=1;
-  HAVE_SYS_LOADAVG_H=0;
-  HAVE_UNLOCKPT=1;
-  HAVE_DECL_UNSETENV=1;
-  REPLACE_CALLOC=0;
-  REPLACE_CANONICALIZE_FILE_NAME=0;
-  REPLACE_MALLOC=0;
-  REPLACE_MBTOWC=0;
-  REPLACE_MKSTEMP=0;
-  REPLACE_PUTENV=0;
-  REPLACE_REALLOC=0;
-  REPLACE_REALPATH=0;
-  REPLACE_SETENV=0;
-  REPLACE_STRTOD=0;
-  REPLACE_UNSETENV=0;
-  REPLACE_WCTOMB=0;
-
-
   GNULIB_ISBLANK=0;
     HAVE_ISBLANK=1;
 
@@ -15184,6 +16090,9 @@ else
 /* end confdefs.h.  */
 
 #include <errno.h>
+#if !defined ETXTBSY
+booboo
+#endif
 #if !defined ENOMSG
 booboo
 #endif
@@ -15208,6 +16117,12 @@ booboo
 #if !defined ENOTSUP
 booboo
 #endif
+#if !defined ENETRESET
+booboo
+#endif
+#if !defined ECONNABORTED
+booboo
+#endif
 #if !defined ESTALE
 booboo
 #endif
@@ -15217,6 +16132,12 @@ booboo
 #if !defined ECANCELED
 booboo
 #endif
+#if !defined EOWNERDEAD
+booboo
+#endif
+#if !defined ENOTRECOVERABLE
+booboo
+#endif
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
@@ -15260,13 +16181,27 @@ _ACEOF
                  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 'errno.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_next_errno_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-                  sed -n '\#/errno.h#{
-                    s#.*"\(.*/errno.h\)".*#\1#
-                    s#^/[^/]#//&#
-                    p
-                    q
-                  }'`'"'
+                      sed -n "$gl_absolute_header_sed"`'"'
 
 
 fi
@@ -15290,6 +16225,14 @@ $as_echo "$gl_cv_next_errno_h" >&6; }
     ERRNO_H='errno.h'
   fi
 
+   if test -n "$ERRNO_H"; then
+  GL_GENERATE_ERRNO_H_TRUE=
+  GL_GENERATE_ERRNO_H_FALSE='#'
+else
+  GL_GENERATE_ERRNO_H_TRUE='#'
+  GL_GENERATE_ERRNO_H_FALSE=
+fi
+
 
   if test -n "$ERRNO_H"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5
@@ -15505,6 +16448,196 @@ $as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; }
 
 
 
+  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;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  :
+
+
+
+
+
+
+  :
+
+
+
+
+
+  { $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
+            };
+
+int
+main ()
+{
+
+            int result = !constants;
+            #if HAVE_SYMLINK
+            {
+              static char const sym[] = "conftest.sym";
+              if (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; }
+
+  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
+
+
+  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
+
+
+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
+
+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 :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define mode_t int
+_ACEOF
+
+fi
+
+
 
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5
 $as_echo_n "checking for mbstate_t... " >&6; }
@@ -15592,23 +16725,31 @@ $as_echo "#define mbstate_t int" >>confdefs.h
 
   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;
@@ -15619,11 +16760,15 @@ $as_echo "#define mbstate_t int" >>confdefs.h
   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;
@@ -15642,11 +16787,14 @@ $as_echo "#define mbstate_t int" >>confdefs.h
   HAVE_DPRINTF=1;
   HAVE_FSEEKO=1;
   HAVE_FTELLO=1;
+  HAVE_PCLOSE=1;
+  HAVE_POPEN=1;
   HAVE_RENAMEAT=1;
   HAVE_VASPRINTF=1;
   HAVE_VDPRINTF=1;
   REPLACE_DPRINTF=0;
   REPLACE_FCLOSE=0;
+  REPLACE_FDOPEN=0;
   REPLACE_FFLUSH=0;
   REPLACE_FOPEN=0;
   REPLACE_FPRINTF=0;
@@ -15667,6 +16815,7 @@ $as_echo "#define mbstate_t int" >>confdefs.h
   REPLACE_RENAMEAT=0;
   REPLACE_SNPRINTF=0;
   REPLACE_SPRINTF=0;
+  REPLACE_STDIO_READ_FUNCS=0;
   REPLACE_STDIO_WRITE_FUNCS=0;
   REPLACE_TMPFILE=0;
   REPLACE_VASPRINTF=0;
@@ -15708,8 +16857,10 @@ _ACEOF
 
 
 
+  GNULIB_CHDIR=0;
   GNULIB_CHOWN=0;
   GNULIB_CLOSE=0;
+  GNULIB_DUP=0;
   GNULIB_DUP2=0;
   GNULIB_DUP3=0;
   GNULIB_ENVIRON=0;
@@ -15717,6 +16868,7 @@ _ACEOF
   GNULIB_FACCESSAT=0;
   GNULIB_FCHDIR=0;
   GNULIB_FCHOWNAT=0;
+  GNULIB_FDATASYNC=0;
   GNULIB_FSYNC=0;
   GNULIB_FTRUNCATE=0;
   GNULIB_GETCWD=0;
@@ -15728,6 +16880,8 @@ _ACEOF
   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;
@@ -15736,14 +16890,16 @@ _ACEOF
   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_GETOPT=0;
+  GNULIB_UNISTD_H_NONBLOCKING=0;
   GNULIB_UNISTD_H_SIGPIPE=0;
   GNULIB_UNLINK=0;
   GNULIB_UNLINKAT=0;
@@ -15756,6 +16912,7 @@ _ACEOF
   HAVE_FACCESSAT=1;
   HAVE_FCHDIR=1;
   HAVE_FCHOWNAT=1;
+  HAVE_FDATASYNC=1;
   HAVE_FSYNC=1;
   HAVE_FTRUNCATE=1;
   HAVE_GETDTABLESIZE=1;
@@ -15763,6 +16920,7 @@ _ACEOF
   HAVE_GETHOSTNAME=1;
   HAVE_GETLOGIN=1;
   HAVE_GETPAGESIZE=1;
+  HAVE_GROUP_MEMBER=1;
   HAVE_LCHOWN=1;
   HAVE_LINK=1;
   HAVE_LINKAT=1;
@@ -15772,6 +16930,7 @@ _ACEOF
   HAVE_PWRITE=1;
   HAVE_READLINK=1;
   HAVE_READLINKAT=1;
+  HAVE_SETHOSTNAME=1;
   HAVE_SLEEP=1;
   HAVE_SYMLINK=1;
   HAVE_SYMLINKAT=1;
@@ -15779,10 +16938,12 @@ _ACEOF
   HAVE_USLEEP=1;
   HAVE_DECL_ENVIRON=1;
   HAVE_DECL_FCHDIR=1;
+  HAVE_DECL_FDATASYNC=1;
   HAVE_DECL_GETDOMAINNAME=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;
@@ -15791,17 +16952,20 @@ _ACEOF
   REPLACE_DUP=0;
   REPLACE_DUP2=0;
   REPLACE_FCHOWNAT=0;
+  REPLACE_FTRUNCATE=0;
   REPLACE_GETCWD=0;
   REPLACE_GETDOMAINNAME=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_RMDIR=0;
   REPLACE_SLEEP=0;
@@ -15860,13 +17024,27 @@ _ACEOF
                  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 'getopt.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_next_getopt_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-                  sed -n '\#/getopt.h#{
-                    s#.*"\(.*/getopt.h\)".*#\1#
-                    s#^/[^/]#//&#
-                    p
-                    q
-                  }'`'"'
+                      sed -n "$gl_absolute_header_sed"`'"'
           else
                gl_cv_next_getopt_h='<'getopt.h'>'
              fi
@@ -15932,56 +17110,124 @@ done
 
   fi
 
-                    if test -z "$gl_replace_getopt"; then
+          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
 
-                                                                        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+                                                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;}
+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.  */
+
 #include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
 int
 main ()
 {
-int *p = &optreset; return optreset;
-  ;
+  static char program[] = "program";
+  static char a[] = "-a";
+  static char foo[] = "foo";
+  static char bar[] = "bar";
+  char *argv[] = { program, a, foo, bar, NULL };
+  int c;
+
+  c = getopt (4, argv, "ab");
+  if (!(c == 'a'))
+    return 1;
+  c = getopt (4, argv, "ab");
+  if (!(c == -1))
+    return 2;
+  if (!(optind == 2))
+    return 3;
   return 0;
 }
+
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_optind_min=1
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_getopt_posix=maybe
+else
+  gl_cv_func_getopt_posix=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_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;}
+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.  */
-#include <getopt.h>
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
 int
 main ()
 {
-return !getopt_clip;
-  ;
+  static char program[] = "program";
+  static char donald[] = "donald";
+  static char p[] = "-p";
+  static char billy[] = "billy";
+  static char duck[] = "duck";
+  static char a[] = "-a";
+  static char bar[] = "bar";
+  char *argv[] = { program, donald, p, billy, duck, a, bar, NULL };
+  int c;
+
+  c = getopt (7, argv, "+abp:q:");
+  if (!(c == -1))
+    return 4;
+  if (!(strcmp (argv[0], "program") == 0))
+    return 5;
+  if (!(strcmp (argv[1], "donald") == 0))
+    return 6;
+  if (!(strcmp (argv[2], "-p") == 0))
+    return 7;
+  if (!(strcmp (argv[3], "billy") == 0))
+    return 8;
+  if (!(strcmp (argv[4], "duck") == 0))
+    return 9;
+  if (!(strcmp (argv[5], "-a") == 0))
+    return 10;
+  if (!(strcmp (argv[6], "bar") == 0))
+    return 11;
+  if (!(optind == 1))
+    return 12;
   return 0;
 }
+
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_optind_min=1
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_getopt_posix=maybe
 else
-  gl_optind_min=0
+  gl_cv_func_getopt_posix=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
-
-                gl_save_CPPFLAGS=$CPPFLAGS
-        CPPFLAGS="$CPPFLAGS -DOPTIND_MIN=$gl_optind_min"
-        if test "$cross_compiling" = yes; then :
-  case "$host_os" in
-             mingw*)         gl_cv_func_getopt_posix="guessing no";;
-             darwin* | aix*) gl_cv_func_getopt_posix="guessing no";;
-             *)              gl_cv_func_getopt_posix="guessing yes";;
-           esac
 
+          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;}
+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.  */
@@ -15993,80 +17239,17 @@ else
 int
 main ()
 {
-  {
-    int argc = 0;
-    char *argv[10];
-    int c;
-
-    argv[argc++] = "program";
-    argv[argc++] = "-a";
-    argv[argc++] = "foo";
-    argv[argc++] = "bar";
-    argv[argc] = NULL;
-    optind = OPTIND_MIN;
-    opterr = 0;
-
-    c = getopt (argc, argv, "ab");
-    if (!(c == 'a'))
-      return 1;
-    c = getopt (argc, argv, "ab");
-    if (!(c == -1))
-      return 2;
-    if (!(optind == 2))
-      return 3;
-  }
-  /* Some internal state exists at this point.  */
-  {
-    int argc = 0;
-    char *argv[10];
-    int c;
-
-    argv[argc++] = "program";
-    argv[argc++] = "donald";
-    argv[argc++] = "-p";
-    argv[argc++] = "billy";
-    argv[argc++] = "duck";
-    argv[argc++] = "-a";
-    argv[argc++] = "bar";
-    argv[argc] = NULL;
-    optind = OPTIND_MIN;
-    opterr = 0;
-
-    c = getopt (argc, argv, "+abp:q:");
-    if (!(c == -1))
-      return 4;
-    if (!(strcmp (argv[0], "program") == 0))
-      return 5;
-    if (!(strcmp (argv[1], "donald") == 0))
-      return 6;
-    if (!(strcmp (argv[2], "-p") == 0))
-      return 7;
-    if (!(strcmp (argv[3], "billy") == 0))
-      return 8;
-    if (!(strcmp (argv[4], "duck") == 0))
-      return 9;
-    if (!(strcmp (argv[5], "-a") == 0))
-      return 10;
-    if (!(strcmp (argv[6], "bar") == 0))
-      return 11;
-    if (!(optind == 1))
-      return 12;
-  }
-  /* Detect MacOS 10.5, AIX 7.1 bug.  */
-  {
-    char *argv[3] = { "program", "-ab", NULL };
-    optind = OPTIND_MIN;
-    opterr = 0;
-    if (getopt (2, argv, "ab:") != 'a')
-      return 13;
-    if (getopt (2, argv, "ab:") != '?')
-      return 14;
-    if (optopt != 'b')
-      return 15;
-    if (optind != 2)
-      return 16;
-  }
-
+  static char program[] = "program";
+  static char ab[] = "-ab";
+  char *argv[3] = { program, ab, NULL };
+  if (getopt (2, argv, "ab:") != 'a')
+    return 13;
+  if (getopt (2, argv, "ab:") != '?')
+    return 14;
+  if (optopt != 'b')
+    return 15;
+  if (optind != 2)
+    return 16;
   return 0;
 }
 
@@ -16080,7 +17263,13 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-        CPPFLAGS=$gl_save_CPPFLAGS
+          fi
+        else
+          case "$host_os" in
+            darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";;
+            *)                       gl_cv_func_getopt_posix="guessing yes";;
+          esac
+        fi
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_posix" >&5
@@ -16111,11 +17300,7 @@ else
        POSIXLY_CORRECT=1
        export POSIXLY_CORRECT
        if test "$cross_compiling" = yes; then :
-           case $host_os:$ac_cv_have_decl_optreset in
-           *-gnu*:* | mingw*:*) gl_cv_func_getopt_gnu=no;;
-           *:yes)               gl_cv_func_getopt_gnu=no;;
-           *)                   gl_cv_func_getopt_gnu=yes;;
-         esac
+           gl_cv_func_getopt_gnu="guessing no"
 
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -16124,28 +17309,147 @@ else
                            #include <stddef.h>
                            #include <string.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 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>
+/* 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
+
+
 int
 main ()
 {
 
              int result = 0;
+
+             nocrash_init();
+
              /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
-                and fails on MacOS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
+                and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
                 OSF/1 5.1, Solaris 10.  */
              {
-               char *myargv[3];
-               myargv[0] = "conftest";
-               myargv[1] = "-+";
-               myargv[2] = 0;
+               static char conftest[] = "conftest";
+               static char plus[] = "-+";
+               char *argv[3] = { conftest, plus, NULL };
                opterr = 0;
-               if (getopt (2, myargv, "+a") != '?')
+               if (getopt (2, argv, "+a") != '?')
                  result |= 1;
              }
              /* This code succeeds on glibc 2.8, mingw,
-                and fails on MacOS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+                and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
                 IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x.  */
              {
-               char *argv[] = { "program", "-p", "foo", "bar", NULL };
+               static char program[] = "program";
+               static char p[] = "-p";
+               static char foo[] = "foo";
+               static char bar[] = "bar";
+               char *argv[] = { program, p, foo, bar, NULL };
 
                optind = 1;
                if (getopt (4, argv, "p::") != 'p')
@@ -16159,20 +17463,36 @@ main ()
              }
              /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0.  */
              {
-               char *argv[] = { "program", "foo", "-p", NULL };
+               static char program[] = "program";
+               static char foo[] = "foo";
+               static char p[] = "-p";
+               char *argv[] = { program, foo, p, NULL };
                optind = 0;
                if (getopt (3, argv, "-p") != 1)
                  result |= 16;
                else if (getopt (3, argv, "-p") != 'p')
-                 result |= 32;
+                 result |= 16;
              }
              /* This code fails on glibc 2.11.  */
              {
-               char *argv[] = { "program", "-b", "-a", NULL };
+               static char program[] = "program";
+               static char b[] = "-b";
+               static char a[] = "-a";
+               char *argv[] = { program, b, a, NULL };
                optind = opterr = 0;
                if (getopt (3, argv, "+:a:b") != 'b')
-                 result |= 64;
+                 result |= 32;
                else if (getopt (3, argv, "+:a:b") != ':')
+                 result |= 32;
+             }
+             /* This code dumps core on glibc 2.14.  */
+             {
+               static char program[] = "program";
+               static char w[] = "-W";
+               static char dummy[] = "dummy";
+               char *argv[] = { program, w, dummy, NULL };
+               optind = opterr = 1;
+               if (getopt (3, argv, "W;") != 'W')
                  result |= 64;
              }
              return result;
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_gnu" >&5
 $as_echo "$gl_cv_func_getopt_gnu" >&6; }
-    if test "$gl_cv_func_getopt_gnu" = "no"; then
+    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 :
+              case "$host_os" in
+              openbsd*) gl_cv_func_getopt_long_gnu="guessing no";;
+              *)        gl_cv_func_getopt_long_gnu="guessing yes";;
+            esac
+
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <getopt.h>
+                #include <stddef.h>
+                #include <string.h>
+
+int
+main ()
+{
+static const struct option long_options[] =
+                  {
+                    { "xtremely-",no_argument,       NULL, 1003 },
+                    { "xtra",     no_argument,       NULL, 1001 },
+                    { "xtreme",   no_argument,       NULL, 1002 },
+                    { "xtremely", no_argument,       NULL, 1003 },
+                    { NULL,       0,                 NULL, 0 }
+                  };
+                /* This code fails on OpenBSD 5.0.  */
+                {
+                  static char program[] = "program";
+                  static char xtremel[] = "--xtremel";
+                  char *argv[] = { program, xtremel, NULL };
+                  int option_index;
+                  optind = 1; opterr = 0;
+                  if (getopt_long (2, argv, "", long_options, &option_index) != 1003)
+                    return 1;
+                }
+                return 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_getopt_long_gnu=yes
+else
+  gl_cv_func_getopt_long_gnu=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_getopt_long_gnu" >&5
+$as_echo "$gl_cv_func_getopt_long_gnu" >&6; }
+      case "$gl_cv_func_getopt_long_gnu" in
+        *yes) ;;
+        *) gl_replace_getopt=yes ;;
+      esac
     fi
   fi
 
 
+
+
+
+
+    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
+
+
+
+  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
@@ -16218,30 +17621,32 @@ _ACEOF
 
 
 
+  GNULIB_GETTIMEOFDAY=0;
+    HAVE_GETTIMEOFDAY=1;
+  HAVE_STRUCT_TIMEVAL=1;
+  HAVE_SYS_TIME_H=1;
+  REPLACE_GETTIMEOFDAY=0;
+  REPLACE_STRUCT_TIMEVAL=0;
 
 
 
 
-  if test -n "$gl_replace_getopt"; then :
 
 
 
-  GETOPT_H=getopt.h
 
-$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h
 
 
 
-    GNULIB_UNISTD_H_GETOPT=1
 
 
 
 
+  :
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext"
 
 
 
@@ -16249,157 +17654,303 @@ $as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h
 
 
 
+  :
 
 
-  gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext"
 
 
 
-  :
 
 
 
+     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
+
+               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/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_next_sys_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
+          else
+               gl_cv_next_sys_time_h='<'sys/time.h'>'
+             fi
 
 
 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
 
 
-  GNULIB_NL_LANGINFO=0;
-    HAVE_NL_LANGINFO=1;
-  REPLACE_NL_LANGINFO=0;
 
 
 
+  if test $ac_cv_header_sys_time_h != yes; then
+    HAVE_SYS_TIME_H=0
+  fi
 
 
 
 
 
-  { $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 :
+  :
+
+
+
+
+
+  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
+
+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
+
+
+  { $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
-  if test "$cross_compiling" = yes; then :
-  gl_cv_header_working_fcntl_h=cross-compiling
+  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 ()
+{
+static struct timeval x; x.tv_sec = x.tv_usec;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_sys_struct_timeval=yes
+else
+  gl_cv_sys_struct_timeval=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_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
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/types.h>
-           #include <sys/stat.h>
-           #include <unistd.h>
-           #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
-            };
+#if HAVE_SYS_TIME_H
+               #include <sys/time.h>
+              #endif
+              #include <time.h>
+              #if HAVE_WINSOCK2_H
+              # include <winsock2.h>
+              #endif
 
 int
 main ()
 {
+static struct timeval x;
+              typedef int verify_tv_sec_type[
+                sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
+              ];
 
-            int result = !constants;
-            {
-              static char const sym[] = "conftest.sym";
-              if (symlink (".", sym) != 0)
-                result |= 2;
-              else
-                {
-                  int fd = open (sym, O_RDONLY | O_NOFOLLOW);
-                  if (fd >= 0)
-                    {
-                      close (fd);
-                      result |= 4;
-                    }
-                }
-              unlink (sym);
-            }
-            {
-              static char const file[] = "confdefs.h";
-              int fd = open (file, O_RDONLY | O_NOATIME);
-              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
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_sys_struct_timeval_tv_sec=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
+  gl_cv_sys_struct_timeval_tv_sec=no
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 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; }
+{ $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
 
-  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
+    for gl_func in gettimeofday; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if eval \${$as_gl_Symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#if HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+#include <time.h>
+
+int
+main ()
+{
+#undef $gl_func
+  (void) $gl_func;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$as_gl_Symbol=yes"
+else
+  eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
 _ACEOF
 
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
+      done
 
-  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
+
+
+
+
+
+
+
+
+
+  GNULIB_NL_LANGINFO=0;
+    HAVE_NL_LANGINFO=1;
+  REPLACE_NL_LANGINFO=0;
+
+
+
+
+
+
+
+
+  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
+  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 ()
+{
+
+  ;
+  return 0;
+}
 _ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_type_off_t_64=yes
+else
+  gl_cv_type_off_t_64=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_off_t_64" >&5
+$as_echo "$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
+      ;;
+    *)
+                                                      WINDOWS_64_BIT_OFF_T=0
+      WINDOWS_64_BIT_ST_SIZE=0
+      ;;
+  esac
 
 
       ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default"
@@ -16452,16 +18003,18 @@ $as_echo "$ac_cv_gnu_library_2_1" >&6; }
 
 
 
+  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_WCHAR_T=1;
-  STDDEF_H='';
 
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5
@@ -16499,6 +18052,7 @@ $as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h
 
 
 
+  STDDEF_H=
   if test $gt_cv_c_wchar_t = no; then
     HAVE_WCHAR_T=0
     STDDEF_H=stddef.h
@@ -16534,6 +18088,15 @@ $as_echo "$gl_cv_decl_null_works" >&6; }
     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
 
 
@@ -16561,13 +18124,27 @@ _ACEOF
                  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_next_stddef_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-                  sed -n '\#/stddef.h#{
-                    s#.*"\(.*/stddef.h\)".*#\1#
-                    s#^/[^/]#//&#
-                    p
-                    q
-                  }'`'"'
+                      sed -n "$gl_absolute_header_sed"`'"'
 
 
 fi
@@ -16597,6 +18174,7 @@ $as_echo "$gl_cv_next_stddef_h" >&6; }
 
 
      GNULIB_FCHMODAT=0;
+  GNULIB_FSTAT=0;
   GNULIB_FSTATAT=0;
   GNULIB_FUTIMENS=0;
   GNULIB_LCHMOD=0;
@@ -16635,19 +18213,21 @@ $as_echo "$gl_cv_next_stddef_h" >&6; }
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
+      { $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 ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then :
+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 "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
        if test "$cross_compiling" = yes; then :
-  # When cross-compiling, be pessimistic so we will end up using the
-          # replacement version of lstat that checks for trailing slashes and
-          # calls lstat a second time when necessary.
-          ac_cv_func_lstat_dereferences_slashed_symlink=no
+  case "$host_os" in
+                    # Guess yes on glibc systems.
+            *-gnu*) 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
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -16667,9 +18247,9 @@ struct stat sbuf;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_func_lstat_dereferences_slashed_symlink=yes
+  gl_cv_func_lstat_dereferences_slashed_symlink=yes
 else
-  ac_cv_func_lstat_dereferences_slashed_symlink=no
+  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
      else
        # If the 'ln -s' command failed, then we probably don't even
        # have an lstat function.
-       ac_cv_func_lstat_dereferences_slashed_symlink=no
+       gl_cv_func_lstat_dereferences_slashed_symlink="guessing no"
      fi
      rm -f conftest.sym conftest.file
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5
-$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; }
-  test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
+{ $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 "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then
-
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext"
-
-  fi
+      ;;
+  esac
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
 $as_echo_n "checking for inline... " >&6; }
@@ -16779,7 +18350,8 @@ fi
 $as_echo "$gl_cv_func_malloc_posix" >&6; }
 
 
-  for ac_header in stdlib.h
+
+      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 :
 
 done
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
+  { $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 :
-  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 ;;
+        esac
+
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #if defined STDC_HEADERS || defined HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-char *malloc ();
-#endif
+            # include <stdlib.h>
+            #else
+            char *malloc ();
+            #endif
 
 int
 main ()
@@ -16814,6 +18394,7 @@ return ! malloc (0);
   ;
   return 0;
 }
+
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
   ac_cv_func_malloc_0_nonnull=yes
@@ -16824,10 +18405,11 @@ 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_malloc_0_nonnull" >&5
 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
-if test $ac_cv_func_malloc_0_nonnull = yes; then :
+  if test $ac_cv_func_malloc_0_nonnull = yes; then :
   gl_cv_func_malloc_0_nonnull=1
 else
   gl_cv_func_malloc_0_nonnull=0
@@ -16992,9 +18574,9 @@ int main ()
   const char *p;
   /* Check whether the given locale name is recognized by the system.  */
 #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -17003,7 +18585,7 @@ int main ()
   if (setlocale (LC_ALL, "") == NULL) return 1;
 #endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -17052,13 +18634,14 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Note that on native Win32, the Japanese locale is Japanese_Japan.932,
-          # and CP932 is very different from EUC-JP, so we cannot use it here.
+          # 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 MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -17131,9 +18714,9 @@ int main ()
   const char *p;
   /* Check whether the given locale name is recognized by the system.  */
 #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -17142,7 +18725,7 @@ int main ()
   if (setlocale (LC_ALL, "") == NULL) return 1;
 #endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -17191,7 +18774,7 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the hypothetical native Win32 locale name.
+          # 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
@@ -17199,9 +18782,15 @@ _ACEOF
             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 MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -17258,9 +18847,9 @@ int main () {
 #if !(defined __BEOS__ || defined __HAIKU__)
   /* Check whether the given locale name is recognized by the system.  */
 # if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -17269,7 +18858,7 @@ int main () {
   if (setlocale (LC_ALL, "") == NULL) return 1;
 # endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -17295,10 +18884,12 @@ int main () {
       || 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;
 }
 
@@ -17316,7 +18907,7 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the hypothetical native Win32 locale name.
+          # 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
@@ -17326,7 +18917,7 @@ _ACEOF
           ;;
         *)
           # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -17368,6 +18959,8 @@ $as_echo "$gt_cv_locale_fr_utf8" >&6; }
 
 
 
+  GNULIB_FFSL=0;
+  GNULIB_FFSLL=0;
   GNULIB_MEMCHR=0;
   GNULIB_MEMMEM=0;
   GNULIB_MEMPCPY=0;
@@ -17404,7 +18997,9 @@ $as_echo "$gt_cv_locale_fr_utf8" >&6; }
   GNULIB_STRSIGNAL=0;
   GNULIB_STRVERSCMP=0;
   HAVE_MBSLEN=0;
-    HAVE_MEMCHR=1;
+    HAVE_FFSL=1;
+  HAVE_FFSLL=1;
+  HAVE_MEMCHR=1;
   HAVE_DECL_MEMMEM=1;
   HAVE_MEMPCPY=1;
   HAVE_DECL_MEMRCHR=1;
@@ -17428,6 +19023,7 @@ $as_echo "$gt_cv_locale_fr_utf8" >&6; }
   REPLACE_STRDUP=0;
   REPLACE_STRSTR=0;
   REPLACE_STRCASESTR=0;
+  REPLACE_STRCHRNUL=0;
   REPLACE_STRERROR=0;
   REPLACE_STRERROR_R=0;
   REPLACE_STRNCAT=0;
@@ -17441,11 +19037,6 @@ $as_echo "$gt_cv_locale_fr_utf8" >&6; }
 
 
 
-
-
-
-
-
   # 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.
@@ -17467,12 +19058,12 @@ $as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
 
 #include <sys/mman.h>
 #ifdef MAP_ANONYMOUS
-    I cant identify this map.
+    I cannot identify this map
 #endif
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cant identify this map." >/dev/null 2>&1; then :
+  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
   gl_have_mmap_anonymous=yes
 fi
 rm -f conftest*
@@ -17483,12 +19074,12 @@ rm -f conftest*
 
 #include <sys/mman.h>
 #ifdef MAP_ANON
-    I cant identify this map.
+    I cannot identify this map
 #endif
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cant identify this map." >/dev/null 2>&1; then :
+  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
 
 $as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
 
@@ -17523,13 +19114,7 @@ $as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
 
 
 
-  :
-
-
-
-
-
-  if test $ac_cv_func_memchr = yes; then
+  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
@@ -17615,36 +19200,13 @@ $as_echo "$gl_cv_func_memchr_works" >&6; }
     if test "$gl_cv_func_memchr_works" != yes; then
       REPLACE_MEMCHR=1
     fi
-  else
-    HAVE_MEMCHR=0
   fi
-  if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
-
-
 
 
 
 
 
 
-  gl_LIBOBJS="$gl_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
-
-fi
-
-done
-
-
-  fi
-
 
     gl_cv_c_multiarch=no
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -17702,11 +19264,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
 
-
-
-
-
-
 # Check whether --with-selinux was given.
 if test "${with_selinux+set}" = set; then :
   withval=$with_selinux;
 
 
 
-      ac_fn_c_check_decl "$LINENO" "stpncpy" "ac_cv_have_decl_stpncpy" "$ac_includes_default"
-if test "x$ac_cv_have_decl_stpncpy" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STPNCPY $ac_have_decl
-_ACEOF
+
+  if test $ac_cv_type_long_long_int = yes; then
+    HAVE_LONG_LONG_INT=1
+  else
+    HAVE_LONG_LONG_INT=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
+  else
+    HAVE_INTTYPES_H=0
+  fi
 
 
+      if test $ac_cv_header_sys_types_h = yes; then
+    HAVE_SYS_TYPES_H=1
+  else
+    HAVE_SYS_TYPES_H=0
+  fi
 
 
 
@@ -17911,6 +19498,7 @@ _ACEOF
 
 
 
+  :
 
 
 
@@ -17920,195 +19508,329 @@ _ACEOF
 
 
      if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_string_h='<'string.h'>'
+       gl_cv_next_stdint_h='<'stdint.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 "$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
 
+             if test $ac_cv_header_stdint_h = yes; then
+
+
                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <string.h>
+#include <stdint.h>
 
 _ACEOF
                                                                                                                         case "$host_os" in
                  aix*) gl_absname_cpp="$ac_cpp -C" ;;
                  *)    gl_absname_cpp="$ac_cpp" ;;
                esac
-                                                            gl_cv_next_string_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-                  sed -n '\#/string.h#{
-                    s#.*"\(.*/string.h\)".*#\1#
-                    s#^/[^/]#//&#
-                    p
-                    q
-                  }'`'"'
+
+               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_next_stdint_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
+          else
+               gl_cv_next_stdint_h='<'stdint.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; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5
+$as_echo "$gl_cv_next_stdint_h" >&6; }
      fi
-     NEXT_STRING_H=$gl_cv_next_string_h
+     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='<'string.h'>'
+       gl_next_as_first_directive='<'stdint.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_stdint_h
      fi
-     NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive
+     NEXT_AS_FIRST_DIRECTIVE_STDINT_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
 
 
-    for gl_func in memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup      strncat strndup strnlen strpbrk strsep strcasestr strtok_r strerror_r      strsignal strverscmp; do
-    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
-$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
-if eval \${$as_gl_Symbol+:} false; then :
+    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
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  gl_cv_header_working_stdint_h=no
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <string.h>
-
-int
-main ()
-{
-#undef $gl_func
-  (void) $gl_func;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval "$as_gl_Symbol=yes"
-else
-  eval "$as_gl_Symbol=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$as_gl_Symbol
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-     if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
-_ACEOF
 
-                     eval ac_cv_have_decl_$gl_func=yes
-fi
-      done
-
-
-
-      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
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRNDUP $ac_have_decl
-_ACEOF
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#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
 
 
+  /* 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
 
 
+#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;
 
+#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;
 
+  /* 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;
+};
 
-      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
+int
+main ()
+{
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRNLEN $ac_have_decl
+  ;
+  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 "$gl_cv_func_memchr_works" != yes; then
-    REPLACE_STRSTR=1
-
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext"
-
-  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
+  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=yes
-else
-  gl_cv_func_strstr_works_always="guessing no"
-fi
-rm -f conftest*
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#include <stdint.h>
 
 
-else
-  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 <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 <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
+  };
 
 int
 main ()
 {
-return !!strstr (HAYSTACK, NEEDLE);
+
+  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_func_strstr_works_always=yes
-else
-  gl_cv_func_strstr_works_always=no
+  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
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5
-$as_echo "$gl_cv_func_strstr_works_always" >&6; }
-    if test "$gl_cv_func_strstr_works_always" != yes; then
-      REPLACE_STRSTR=1
+rm -f core conftest.err conftest.$ac_objext 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; }
+  fi
+  if test "$gl_cv_header_working_stdint_h" = yes; then
+    STDINT_H=
+  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
 
+fi
 
+done
 
+    if test $ac_cv_header_sys_inttypes_h = yes; then
+      HAVE_SYS_INTTYPES_H=1
+    else
+      HAVE_SYS_INTTYPES_H=0
+    fi
 
+    if test $ac_cv_header_sys_bitypes_h = yes; then
+      HAVE_SYS_BITYPES_H=1
+    else
+      HAVE_SYS_BITYPES_H=0
+    fi
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext"
+  if test $APPLE_UNIVERSAL_BUILD = 0; then
 
-    fi
-  fi
 
-{ $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 :
+  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
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/stat.h>
+  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
 
-#if defined S_ISBLK && defined S_IFDIR
-extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
-#endif
+#include <limits.h>"; then :
 
-#if defined S_ISBLK && defined S_IFCHR
-extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
-#endif
-
-#if defined S_ISLNK && defined S_IFREG
-extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
-#endif
-
-#if defined S_ISSOCK && defined S_IFREG
-extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
-#endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stat_broken=no
 else
-  ac_cv_header_stat_broken=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  result=unknown
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5
-$as_echo "$ac_cv_header_stat_broken" >&6; }
-if test $ac_cv_header_stat_broken = yes; then
 
-$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h
+       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
 
 
+  fi
 
 
+  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 :
 
-  GNULIB_WAITPID=0;
-
-
-
-
-
-
-
-  GNULIB_MKTIME=0;
-  GNULIB_NANOSLEEP=0;
-  GNULIB_STRPTIME=0;
-  GNULIB_TIMEGM=0;
-  GNULIB_TIME_R=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;
-
-
-
-
-
-
+else
+  result=unknown
+fi
 
+       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
 
 
 
 
-  { $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 :
+  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
 /* end confdefs.h.  */
-#include <time.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 ()
 {
-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
+  result=yes
 else
-  gl_cv_sys_struct_timespec_in_time_h=no
+  result=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       eval gl_cv_type_${gltype}_signed=\$result
+
 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; }
+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
 
-  TIME_H_DEFINES_STRUCT_TIMESPEC=0
-  SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
-  PTHREAD_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 :
+      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
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  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.  */
-#include <sys/time.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 ()
 {
-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
+  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
-{ $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 :
+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
+
+
+  fi
+
+
+  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
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  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.  */
-#include <pthread.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 ()
 {
-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
+  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
-{ $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
-      fi
-    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
+
+
+
+          if test $BITSIZEOF_WINT_T -lt 32; then
+    BITSIZEOF_WINT_T=32
+  fi
+
+    STDINT_H=stdint.h
   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
+
+
+
+      ac_fn_c_check_decl "$LINENO" "stpncpy" "ac_cv_have_decl_stpncpy" "$ac_includes_default"
+if test "x$ac_cv_have_decl_stpncpy" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STPNCPY $ac_have_decl
+_ACEOF
+
+
+
+
 
 
 
@@ -18325,361 +20214,400 @@ $as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; }
 
 
      if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_time_h='<'time.h'>'
+       gl_cv_next_string_h='<'string.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 "$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
 
                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <time.h>
+#include <string.h>
 
 _ACEOF
                                                                                                                         case "$host_os" in
                  aix*) gl_absname_cpp="$ac_cpp -C" ;;
                  *)    gl_absname_cpp="$ac_cpp" ;;
                esac
-                                                            gl_cv_next_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-                  sed -n '\#/time.h#{
-                    s#.*"\(.*/time.h\)".*#\1#
-                    s#^/[^/]#//&#
-                    p
-                    q
-                  }'`'"'
+
+               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_next_string_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5
-$as_echo "$gl_cv_next_time_h" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5
+$as_echo "$gl_cv_next_string_h" >&6; }
      fi
-     NEXT_TIME_H=$gl_cv_next_time_h
+     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='<'time.h'>'
+       gl_next_as_first_directive='<'string.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_string_h
      fi
-     NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive
-
-
-
-
-
-
-
-
-
-
-
+     NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive
 
 
 
 
 
 
-  { $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 :
+    for gl_func in ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul      strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r      strerror_r strsignal strverscmp; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if eval \${$as_gl_Symbol+:} false; then :
   $as_echo_n "(cached) " >&6
 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>
-            wint_t foo = (wchar_t)'\0';
 int
 main ()
 {
-
+#undef $gl_func
+  (void) $gl_func;
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gt_cv_c_wint_t=yes
+  eval "$as_gl_Symbol=yes"
 else
-  gt_cv_c_wint_t=no
+  eval "$as_gl_Symbol=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_wint_t" >&5
-$as_echo "$gt_cv_c_wint_t" >&6; }
-  if test $gt_cv_c_wint_t = yes; then
+eval ac_res=\$$as_gl_Symbol
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
 
-$as_echo "#define HAVE_WINT_T 1" >>confdefs.h
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
+      done
 
-  fi
 
 
+      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
 
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRNDUP $ac_have_decl
+_ACEOF
 
 
 
 
 
-  :
 
 
 
+      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
 
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRNLEN $ac_have_decl
+_ACEOF
 
-  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 for inttypes.h" >&5
-$as_echo_n "checking for inttypes.h... " >&6; }
-if ${gl_cv_header_inttypes_h+:} false; 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
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  if test "$cross_compiling" = yes; then :
+                                               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <sys/types.h>
-#include <inttypes.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
 
-int
-main ()
-{
-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
+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_header_inttypes_h=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  gl_cv_func_strstr_works_always="guessing no"
 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
+rm -f conftest*
 
 
-  { $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
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/types.h>
-            #include <stdint.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 ()
 {
-uintmax_t i = (uintmax_t) -1; return !i;
+return !!strstr (HAYSTACK, NEEDLE);
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_header_stdint_h=yes
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_strstr_works_always=yes
 else
-  gl_cv_header_stdint_h=no
+  gl_cv_func_strstr_works_always=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_stdint_h" >&5
-$as_echo "$gl_cv_header_stdint_h" >&6; }
-  if test $gl_cv_header_stdint_h = yes; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STDINT_H_WITH_UINTMAX 1
-_ACEOF
 
+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 for intmax_t" >&5
-$as_echo_n "checking for intmax_t... " >&6; }
-if ${gt_cv_c_intmax_t+:} false; then :
+{ $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
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/stat.h>
 
-#include <stddef.h>
-#include <stdlib.h>
-#if HAVE_STDINT_H_WITH_UINTMAX
-#include <stdint.h>
+#if defined S_ISBLK && defined S_IFDIR
+extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
 #endif
-#if HAVE_INTTYPES_H_WITH_UINTMAX
-#include <inttypes.h>
+
+#if defined S_ISBLK && defined S_IFCHR
+extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
+#endif
+
+#if defined S_ISLNK && defined S_IFREG
+extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
+#endif
+
+#if defined S_ISSOCK && defined S_IFREG
+extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
 #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
+  ac_cv_header_stat_broken=no
 else
-  gt_cv_c_intmax_t=no
+  ac_cv_header_stat_broken=yes
 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5
+$as_echo "$ac_cv_header_stat_broken" >&6; }
+if test $ac_cv_header_stat_broken = yes; then
 
-$as_echo "#define HAVE_INTMAX_T 1" >>confdefs.h
+$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h
 
-  else
+fi
 
-    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
 
 
 
-     { $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 MacOS X >= 10.3.
-           darwin[1-6].*)        gl_cv_func_snprintf_retval_c99="guessing no";;
-           darwin*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
-                                 # Guess yes on OpenBSD >= 3.9.
-           openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
-                                 gl_cv_func_snprintf_retval_c99="guessing no";;
-           openbsd*)             gl_cv_func_snprintf_retval_c99="guessing yes";;
-                                 # Guess yes on Solaris >= 2.10.
-           solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
-           solaris*)             gl_cv_func_printf_sizes_c99="guessing no";;
-                                 # Guess yes on AIX >= 4.
-           aix[1-3]*)            gl_cv_func_snprintf_retval_c99="guessing no";;
-           aix*)                 gl_cv_func_snprintf_retval_c99="guessing yes";;
-                                 # Guess yes on NetBSD >= 3.
-           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
-                                 gl_cv_func_snprintf_retval_c99="guessing no";;
-           netbsd*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
-                                 # Guess yes on BeOS.
-           beos*)                gl_cv_func_snprintf_retval_c99="guessing yes";;
-                                 # If we don't know, assume the worst.
-           *)                    gl_cv_func_snprintf_retval_c99="guessing no";;
-         esac
 
+
+
+
+
+
+
+  GNULIB_WAITPID=0;
+
+
+
+
+
+
+
+  GNULIB_MKTIME=0;
+  GNULIB_NANOSLEEP=0;
+  GNULIB_STRPTIME=0;
+  GNULIB_TIMEGM=0;
+  GNULIB_TIME_R=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;
+
+
+
+  :
+
+
+
+
+
+  { $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>
 
-#include <stdio.h>
-#include <string.h>
-static char buf[100];
-int main ()
+int
+main ()
 {
-  strcpy (buf, "ABCDEF");
-  if (snprintf (buf, 3, "%d %d", 4567, 89) != 7)
-    return 1;
-  if (snprintf (buf, 0, "%d %d", 4567, 89) != 7)
-    return 2;
-  if (snprintf (NULL, 0, "%d %d", 4567, 89) != 7)
-    return 3;
+static struct timespec x; x.tv_sec = x.tv_nsec;
+  ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_snprintf_retval_c99=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_sys_struct_timespec_in_time_h=yes
 else
-  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
+  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_func_snprintf_retval_c99" >&5
-$as_echo "$gl_cv_func_snprintf_retval_c99" >&6; }
-
-
-
-
-
+{ $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; }
 
+  TIME_H_DEFINES_STRUCT_TIMESPEC=0
+  SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
+  PTHREAD_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
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/time.h>
 
-  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
+int
+main ()
+{
+static struct timespec x; x.tv_sec = x.tv_nsec;
+  ;
+  return 0;
+}
 _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
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_sys_struct_timespec_in_sys_time_h=yes
 else
-  ac_have_decl=0
+  gl_cv_sys_struct_timespec_in_sys_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_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
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL__SNPRINTF $ac_have_decl
+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_pthread_h=yes
+else
+  gl_cv_sys_struct_timespec_in_pthread_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_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
+      fi
+    fi
+  fi
 
 
-  case "$gl_cv_func_snprintf_retval_c99" in
-    *yes)
-
-$as_echo "#define HAVE_SNPRINTF_RETVAL_C99 1" >>confdefs.h
 
-      ;;
-  esac
 
 
-  XGETTEXT_EXTRA_OPTIONS=
 
 
 
@@ -18687,24 +20615,64 @@ $as_echo "#define HAVE_SNPRINTF_RETVAL_C99 1" >>confdefs.h
 
 
 
-  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;
 
 
 
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_time_h='<'time.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
 
+               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_next_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
 
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5
+$as_echo "$gl_cv_next_time_h" >&6; }
+     fi
+     NEXT_TIME_H=$gl_cv_next_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='<'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
 
 
 
@@ -18717,190 +20685,1240 @@ $as_echo "#define HAVE_SNPRINTF_RETVAL_C99 1" >>confdefs.h
 
 
 
-  { $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 "$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
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <unistd.h>
-           extern struct { int foo; } environ;
+
+/* 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 ()
 {
-environ.foo = 1;
+
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gt_cv_var_environ_declaration=no
+  gt_cv_c_wint_t=yes
 else
-  gt_cv_var_environ_declaration=yes
+  gt_cv_c_wint_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_wint_t" >&5
+$as_echo "$gt_cv_c_wint_t" >&6; }
+  if test $gt_cv_c_wint_t = yes; then
 
-  { $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
+$as_echo "#define HAVE_WINT_T 1" >>confdefs.h
 
   fi
 
 
-  if test $gt_cv_var_environ_declaration != yes; then
-    HAVE_DECL_ENVIRON=0
-  fi
 
 
-  GNULIB_FCNTL=0;
-  GNULIB_OPEN=0;
-  GNULIB_OPENAT=0;
-    HAVE_FCNTL=1;
-  HAVE_OPENAT=1;
-  REPLACE_FCNTL=0;
-  REPLACE_OPEN=0;
-  REPLACE_OPENAT=0;
 
 
 
 
+  :
 
 
 
-  { $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 :
+
+
+  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 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
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <locale.h>
+
+#include <sys/types.h>
+#include <inttypes.h>
+
 int
 main ()
 {
-return LC_MESSAGES
+uintmax_t i = (uintmax_t) -1; return !i;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gt_cv_val_LC_MESSAGES=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_header_inttypes_h=yes
 else
-  gt_cv_val_LC_MESSAGES=no
+  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.$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 "$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
 
-$as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INTTYPES_H_WITH_UINTMAX 1
+_ACEOF
 
   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 "$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
-  gt_save_LIBS="$LIBS"
-     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <CoreFoundation/CFPreferences.h>
+#include <sys/types.h>
+            #include <stdint.h>
 int
 main ()
 {
-CFPreferencesCopyAppValue(NULL, NULL)
+uintmax_t i = (uintmax_t) -1; return !i;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gt_cv_func_CFPreferencesCopyAppValue=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_header_stdint_h=yes
 else
-  gt_cv_func_CFPreferencesCopyAppValue=no
+  gl_cv_header_stdint_h=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.$ac_ext
 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 "$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
 
-$as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STDINT_H_WITH_UINTMAX 1
+_ACEOF
 
   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 "$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
-  gt_save_LIBS="$LIBS"
-     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <CoreFoundation/CFLocale.h>
+
+#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 ()
 {
-CFLocaleCopyCurrent();
+intmax_t x = -1; return !x;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gt_cv_func_CFLocaleCopyCurrent=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  gt_cv_c_intmax_t=yes
 else
-  gt_cv_func_CFLocaleCopyCurrent=no
+  gt_cv_c_intmax_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.$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 "$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
 
-$as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h
+$as_echo "#define HAVE_INTMAX_T 1" >>confdefs.h
 
-  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
+  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
 
-      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"
 
 
-# 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
+  { $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
-  with_gnu_ld=no
+
+      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
+
+                                                         :
+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
+/* 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
+
+  ;
+  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
+
+  ;
+  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
+/* 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
+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 ()
+{
+
+            /* 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
+  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)
+
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+     ;; #(
+   *)
+     gl_cv_cc_double_expbit0="unknown" ;;
+ esac
+
+
+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
+
+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
+
+
+cat >>confdefs.h <<_ACEOF
+#define DBL_EXPBIT0_BIT $bit
+_ACEOF
+
+      ;;
+  esac
+
+
+
+
+
+
+
+
+  :
+
+
+
+
+
+
+
+
+
+  { $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 <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
+  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
+
+
+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; }
+
+
+
+
+
+
+
+  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
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL__SNPRINTF $ac_have_decl
+_ACEOF
+
+
+
+  case "$gl_cv_func_snprintf_retval_c99" in
+    *yes)
+
+$as_echo "#define HAVE_SNPRINTF_RETVAL_C99 1" >>confdefs.h
+
+      ;;
+  esac
+
+
+
+
+
+
+
+  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;
+
+
+
+
+
+
+
+
+
+
+
+
+
+  :
+
+
+
+
+
+  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
+
+  else
+    HAVE_MSVC_INVALID_PARAMETER_HANDLER=0
+  fi
+
+
+
+
+
+
+
+  :
+
+
+
+
+
+
+
+  { $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
+
+  { $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
+
+
+  if test $gt_cv_var_environ_declaration != yes; then
+    HAVE_DECL_ENVIRON=0
+  fi
+
+
+
+  :
+
+
+
+
+
+   { $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.  */
+
+#        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;
+               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; }
+
+
+
+
+
+
+
+  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;
+  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';
+
+
+
+
+  :
+
+
+
+
+
+
+
+
+
+
+
+
+
+  :
+
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_inttypes_h='<'inttypes.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
+
+             if test $ac_cv_header_inttypes_h = yes; then
+
+
+               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
+
+               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
+                 }'
+                                                            gl_cv_next_inttypes_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
+          else
+               gl_cv_next_inttypes_h='<'inttypes.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; }
+     fi
+     NEXT_INTTYPES_H=$gl_cv_next_inttypes_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'>'
+     else
+       # 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
+
+
+
+
+
+
+
+
+    for gl_func in imaxabs imaxdiv strtoimax strtoumax; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if eval \${$as_gl_Symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <inttypes.h>
+
+int
+main ()
+{
+#undef $gl_func
+  (void) $gl_func;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$as_gl_Symbol=yes"
+else
+  eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
+      done
+
+
+
+  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
+/* end confdefs.h.  */
+
+#include <inttypes.h>
+#ifdef PRId32
+char *p = PRId32;
+#endif
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gt_cv_inttypes_pri_broken=no
+else
+  gt_cv_inttypes_pri_broken=yes
+fi
+rm -f core conftest.err conftest.$ac_objext 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
+  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
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <locale.h>
+int
+main ()
+{
+return LC_MESSAGES
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gt_cv_val_LC_MESSAGES=yes
+else
+  gt_cv_val_LC_MESSAGES=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: $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
+
+  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
+/* end confdefs.h.  */
+#include <CoreFoundation/CFLocale.h>
+int
+main ()
+{
+CFLocaleCopyCurrent();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gt_cv_func_CFLocaleCopyCurrent=yes
+else
+  gt_cv_func_CFLocaleCopyCurrent=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_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
+
+  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
+
+
+
+      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"
+
+
+# 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
 
 # Prepare PATH_SEPARATOR.
@@ -19980,18 +22998,20 @@ $as_echo "#define USE_PTH_THREADS_WEAK 1" >>confdefs.h
       fi
     fi
     if test -z "$gl_have_pthread"; then
-      if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then
-        if { case "$host_os" in
-               mingw*) true;;
-               *) false;;
-             esac
-           }; then
-          gl_threads_api=win32
+      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
 
-$as_echo "#define USE_WIN32_THREADS 1" >>confdefs.h
+$as_echo "#define USE_WINDOWS_THREADS 1" >>confdefs.h
 
-        fi
-      fi
+          fi
+          ;;
+      esac
     fi
   fi
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multithread API to use" >&5
@@ -20007,17 +23027,6 @@ $as_echo "$gl_threads_api" >&6; }
 
 
 
-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 :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define mode_t int
-_ACEOF
-
-fi
-
 
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5
@@ -20090,73 +23099,6 @@ _ACEOF
 
 
 
-  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 :
-  gl_cv_func_setenv_works="guessing no"
-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; }
-    if test "$gl_cv_func_setenv_works" != yes; then
-      REPLACE_SETENV=1
-
-
-
-
-
-
-
-
-  gltests_LIBOBJS="$gltests_LIBOBJS setenv.$ac_objext"
-
-    fi
-  fi
 
 
 
@@ -20206,11 +23148,6 @@ _ACEOF
 
 
 
-
-
-
-
-
       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
 
 
   gl_source_base='gnulib/lib'
-  # Code from module alloca:
 LTALLOCA=`echo "$ALLOCA" | sed -e 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'`
 
-  # Code from module alloca-opt:
 
 
   if test $ac_cv_func_alloca_works = no; then
@@ -20299,10 +23234,16 @@ $as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
     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
 
-  # Code from module arg-nonnull:
-  # Code from module argz:
-  :
+
+:
 
 
 
@@ -20346,16 +23287,7 @@ ac_fn_c_check_func "$LINENO" "argz_replace" "ac_cv_func_argz_replace"
 if test "x$ac_cv_func_argz_replace" = xyes; then :
 
 else
-  ARGZ_H=argz.h;
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS argz.$ac_objext"
-
+  ARGZ_H=argz.h
 fi
 
 
@@ -20399,22 +23331,31 @@ $as_echo "#define HAVE_WORKING_ARGZ 1" >>confdefs.h
 
 else
   ARGZ_H=argz.h
+fi
+fi
 
 
+ if test -n "$ARGZ_H"; then
+  GL_GENERATE_ARGZ_H_TRUE=
+  GL_GENERATE_ARGZ_H_FALSE='#'
+else
+  GL_GENERATE_ARGZ_H_TRUE='#'
+  GL_GENERATE_ARGZ_H_FALSE=
+fi
 
 
+if test -n "$ARGZ_H"; then
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS argz.$ac_objext"
 
-fi
-fi
 
 
 
-  # Code from module btowc:
+  gl_LIBOBJS="$gl_LIBOBJS argz.$ac_objext"
+
+fi
 
 
 
@@ -20546,10 +23487,8 @@ $as_echo "$gl_cv_func_btowc_eof" >&6; }
       *) REPLACE_BTOWC=1 ;;
     esac
   fi
-  if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
-
-    :
 
+if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
 
 
 
@@ -20563,42 +23502,47 @@ $as_echo "$gl_cv_func_btowc_eof" >&6; }
 
   :
 
-  fi
-
-
-
-
-  GNULIB_BTOWC=1
-
+fi
 
 
-$as_echo "#define GNULIB_TEST_BTOWC 1" >>confdefs.h
 
 
 
-  # Code from module c++defs:
-  # Code from module canonicalize-lgpl:
+          GNULIB_BTOWC=1
 
 
-  if test $ac_cv_func_canonicalize_file_name = no; then
-    HAVE_CANONICALIZE_FILE_NAME=0
 
 
 
+$as_echo "#define GNULIB_TEST_BTOWC 1" >>confdefs.h
 
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS canonicalize-lgpl.$ac_objext"
 
+  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
-    elif test "$gl_cv_func_realpath_works" != yes; then
-      REPLACE_REALPATH=1
+    else
+      case "$gl_cv_func_realpath_works" in
+       *yes) ;;
+       *)    REPLACE_REALPATH=1 ;;
+      esac
     fi
-  elif test "$gl_cv_func_realpath_works" != yes; then
+  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
 
 
 
@@ -20606,12 +23550,10 @@ $as_echo "#define GNULIB_TEST_BTOWC 1" >>confdefs.h
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS canonicalize-lgpl.$ac_objext"
 
-    REPLACE_REALPATH=1
-    REPLACE_CANONICALIZE_FILE_NAME=1
-  fi
+  gl_LIBOBJS="$gl_LIBOBJS canonicalize-lgpl.$ac_objext"
 
+fi
 
 
 cat >>confdefs.h <<_ACEOF
@@ -20622,7 +23564,11 @@ _ACEOF
 
 
 
-  GNULIB_CANONICALIZE_FILE_NAME=1
+
+
+          GNULIB_CANONICALIZE_FILE_NAME=1
+
+
 
 
 
@@ -20633,7 +23579,11 @@ $as_echo "#define GNULIB_TEST_CANONICALIZE_FILE_NAME 1" >>confdefs.h
 
 
 
-  GNULIB_REALPATH=1
+
+
+          GNULIB_REALPATH=1
+
+
 
 
 
@@ -20641,7 +23591,6 @@ $as_echo "#define GNULIB_TEST_REALPATH 1" >>confdefs.h
 
 
 
-  # Code from module configmake:
 
           if test "x$datarootdir" = x; then
     datarootdir='${datadir}'
@@ -20679,7 +23628,6 @@ $as_echo "#define GNULIB_TEST_REALPATH 1" >>confdefs.h
       pkglibexecdir='${libexecdir}/${PACKAGE}'
 
 
-  # Code from module ctype:
 
 
 
@@ -20709,13 +23657,27 @@ _ACEOF
                  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_next_ctype_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-                  sed -n '\#/ctype.h#{
-                    s#.*"\(.*/ctype.h\)".*#\1#
-                    s#^/[^/]#//&#
-                    p
-                    q
-                  }'`'"'
+                      sed -n "$gl_absolute_header_sed"`'"'
 
 
 fi
@@ -20768,7 +23730,7 @@ fi
 eval ac_res=\$$as_gl_Symbol
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-     if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
 _ACEOF
       done
 
 
-  # Code from module dosname:
-  # Code from module errno:
 
-  # Code from module extensions:
-  # Code from module float:
+
+
+
+
+
+
+
+
+
+
+
+     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
+
+               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_next_fcntl_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
+
+
+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
+
+
+
+
+
+
+
+
+
+
+    for gl_func in fcntl openat; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if eval \${$as_gl_Symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <fcntl.h>
+
+int
+main ()
+{
+#undef $gl_func
+  (void) $gl_func;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$as_gl_Symbol=yes"
+else
+  eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
+      done
+
+
 
 
 
   FLOAT_H=
+  REPLACE_FLOAT_LDBL=0
   case "$host_os" in
-    beos* | openbsd* | mirbsd*)
+    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
+
+    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
+
+
+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
 
 
 
@@ -20816,13 +23996,27 @@ _ACEOF
                  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 '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/
+                   s|^/[^/]|//&|
+                   p
+                   q
+                 }'
                                                             gl_cv_next_float_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-                  sed -n '\#/float.h#{
-                    s#.*"\(.*/float.h\)".*#\1#
-                    s#^/[^/]#//&#
-                    p
-                    q
-                  }'`'"'
+                      sed -n "$gl_absolute_header_sed"`'"'
 
 
 fi
@@ -20843,11 +24037,42 @@ $as_echo "$gl_cv_next_float_h" >&6; }
 
 
 
-      ;;
-  esac
+  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 $REPLACE_FLOAT_LDBL = 1; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS float.$ac_objext"
+
+fi
+if test $REPLACE_ITOLD = 1; then
+
 
 
-  # Code from module fnmatch:
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS itold.$ac_objext"
+
+fi
 
 
 
@@ -20855,7 +24080,7 @@ $as_echo "$gl_cv_next_float_h" >&6; }
 
   FNMATCH_H=
   gl_fnmatch_required_lowercase=`
-    echo $gl_fnmatch_required | tr '[A-Z]' '[a-z]'
+    echo $gl_fnmatch_required | LC_ALL=C tr '[A-Z]' '[a-z]'
   `
   gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}"
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working $gl_fnmatch_required fnmatch" >&5
@@ -20903,6 +24128,8 @@ char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]";
               return 1;
             if (!y ("a*", "abc", 0))
               return 1;
+            if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */
+              return 1;
             if (!n ("d*/*1", "d/s/1", FNM_PATHNAME))
               return 2;
             if (!y ("a\\\\bc", "abc", 0))
@@ -20976,6 +24203,18 @@ $as_echo "$ac_res" >&6; }
             rm -f "$gl_source_base/fnmatch.h"
   else
     FNMATCH_H=fnmatch.h
+  fi
+
+   if test -n "$FNMATCH_H"; then
+  GL_GENERATE_FNMATCH_H_TRUE=
+  GL_GENERATE_FNMATCH_H_FALSE='#'
+else
+  GL_GENERATE_FNMATCH_H_TRUE='#'
+  GL_GENERATE_FNMATCH_H_FALSE=
+fi
+
+
+if test -n "$FNMATCH_H"; then
 
 
 
@@ -20987,12 +24226,13 @@ $as_echo "$ac_res" >&6; }
   gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext"
 
 
+
 cat >>confdefs.h <<_ACEOF
 #define fnmatch ${gl_fnmatch_required_lowercase}_fnmatch
 _ACEOF
 
 
-    ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h>
+  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
@@ -21039,10 +24279,8 @@ _ACEOF
 
 
 
-  fi
-
 
-  # Code from module getdelim:
+fi
 
 
 
@@ -21064,6 +24302,7 @@ _ACEOF
 
 
   if test $ac_cv_func_getdelim = yes; then
+    HAVE_GETDELIM=1
         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working getdelim function" >&5
 $as_echo_n "checking for working getdelim function... " >&6; }
 if ${gl_cv_func_working_getdelim+:} false; then :
@@ -21084,9 +24323,9 @@ else
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   $EGREP "Lucky GNU user" >/dev/null 2>&1; then :
-  gl_cv_func_working_getdelim=yes
+  gl_cv_func_working_getdelim="guessing yes"
 else
-  gl_cv_func_working_getdelim=no
+  gl_cv_func_working_getdelim="guessing no"
 fi
 rm -f conftest*
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_getdelim" >&5
 $as_echo "$gl_cv_func_working_getdelim" >&6; }
+    case "$gl_cv_func_working_getdelim" in
+      *no)
+        REPLACE_GETDELIM=1
+        ;;
+    esac
   else
-    gl_cv_func_working_getdelim=no
+    HAVE_GETDELIM=0
   fi
 
   if test $ac_cv_have_decl_getdelim = no; then
     HAVE_DECL_GETDELIM=0
   fi
 
-  if test $gl_cv_func_working_getdelim = no; then
-    if test $ac_cv_func_getdelim = yes; then
-      REPLACE_GETDELIM=1
-    fi
+if test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1; then
 
 
 
@@ -21183,12 +24424,15 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
-  fi
+fi
+
+
 
 
 
+          GNULIB_GETDELIM=1
+
 
-  GNULIB_GETDELIM=1
 
 
 
@@ -21196,7 +24440,6 @@ $as_echo "#define GNULIB_TEST_GETDELIM 1" >>confdefs.h
 
 
 
-  # Code from module getline:
 
 
 
@@ -21239,122 +24482,9 @@ else
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   $EGREP "Lucky GNU user" >/dev/null 2>&1; then :
-  am_cv_func_working_getline=yes
-else
-  am_cv_func_working_getline=no
-fi
-rm -f conftest*
-
-
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#    include <stdio.h>
-#    include <stdlib.h>
-#    include <string.h>
-    int main ()
-    {
-      FILE *in = fopen ("./conftest.data", "r");
-      if (!in)
-        return 1;
-      {
-        /* Test result for a NULL buffer and a zero size.
-           Based on a test program from Karl Heuer.  */
-        char *line = NULL;
-        size_t siz = 0;
-        int len = getline (&line, &siz, in);
-        if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
-          return 2;
-      }
-      {
-        /* Test result for a NULL buffer and a non-zero size.
-           This crashes on FreeBSD 8.0.  */
-        char *line = NULL;
-        size_t siz = (size_t)(~0) / 4;
-        if (getline (&line, &siz, in) == -1)
-          return 3;
-      }
-      return 0;
-    }
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  am_cv_func_working_getline=yes
-else
-  am_cv_func_working_getline=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: $am_cv_func_working_getline" >&5
-$as_echo "$am_cv_func_working_getline" >&6; }
-  fi
-
-  if test $ac_cv_have_decl_getline = no; then
-    HAVE_DECL_GETLINE=0
-  fi
-
-  if test $am_cv_func_working_getline = no; then
-                REPLACE_GETLINE=1
-
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS getline.$ac_objext"
-
-
-
-
-
-
-
-
-
-  :
-
-
-
-
-
-
-
-  :
-
-
-
-
-
-  if test $ac_cv_func_getdelim = yes; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working getdelim function" >&5
-$as_echo_n "checking for working getdelim function... " >&6; }
-if ${gl_cv_func_working_getdelim+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
-    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) && !defined __UCLIBC__
-  Lucky GNU user
- #endif
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "Lucky GNU user" >/dev/null 2>&1; then :
-  gl_cv_func_working_getdelim=yes
+  am_cv_func_working_getline="guessing yes"
 else
-  gl_cv_func_working_getdelim=no
+  am_cv_func_working_getline="guessing no"
 fi
 rm -f conftest*
 
@@ -21376,7 +24506,7 @@ else
            Based on a test program from Karl Heuer.  */
         char *line = NULL;
         size_t siz = 0;
-        int len = getdelim (&line, &siz, '\n', in);
+        int len = getline (&line, &siz, in);
         if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
           return 2;
       }
@@ -21385,7 +24515,7 @@ else
            This crashes on FreeBSD 8.0.  */
         char *line = NULL;
         size_t siz = (size_t)(~0) / 4;
-        if (getdelim (&line, &siz, '\n', in) == -1)
+        if (getline (&line, &siz, in) == -1)
           return 3;
       }
       return 0;
@@ -21393,30 +24523,30 @@ else
 
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_working_getdelim=yes
+  am_cv_func_working_getline=yes
 else
-  gl_cv_func_working_getdelim=no
+  am_cv_func_working_getline=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_getdelim" >&5
-$as_echo "$gl_cv_func_working_getdelim" >&6; }
-  else
-    gl_cv_func_working_getdelim=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_working_getline" >&5
+$as_echo "$am_cv_func_working_getline" >&6; }
   fi
 
-  if test $ac_cv_have_decl_getdelim = no; then
-    HAVE_DECL_GETDELIM=0
+  if test $ac_cv_have_decl_getline = no; then
+    HAVE_DECL_GETLINE=0
   fi
 
-  if test $gl_cv_func_working_getdelim = no; then
-    if test $ac_cv_func_getdelim = yes; then
-      REPLACE_GETDELIM=1
-    fi
+  case "$am_cv_func_working_getline" in
+    *no)
+                        REPLACE_GETLINE=1
+      ;;
+  esac
 
+if test $REPLACE_GETLINE = 1; then
 
 
 
@@ -21424,77 +24554,92 @@ $as_echo "$gl_cv_func_working_getdelim" >&6; }
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS getdelim.$ac_objext"
 
+  gl_LIBOBJS="$gl_LIBOBJS getline.$ac_objext"
 
-  for ac_func in flockfile funlockfile
-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" "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
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl
-_ACEOF
 
 
-  fi
 
 
-  fi
+          GNULIB_GETLINE=1
 
 
 
 
-  GNULIB_GETLINE=1
 
+$as_echo "#define GNULIB_TEST_GETLINE 1" >>confdefs.h
 
 
-$as_echo "#define GNULIB_TEST_GETLINE 1" >>confdefs.h
 
 
 
-  # Code from module getopt-gnu:
 
 
 
+if test $REPLACE_GETOPT = 1; then
 
 
 
 
-$as_echo "#define GNULIB_TEST_GETOPT_GNU 1" >>confdefs.h
 
 
-  # Code from module getopt-posix:
+
+
+  gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext"
 
 
 
 
 
-  if test -n "$gl_replace_getopt"; then :
 
 
 
+
+  gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext"
+
+
+
+  :
+
+
+
+
+
+
+    GNULIB_GL_UNISTD_H_GETOPT=1
+fi
+
+
+
+$as_echo "#define GNULIB_TEST_GETOPT_GNU 1" >>confdefs.h
+
+
+
+
+
+
+
+    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
 
 
 
-    GNULIB_UNISTD_H_GETOPT=1
+  fi
+
+if test $REPLACE_GETOPT = 1; then
 
 
 
@@ -21524,17 +24669,222 @@ $as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h
 
 
 
+    GNULIB_GL_UNISTD_H_GETOPT=1
+fi
+
+
+
+
+
+
+
+
+  :
+
+
+
+
+
+
+  gl_gettimeofday_timezone=void
+  if test $ac_cv_func_gettimeofday != yes; then
+    HAVE_GETTIMEOFDAY=0
+  else
+
+
 
+ { $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>
+
+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
 
 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
+
+
+$as_echo "#define gmtime rpl_gmtime" >>confdefs.h
+
+
+$as_echo "#define localtime rpl_localtime" >>confdefs.h
+
+
+
+$as_echo "#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h
+
+     ;;
+ esac
+
+    { $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);
+
+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
+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
+
+  fi
+
+cat >>confdefs.h <<_ACEOF
+#define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone
+_ACEOF
+
+
+if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext"
+
+
+  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
+_ACEOF
+
+fi
+done
+
+
+fi
+
+
+
+
+
+          GNULIB_GETTIMEOFDAY=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h
 
-  # Code from module gettext-h:
 
 
-  # Code from module gitlog-to-changelog:
-  # Code from module include_next:
-  # Code from module isblank:
 
 
 
@@ -21548,6 +24898,9 @@ fi
 
   if test $ac_cv_func_isblank = no; then
     HAVE_ISBLANK=0
+  fi
+
+if test $HAVE_ISBLANK = 0; then
 
 
 
 
   gl_LIBOBJS="$gl_LIBOBJS isblank.$ac_objext"
 
-  fi
+fi
 
 
 
 
-  GNULIB_ISBLANK=1
+
+          GNULIB_ISBLANK=1
+
+
 
 
-  # Code from module langinfo:
 
 
 
@@ -21608,13 +24963,27 @@ _ACEOF
                  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 '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_next_langinfo_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-                  sed -n '\#/langinfo.h#{
-                    s#.*"\(.*/langinfo.h\)".*#\1#
-                    s#^/[^/]#//&#
-                    p
-                    q
-                  }'`'"'
+                      sed -n "$gl_absolute_header_sed"`'"'
           else
                gl_cv_next_langinfo_h='<'langinfo.h'>'
              fi
@@ -21816,7 +25185,7 @@ fi
 eval ac_res=\$$as_gl_Symbol
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-     if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
 _ACEOF
@@ -21826,7 +25195,7 @@ fi
       done
 
 
-  # Code from module localcharset:
+
 
 
 
@@ -21841,9 +25210,8 @@ fi
 
 
 
-  LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\""
+LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
 
-  # Code from module locale:
 
 
 
 
 
 
+
+  case "$host_os" in
+    solaris*)
+
+$as_echo "#define _LCONV_C99 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 :
@@ -21860,6 +25237,7 @@ else
 /* end confdefs.h.  */
 #include <locale.h>
             int x = LC_MESSAGES;
+            int y = sizeof (((struct lconv *) 0)->decimal_point);
 int
 main ()
 {
@@ -21925,6 +25303,39 @@ $as_echo "$gl_cv_header_locale_has_locale_t" >&6; }
   fi
 
 
+          { $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
+
 
 
 
@@ -21951,13 +25362,27 @@ _ACEOF
                  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_next_locale_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-                  sed -n '\#/locale.h#{
-                    s#.*"\(.*/locale.h\)".*#\1#
-                    s#^/[^/]#//&#
-                    p
-                    q
-                  }'`'"'
+                      sed -n "$gl_absolute_header_sed"`'"'
 
 
 fi
@@ -21979,14 +25404,6 @@ $as_echo "$gl_cv_next_locale_h" >&6; }
 
 
 
-  if test -n "$STDDEF_H" \
-     || test $gl_cv_header_locale_h_posix2001 = no \
-     || test $gl_cv_header_locale_h_needs_xlocale_h = yes; then
-
-    :
-
-  fi
-
 
     for gl_func in setlocale duplocale; do
     as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
@@ -22022,7 +25439,7 @@ fi
 eval ac_res=\$$as_gl_Symbol
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-     if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
 _ACEOF
       done
 
 
-  # Code from module lstat:
+
+
+
+
+  if test $REPLACE_STRUCT_LCONV = 1; then
+    REPLACE_LOCALECONV=1
+  fi
+
+if test $REPLACE_LOCALECONV = 1; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_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 :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_LCONV_DECIMAL_POINT 1
+_ACEOF
+
+
+fi
+
+
+fi
+
+
+
+
+
+          GNULIB_LOCALECONV=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_LOCALECONV 1" >>confdefs.h
+
+
+
 
 
 
 
   if test $ac_cv_func_lstat = yes; then
 
-    if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then
-            REPLACE_LSTAT=1
-    fi
-    # Prerequisites of lib/lstat.c.
-
+    case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
+      *no)
+        REPLACE_LSTAT=1
+        ;;
+    esac
   else
     HAVE_LSTAT=0
   fi
 
+if test $REPLACE_LSTAT = 1; then
 
 
 
-  GNULIB_LSTAT=1
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext"
+
+
+
+  :
+
+fi
+
+
+
+
+
+          GNULIB_LSTAT=1
+
+
 
 
 
@@ -22064,10 +25548,10 @@ $as_echo "#define GNULIB_TEST_LSTAT 1" >>confdefs.h
 
 
 
-  # Code from module malloc-gnu:
 
 
-    for ac_header in stdlib.h
+
+      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 :
 
 done
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
+  { $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 :
-  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 ;;
+        esac
+
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #if defined STDC_HEADERS || defined HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-char *malloc ();
-#endif
+            # include <stdlib.h>
+            #else
+            char *malloc ();
+            #endif
 
 int
 main ()
@@ -22102,6 +25594,7 @@ return ! malloc (0);
   ;
   return 0;
 }
+
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
   ac_cv_func_malloc_0_nonnull=yes
@@ -22112,41 +25605,41 @@ 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_malloc_0_nonnull" >&5
 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
-if test $ac_cv_func_malloc_0_nonnull = yes; then :
+  if test $ac_cv_func_malloc_0_nonnull = yes; then :
 
 $as_echo "#define HAVE_MALLOC_GNU 1" >>confdefs.h
 
 else
   $as_echo "#define HAVE_MALLOC_GNU 0" >>confdefs.h
 
+     REPLACE_MALLOC=1
 
+fi
 
 
+if test $REPLACE_MALLOC = 1; then
 
 
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext"
 
-  REPLACE_MALLOC=1
 
+  gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext"
 
 fi
 
 
-
-
 cat >>confdefs.h <<_ACEOF
 #define GNULIB_MALLOC_GNU 1
 _ACEOF
 
 
-  # Code from module malloc-posix:
 
 
 
@@ -22155,7 +25648,10 @@ _ACEOF
 $as_echo "#define HAVE_MALLOC_POSIX 1" >>confdefs.h
 
   else
+    REPLACE_MALLOC=1
+  fi
 
+if test $REPLACE_MALLOC = 1; then
 
 
 
@@ -22166,14 +25662,15 @@ $as_echo "#define HAVE_MALLOC_POSIX 1" >>confdefs.h
 
   gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext"
 
-  REPLACE_MALLOC=1
+fi
+
+
 
-  fi
 
 
+          GNULIB_MALLOC_POSIX=1
 
 
-  GNULIB_MALLOC_POSIX=1
 
 
 
@@ -22181,12 +25678,10 @@ $as_echo "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h
 
 
 
-  # Code from module malloca:
 
 
 
 
-  # Code from module mbrtowc:
 
 
 
@@ -22352,11 +25847,6 @@ $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
   else
     REPLACE_MBSTATE_T=1
   fi
-  if test $REPLACE_MBSTATE_T = 1; then
-
-    :
-
-  fi
 
 
 
@@ -22368,6 +25858,30 @@ $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
 
   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>
+
+"
+if test "x$ac_cv_have_decl_mbrtowc" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_MBRTOWC $ac_have_decl
+_ACEOF
+
+    if test $ac_cv_have_decl_mbrtowc = yes; then
+                        REPLACE_MBRTOWC=1
+    fi
   else
     if test $REPLACE_MBSTATE_T = 1; then
       REPLACE_MBRTOWC=1
@@ -22748,10 +26262,8 @@ $as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h
       esac
     fi
   fi
-  if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
-
-    :
 
+if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
 
 
 
@@ -22765,12 +26277,15 @@ $as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h
 
   :
 
-  fi
+fi
+
+
 
 
 
+          GNULIB_MBRTOWC=1
+
 
-  GNULIB_MBRTOWC=1
 
 
 
@@ -22778,7 +26293,6 @@ $as_echo "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h
 
 
 
-  # Code from module mbsinit:
 
 
 
@@ -22945,11 +26459,6 @@ $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
   else
     REPLACE_MBSTATE_T=1
   fi
-  if test $REPLACE_MBSTATE_T = 1; then
-
-    :
-
-  fi
 
 
 
@@ -22961,6 +26470,30 @@ $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
 
   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
@@ -22970,10 +26503,8 @@ $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
       esac
     fi
   fi
-  if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
-
-    :
 
+if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
 
 
 
@@ -22987,12 +26518,15 @@ $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
 
   :
 
-  fi
+fi
 
 
 
 
-  GNULIB_MBSINIT=1
+
+          GNULIB_MBSINIT=1
+
+
 
 
 
@@ -23000,7 +26534,6 @@ $as_echo "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h
 
 
 
-  # Code from module mbsrtowcs:
 
 
 
@@ -23166,11 +26699,6 @@ $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
   else
     REPLACE_MBSTATE_T=1
   fi
-  if test $REPLACE_MBSTATE_T = 1; then
-
-    :
-
-  fi
 
 
 
@@ -23182,6 +26710,30 @@ $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
 
   if test $ac_cv_func_mbsrtowcs = no; then
     HAVE_MBSRTOWCS=0
+    ac_fn_c_check_decl "$LINENO" "mbsrtowcs" "ac_cv_have_decl_mbsrtowcs" "
+/* 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_mbsrtowcs" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_MBSRTOWCS $ac_have_decl
+_ACEOF
+
+    if test $ac_cv_have_decl_mbsrtowcs = yes; then
+                        REPLACE_MBSRTOWCS=1
+    fi
   else
     if test $REPLACE_MBSTATE_T = 1; then
       REPLACE_MBSRTOWCS=1
@@ -23305,10 +26857,8 @@ $as_echo "$gl_cv_func_mbsrtowcs_works" >&6; }
       esac
     fi
   fi
-  if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
-
-    :
 
+if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
 
 
 
@@ -23332,12 +26882,15 @@ $as_echo "$gl_cv_func_mbsrtowcs_works" >&6; }
 
   :
 
-  fi
+fi
+
+
 
 
 
+          GNULIB_MBSRTOWCS=1
+
 
-  GNULIB_MBSRTOWCS=1
 
 
 
@@ -23345,14 +26898,14 @@ $as_echo "#define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h
 
 
 
-  # Code from module mbtowc:
 
 
 
   if false; then
     REPLACE_MBTOWC=1
   fi
-  if test $REPLACE_MBTOWC = 1; then
+
+if test $REPLACE_MBTOWC = 1; then
 
 
 
@@ -23366,12 +26919,15 @@ $as_echo "#define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h
 
   :
 
-  fi
+fi
+
+
+
 
 
+          GNULIB_MBTOWC=1
 
 
-  GNULIB_MBTOWC=1
 
 
 
@@ -23379,28 +26935,48 @@ $as_echo "#define GNULIB_TEST_MBTOWC 1" >>confdefs.h
 
 
 
-  # Code from module memchr:
 
+if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
 
 
 
-  GNULIB_MEMCHR=1
 
 
 
-$as_echo "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h
 
 
+  gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext"
 
-  # Code from module mempcpy:
 
+  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
+
+fi
+
+done
 
 
+fi
 
 
 
 
 
+          GNULIB_MEMCHR=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h
+
+
+
 
 
 
@@ -23415,25 +26991,36 @@ if test "x$ac_cv_func_mempcpy" = xyes; then :
 #define HAVE_MEMPCPY 1
 _ACEOF
 
-else
-
-    gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
-
 fi
 done
 
-
   if test $ac_cv_func_mempcpy = no; then
     HAVE_MEMPCPY=0
+  fi
+
+if test $HAVE_MEMPCPY = 0; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS mempcpy.$ac_objext"
+
 
   :
 
-  fi
+fi
 
 
 
 
-  GNULIB_MEMPCPY=1
+
+          GNULIB_MEMPCPY=1
+
+
 
 
 
@@ -23441,9 +27028,124 @@ $as_echo "#define GNULIB_TEST_MEMPCPY 1" >>confdefs.h
 
 
 
-  # Code from module multiarch:
 
-  # Code from module nl_langinfo:
+
+
+
+  :
+
+
+
+
+
+  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
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+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;
+  ;
+  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
+fi
+
+        rm -rf conftest.mkstemp
+
+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
+  else
+    HAVE_MKSTEMP=0
+  fi
+
+if test $HAVE_MKSTEMP = 0 || test $REPLACE_MKSTEMP = 1; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS mkstemp.$ac_objext"
+
+
+
+fi
+
+
+
+
+
+          GNULIB_MKSTEMP=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_MKSTEMP 1" >>confdefs.h
+
+
+
+
 
 
 
@@ -23514,6 +27216,12 @@ _ACEOF
 
 $as_echo "#define REPLACE_NL_LANGINFO 1" >>confdefs.h
 
+    fi
+  else
+    HAVE_NL_LANGINFO=0
+  fi
+
+if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then
 
 
 
@@ -23524,74 +27232,89 @@ $as_echo "#define REPLACE_NL_LANGINFO 1" >>confdefs.h
 
   gl_LIBOBJS="$gl_LIBOBJS nl_langinfo.$ac_objext"
 
-    fi
-  else
-    HAVE_NL_LANGINFO=0
+fi
 
 
 
 
 
+          GNULIB_NL_LANGINFO=1
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS nl_langinfo.$ac_objext"
 
-  fi
 
+$as_echo "#define GNULIB_TEST_NL_LANGINFO 1" >>confdefs.h
 
 
 
-  GNULIB_NL_LANGINFO=1
 
 
+  :
 
-$as_echo "#define GNULIB_TEST_NL_LANGINFO 1" >>confdefs.h
 
 
 
-  # Code from module pathmax:
 
 
-  :
 
 
 
 
+  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
 
+  if test $ac_cv_func_rawmemchr = no; then
+    HAVE_RAWMEMCHR=0
+  fi
 
-  :
+if test $HAVE_RAWMEMCHR = 0; then
 
 
 
 
 
 
-  # Code from module readlink:
 
 
+  gl_LIBOBJS="$gl_LIBOBJS rawmemchr.$ac_objext"
 
   :
+fi
 
 
 
 
 
-  if test $ac_cv_func_readlink = no; then
-    HAVE_READLINK=0
+          GNULIB_RAWMEMCHR=1
 
 
 
 
 
+$as_echo "#define GNULIB_TEST_RAWMEMCHR 1" >>confdefs.h
+
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS readlink.$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; }
@@ -23629,7 +27352,13 @@ else
        ln -s conftest.no-such conftest.link
        ln -s conftest.link conftest.lnk2
        if test "$cross_compiling" = yes; then :
-  gl_cv_func_readlink_works="guessing 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" ;;
+          esac
+
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_works" >&5
 $as_echo "$gl_cv_func_readlink_works" >&6; }
-    if test "$gl_cv_func_readlink_works" != yes; then
+    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
-
-
-
+        REPLACE_READLINK=1
+        ;;
+    esac
+  fi
 
+if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext"
 
-    elif test "$gl_cv_decl_readlink_works" != yes; then
-      REPLACE_READLINK=1
 
 
 
+  gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext"
 
 
+  :
 
+fi
 
 
-  gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext"
 
-    fi
-  fi
 
 
+          GNULIB_READLINK=1
 
 
-  GNULIB_READLINK=1
 
 
 
@@ -23698,7 +27431,6 @@ $as_echo "#define GNULIB_TEST_READLINK 1" >>confdefs.h
 
 
 
-  # Code from module realloc-posix:
 
 
 
@@ -23707,7 +27439,10 @@ $as_echo "#define GNULIB_TEST_READLINK 1" >>confdefs.h
 $as_echo "#define HAVE_REALLOC_POSIX 1" >>confdefs.h
 
   else
+    REPLACE_REALLOC=1
+  fi
 
+if test $REPLACE_REALLOC = 1; then
 
 
 
@@ -23718,14 +27453,15 @@ $as_echo "#define HAVE_REALLOC_POSIX 1" >>confdefs.h
 
   gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext"
 
-  REPLACE_REALLOC=1
+fi
+
 
-  fi
 
 
 
+          GNULIB_REALLOC_POSIX=1
+
 
-  GNULIB_REALLOC_POSIX=1
 
 
 
@@ -23733,7 +27469,6 @@ $as_echo "#define GNULIB_TEST_REALLOC_POSIX 1" >>confdefs.h
 
 
 
-  # Code from module regex:
 
 
 # Check whether --with-included-regex was given.
@@ -23904,603 +27639,75 @@ else
 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
-
-$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
-
-
-$as_echo "#define re_search_2 rpl_re_search_2" >>confdefs.h
-
-
-$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
-
-
-$as_echo "#define re_exec rpl_re_exec" >>confdefs.h
-
-
-$as_echo "#define regcomp rpl_regcomp" >>confdefs.h
-
-
-$as_echo "#define regexec rpl_regexec" >>confdefs.h
-
-
-$as_echo "#define regerror rpl_regerror" >>confdefs.h
-
-
-$as_echo "#define regfree rpl_regfree" >>confdefs.h
-
-
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS regex.$ac_objext"
-
-
-
-
-
-
-  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
-
-  # Code from module safe-alloc:
-
-
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS safe-alloc.$ac_objext"
-
-
-  # Code from module selinux-h:
-
-
-  if test "$with_selinux" != no; then
-    for ac_header in selinux/selinux.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default"
-if test "x$ac_cv_header_selinux_selinux_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_SELINUX_SELINUX_H 1
-_ACEOF
-
-fi
-
-done
-
-
-    if test "$ac_cv_header_selinux_selinux_h" = yes; then
-      # We do have <selinux/selinux.h>, so do compile getfilecon.c
-      # and arrange to use its wrappers.
-
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS getfilecon.$ac_objext"
-
-
-
-
-
-
-
-  :
-
-
-
-
-
-
-
-
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_selinux_selinux_h='<'selinux/selinux.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <selinux/selinux.h>" >&5
-$as_echo_n "checking absolute name of <selinux/selinux.h>... " >&6; }
-if ${gl_cv_next_selinux_selinux_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-             if test $ac_cv_header_selinux_selinux_h = yes; then
-
-
-               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <selinux/selinux.h>
-
-_ACEOF
-                                                                                                                        case "$host_os" in
-                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
-                 *)    gl_absname_cpp="$ac_cpp" ;;
-               esac
-                                                            gl_cv_next_selinux_selinux_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-                  sed -n '\#/selinux/selinux.h#{
-                    s#.*"\(.*/selinux/selinux.h\)".*#\1#
-                    s#^/[^/]#//&#
-                    p
-                    q
-                  }'`'"'
-          else
-               gl_cv_next_selinux_selinux_h='<'selinux/selinux.h'>'
-             fi
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_selinux_selinux_h" >&5
-$as_echo "$gl_cv_next_selinux_selinux_h" >&6; }
-     fi
-     NEXT_SELINUX_SELINUX_H=$gl_cv_next_selinux_selinux_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='<'selinux/selinux.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_selinux_selinux_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H=$gl_next_as_first_directive
-
-
-
-
-
-$as_echo "#define getfilecon rpl_getfilecon" >>confdefs.h
-
-
-$as_echo "#define lgetfilecon rpl_lgetfilecon" >>confdefs.h
-
-
-$as_echo "#define fgetfilecon rpl_fgetfilecon" >>confdefs.h
-
-    fi
-
-    case "$ac_cv_search_setfilecon:$ac_cv_header_selinux_selinux_h" in
-      no:*) # already warned
-        ;;
-      *:no)
-        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libselinux was found but selinux/selinux.h is missing." >&5
-$as_echo "$as_me: WARNING: libselinux was found but selinux/selinux.h is missing." >&2;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: augeas will be compiled without SELinux support." >&5
-$as_echo "$as_me: WARNING: augeas will be compiled without SELinux support." >&2;}
-    esac
-  else
-    # Do as if <selinux/selinux.h> does not exist, even if
-    # AC_CHECK_HEADERS_ONCE has already determined that it exists.
-    $as_echo "#define HAVE_SELINUX_SELINUX_H 0" >>confdefs.h
-
-  fi
-
-
-
-  if test "$with_selinux" != no; then
-    for ac_header in selinux/context.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "selinux/context.h" "ac_cv_header_selinux_context_h" "$ac_includes_default"
-if test "x$ac_cv_header_selinux_context_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_SELINUX_CONTEXT_H 1
-_ACEOF
- SELINUX_CONTEXT_H=
-else
-  SELINUX_CONTEXT_H=selinux/context.h
-fi
-
-done
-
-  else
-    SELINUX_CONTEXT_H=selinux/context.h
-  fi
-
-
-
-  # Code from module size_max:
-
-  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
-
-    { $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
-
-    gl_cv_size_max=
-    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 -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=
-fi
-
-      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
-
-      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 ()
-{
-
-  ;
-  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.$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
-{ $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
-
-
-  # Code from module ssize_t:
-
-  { $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
-
-  # Code from module stat:
-
-
-
-  :
-
-
-
-
-
-    { $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
-/* end confdefs.h.  */
-#include <sys/stat.h>
-
-int
-main ()
-{
-struct stat st; return stat (".", &st) != stat ("./", &st);
-  ;
-  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
-fi
-
-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 :
-  gl_cv_func_stat_file_slash="guessing no"
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/stat.h>
-
-int
-main ()
-{
-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
-  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
-{ $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
+fi
 
-$as_echo "#define REPLACE_FUNC_STAT_DIR 1" >>confdefs.h
-;;
+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
-  case $gl_cv_func_stat_file_slash in
-    *no) REPLACE_STAT=1
 
-$as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h
-;;
-  esac
-  if test $REPLACE_STAT = 1; then
+  if test $ac_use_included_regex = yes; then
 
+$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
 
-  gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext"
 
+$as_echo "#define re_compile_pattern rpl_re_compile_pattern" >>confdefs.h
 
-  fi
 
+$as_echo "#define re_compile_fastmap rpl_re_compile_fastmap" >>confdefs.h
 
 
+$as_echo "#define re_search rpl_re_search" >>confdefs.h
 
-  GNULIB_STAT=1
 
+$as_echo "#define re_search_2 rpl_re_search_2" >>confdefs.h
 
 
-$as_echo "#define GNULIB_TEST_STAT 1" >>confdefs.h
+$as_echo "#define re_match rpl_re_match" >>confdefs.h
 
 
+$as_echo "#define re_match_2 rpl_re_match_2" >>confdefs.h
 
-  # Code from module stdbool:
 
+$as_echo "#define re_set_registers rpl_re_set_registers" >>confdefs.h
 
 
-  # Define two additional variables used in the Makefile substitution.
+$as_echo "#define re_comp rpl_re_comp" >>confdefs.h
 
-  if test "$ac_cv_header_stdbool_h" = yes; then
-    STDBOOL_H=''
-  else
-    STDBOOL_H='stdbool.h'
-  fi
 
+$as_echo "#define re_exec rpl_re_exec" >>confdefs.h
 
-  if test "$ac_cv_type__Bool" = yes; then
-    HAVE__BOOL=1
-  else
-    HAVE__BOOL=0
-  fi
 
+$as_echo "#define regcomp rpl_regcomp" >>confdefs.h
 
-  # Code from module stddef:
 
+$as_echo "#define regexec rpl_regexec" >>confdefs.h
 
 
-  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];
+$as_echo "#define regerror rpl_regerror" >>confdefs.h
 
-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
+$as_echo "#define regfree rpl_regfree" >>confdefs.h
+
   fi
-  if test -n "$STDDEF_H"; then
 
+if test $ac_use_included_regex = yes; then
 
 
 
@@ -24508,99 +27715,75 @@ $as_echo "$gl_cv_decl_null_works" >&6; }
 
 
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_stddef_h='<'stddef.h'>'
-     else
-       { $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
 
-               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stddef.h>
+  gl_LIBOBJS="$gl_LIBOBJS regex.$ac_objext"
+
 
-_ACEOF
-                                                                                                                        case "$host_os" in
-                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
-                 *)    gl_absname_cpp="$ac_cpp" ;;
-               esac
-                                                            gl_cv_next_stddef_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-                  sed -n '\#/stddef.h#{
-                    s#.*"\(.*/stddef.h\)".*#\1#
-                    s#^/[^/]#//&#
-                    p
-                    q
-                  }'`'"'
 
 
+
+
+  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
-{ $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
+done
 
 
+  :
 
 
-  fi
 
-  # Code from module stdint:
 
 
 
-  if test $ac_cv_type_long_long_int = yes; then
-    HAVE_LONG_LONG_INT=1
-  else
-    HAVE_LONG_LONG_INT=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
 
 
 
-  :
+  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
 
+  :
 
-  if test $ac_cv_header_wchar_h = yes; then
-    HAVE_WCHAR_H=1
-  else
-    HAVE_WCHAR_H=0
-  fi
 
 
-      if test $ac_cv_header_inttypes_h = yes; then
-    HAVE_INTTYPES_H=1
-  else
-    HAVE_INTTYPES_H=0
-  fi
+  if test "$with_selinux" != no; then
+    for ac_header in selinux/selinux.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default"
+if test "x$ac_cv_header_selinux_selinux_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SELINUX_SELINUX_H 1
+_ACEOF
 
+fi
 
-      if test $ac_cv_header_sys_types_h = yes; then
-    HAVE_SYS_TYPES_H=1
-  else
-    HAVE_SYS_TYPES_H=0
-  fi
+done
 
 
+    if test "$ac_cv_header_selinux_selinux_h" = yes; then
+      # We do have <selinux/selinux.h>, so do compile getfilecon.c
+      # and arrange to use its wrappers.
 
 
 
@@ -24617,553 +27800,454 @@ $as_echo "$gl_cv_next_stddef_h" >&6; }
 
 
      if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_stdint_h='<'stdint.h'>'
+       gl_cv_next_selinux_selinux_h='<'selinux/selinux.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 "$as_me:${as_lineno-$LINENO}: checking absolute name of <selinux/selinux.h>" >&5
+$as_echo_n "checking absolute name of <selinux/selinux.h>... " >&6; }
+if ${gl_cv_next_selinux_selinux_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-             if test $ac_cv_header_stdint_h = yes; then
+             if test $ac_cv_header_selinux_selinux_h = yes; then
 
 
                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stdint.h>
+#include <selinux/selinux.h>
 
 _ACEOF
                                                                                                                         case "$host_os" in
                  aix*) gl_absname_cpp="$ac_cpp -C" ;;
                  *)    gl_absname_cpp="$ac_cpp" ;;
                esac
-                                                            gl_cv_next_stdint_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-                  sed -n '\#/stdint.h#{
-                    s#.*"\(.*/stdint.h\)".*#\1#
-                    s#^/[^/]#//&#
-                    p
-                    q
-                  }'`'"'
+
+               case "$host_os" in
+                 mingw*)
+                                                                                                                                     gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+                                             gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+               gl_header_literal_regex=`echo 'selinux/selinux.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_next_selinux_selinux_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
           else
-               gl_cv_next_stdint_h='<'stdint.h'>'
+               gl_cv_next_selinux_selinux_h='<'selinux/selinux.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; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_selinux_selinux_h" >&5
+$as_echo "$gl_cv_next_selinux_selinux_h" >&6; }
      fi
-     NEXT_STDINT_H=$gl_cv_next_stdint_h
+     NEXT_SELINUX_SELINUX_H=$gl_cv_next_selinux_selinux_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='<'selinux/selinux.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_selinux_selinux_h
      fi
-     NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive
+     NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H=$gl_next_as_first_directive
 
 
 
 
-  if test $ac_cv_header_stdint_h = yes; then
-    HAVE_STDINT_H=1
+
+$as_echo "#define getfilecon rpl_getfilecon" >>confdefs.h
+
+
+$as_echo "#define lgetfilecon rpl_lgetfilecon" >>confdefs.h
+
+
+$as_echo "#define fgetfilecon rpl_fgetfilecon" >>confdefs.h
+
+    fi
+
+    case "$ac_cv_search_setfilecon:$ac_cv_header_selinux_selinux_h" in
+      no:*) # already warned
+        ;;
+      *:no)
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libselinux was found but selinux/selinux.h is missing." >&5
+$as_echo "$as_me: WARNING: libselinux was found but selinux/selinux.h is missing." >&2;}
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: augeas will be compiled without SELinux support." >&5
+$as_echo "$as_me: WARNING: augeas will be compiled without SELinux support." >&2;}
+    esac
   else
-    HAVE_STDINT_H=0
+    # Do as if <selinux/selinux.h> does not exist, even if
+    # AC_CHECK_HEADERS_ONCE has already determined that it exists.
+    $as_echo "#define HAVE_SELINUX_SELINUX_H 0" >>confdefs.h
+
   fi
 
 
-    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 :
+
+  if test "$with_selinux" != no; then
+    for ac_header in selinux/context.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "selinux/context.h" "ac_cv_header_selinux_context_h" "$ac_includes_default"
+if test "x$ac_cv_header_selinux_context_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SELINUX_CONTEXT_H 1
+_ACEOF
+ SELINUX_CONTEXT_H=
+else
+  SELINUX_CONTEXT_H=selinux/context.h
+fi
+
+done
+
+  else
+    SELINUX_CONTEXT_H=selinux/context.h
+  fi
+
+   if test -n "$SELINUX_CONTEXT_H"; then
+  GL_GENERATE_SELINUX_CONTEXT_H_TRUE=
+  GL_GENERATE_SELINUX_CONTEXT_H_FALSE='#'
+else
+  GL_GENERATE_SELINUX_CONTEXT_H_TRUE='#'
+  GL_GENERATE_SELINUX_CONTEXT_H_FALSE=
+fi
+
+
+
+if test "$with_selinux" != no && test "$ac_cv_header_selinux_selinux_h" = yes; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS getfilecon.$ac_objext"
+
+fi
+
+  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
+
+    { $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
-  gl_cv_header_working_stdint_h=no
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
+    gl_cv_size_max=
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
-#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
-#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#include <limits.h>
+#if HAVE_STDINT_H
 #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
+#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 -f conftest*
 
-  /* 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 -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=
+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;
+      if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) <= sizeof (unsigned int)" "fits_in_uint"        "#include <stddef.h>"; then :
 
-#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;
+else
+  fits_in_uint=
+fi
 
-  /* 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 -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;
 
-  /* 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 ()
+{
+
+  ;
+  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.$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
+{ $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
+
+
+
+  { $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 :
-                                                    if test "$cross_compiling" = yes; then :
-                 gl_cv_header_working_stdint_h=yes
-
+  gt_cv_ssize_t=yes
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  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
 
-#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
-#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
-#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
-#include <stdint.h>
+  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
 
 
-#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
-  };
+  :
+
+
+
+
+
+    { $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
+/* end confdefs.h.  */
+#include <sys/stat.h>
 
 int
 main ()
 {
-
-  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;
-
+struct stat st; return stat (".", &st) != stat ("./", &st);
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_header_working_stdint_h=yes
+  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
 fi
 
-
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $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 :
+  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
 
-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; }
-  fi
-  if test "$gl_cv_header_working_stdint_h" = yes; then
-    STDINT_H=
-  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
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/stat.h>
+
+int
+main ()
+{
+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
+  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
+{ $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
 
-done
+$as_echo "#define REPLACE_FUNC_STAT_DIR 1" >>confdefs.h
+;;
+  esac
+  case $gl_cv_func_stat_file_slash in
+    *no) REPLACE_STAT=1
 
-    if test $ac_cv_header_sys_inttypes_h = yes; then
-      HAVE_SYS_INTTYPES_H=1
-    else
-      HAVE_SYS_INTTYPES_H=0
-    fi
+$as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h
+;;
+  esac
 
-    if test $ac_cv_header_sys_bitypes_h = yes; then
-      HAVE_SYS_BITYPES_H=1
-    else
-      HAVE_SYS_BITYPES_H=0
-    fi
+if test $REPLACE_STAT = 1; then
 
 
 
 
-  if test $APPLE_UNIVERSAL_BUILD = 0; then
 
 
-  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_LIBOBJS="$gl_LIBOBJS stat.$ac_objext"
 
-       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
 
 
-  fi
 
 
-  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
+          GNULIB_STAT=1
 
-#include <limits.h>"; then :
 
-else
-  result=unknown
-fi
 
-       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
+$as_echo "#define GNULIB_TEST_STAT 1" >>confdefs.h
 
 
 
 
-  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
-/* 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 ()
-{
+  # Define two additional variables used in the Makefile substitution.
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  result=yes
+  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
-  result=no
+  GL_GENERATE_STDBOOL_H_TRUE='#'
+  GL_GENERATE_STDBOOL_H_FALSE=
 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
 
-      eval HAVE_SIGNED_${GLTYPE}=1
-    else
-      eval HAVE_SIGNED_${GLTYPE}=0
-    fi
-  done
+  if test "$ac_cv_type__Bool" = yes; then
+    HAVE__BOOL=1
+  else
+    HAVE__BOOL=0
+  fi
 
 
-  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 :
+
+  STDDEF_H=
+  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
-  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.  */
+#include <stddef.h>
+      int test[2 * (sizeof NULL == sizeof (void *)) -1];
 
-  /* 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 ()
 {
@@ -25173,105 +28257,98 @@ main ()
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  eval gl_cv_type_${gltype}_suffix=\$glsuf
+  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
-         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
+{ $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
 
-  done
+   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
 
-  fi
 
 
-  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 :
+
+
+
+
+
+     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
-  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.  */
+#include <stddef.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
+_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_next_stddef_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
 
-              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
+{ $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
 
-  done
 
 
 
-    STDINT_H=stdint.h
   fi
 
 
-  # Code from module stdio:
 
 
 
@@ -25301,13 +28378,27 @@ _ACEOF
                  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_next_stdio_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-                  sed -n '\#/stdio.h#{
-                    s#.*"\(.*/stdio.h\)".*#\1#
-                    s#^/[^/]#//&#
-                    p
-                    q
-                  }'`'"'
+                      sed -n "$gl_absolute_header_sed"`'"'
 
 
 fi
@@ -25328,6 +28419,30 @@ $as_echo "$gl_cv_next_stdio_h" >&6; }
 
 
 
+
+      GNULIB_FSCANF=1
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_FSCANF 1
+_ACEOF
+
+
+  GNULIB_SCANF=1
+
+
+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
@@ -25341,7 +28456,8 @@ $as_echo "$gl_cv_next_stdio_h" >&6; }
 
 
 
-    for gl_func in dprintf fpurge fseeko ftello getdelim getline popen renameat     snprintf tmpfile vdprintf vsnprintf; do
+
+    for gl_func in dprintf fpurge fseeko ftello getdelim getline gets pclose popen     renameat snprintf tmpfile vdprintf vsnprintf; do
     as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
 $as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
@@ -25371,7 +28487,7 @@ fi
 eval ac_res=\$$as_gl_Symbol
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-     if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
 _ACEOF
@@ -25381,7 +28497,6 @@ fi
       done
 
 
-  # Code from module stdlib:
 
 
 
@@ -25410,13 +28525,27 @@ _ACEOF
                  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_next_stdlib_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-                  sed -n '\#/stdlib.h#{
-                    s#.*"\(.*/stdlib.h\)".*#\1#
-                    s#^/[^/]#//&#
-                    p
-                    q
-                  }'`'"'
+                      sed -n "$gl_absolute_header_sed"`'"'
 
 
 fi
@@ -25439,7 +28568,7 @@ $as_echo "$gl_cv_next_stdlib_h" >&6; }
 
 
 
-    for gl_func in _Exit atoll canonicalize_file_name getloadavg getsubopt grantpt mkdtemp     mkostemp mkostemps mkstemp mkstemps ptsname random_r initstat_r srandom_r     setstate_r realpath rpmatch setenv strtod strtoll strtoull unlockpt     unsetenv; do
+    for gl_func in _Exit atoll canonicalize_file_name getloadavg getsubopt grantpt     initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps     posix_openpt ptsname ptsname_r random random_r realpath rpmatch     setenv setstate setstate_r srandom srandom_r     strtod strtoll strtoull unlockpt unsetenv; do
     as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
 $as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
@@ -25475,7 +28604,7 @@ fi
 eval ac_res=\$$as_gl_Symbol
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-     if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
 _ACEOF
       done
 
 
-  # Code from module stpcpy:
-
-
-
-
-
-
-
-
 
 
 
@@ -25508,25 +28628,36 @@ if test "x$ac_cv_func_stpcpy" = xyes; then :
 #define HAVE_STPCPY 1
 _ACEOF
 
-else
-
-    gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
-
 fi
 done
 
-
   if test $ac_cv_func_stpcpy = no; then
     HAVE_STPCPY=0
+  fi
+
+if test $HAVE_STPCPY = 0; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS stpcpy.$ac_objext"
+
 
   :
 
-  fi
+fi
+
 
 
 
 
-  GNULIB_STPCPY=1
+          GNULIB_STPCPY=1
+
+
 
 
 
@@ -25534,7 +28665,6 @@ $as_echo "#define GNULIB_TEST_STPCPY 1" >>confdefs.h
 
 
 
-  # Code from module stpncpy:
 
 
 
@@ -25576,9 +28706,9 @@ else
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   $EGREP "Thanks for using GNU" >/dev/null 2>&1; then :
-  gl_cv_func_stpncpy=yes
+  gl_cv_func_stpncpy="guessing yes"
 else
-  gl_cv_func_stpncpy=no
+  gl_cv_func_stpncpy="guessing no"
 fi
 rm -f conftest*
 
@@ -25591,7 +28721,11 @@ else
 #include <string.h> /* for strcpy */
 /* The stpncpy prototype is missing in <string.h> on AIX 4.  */
 #if !HAVE_DECL_STPNCPY
-extern char *stpncpy (char *dest, const char *src, size_t n);
+extern
+# ifdef __cplusplus
+"C"
+# endif
+char *stpncpy (char *dest, const char *src, size_t n);
 #endif
 int main ()
 {
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stpncpy" >&5
 $as_echo "$gl_cv_func_stpncpy" >&6; }
-    if test $gl_cv_func_stpncpy = yes; then
+    case "$gl_cv_func_stpncpy" in
+      *yes)
 
 $as_echo "#define HAVE_STPNCPY 1" >>confdefs.h
 
-    else
-      REPLACE_STPNCPY=1
+        ;;
+      *)
+        REPLACE_STPNCPY=1
+        ;;
+    esac
+  else
+    HAVE_STPNCPY=0
+  fi
+
+if test $HAVE_STPNCPY = 0 || test $REPLACE_STPNCPY = 1; then
 
 
 
@@ -25652,41 +28795,134 @@ $as_echo "#define HAVE_STPNCPY 1" >>confdefs.h
 
   :
 
-    fi
+fi
+
+
+
+
+
+          GNULIB_STPNCPY=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_STPNCPY 1" >>confdefs.h
+
+
+
+
+
+
+
+  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
+
+fi
+done
+
+  if test $ac_cv_func_strchrnul = no; then
+    HAVE_STRCHRNUL=0
   else
-    HAVE_STPNCPY=0
+    { $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*
 
 
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <string.h> /* for strchrnul */
+
+int
+main ()
+{
+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
+  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
+{ $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
+
+if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS stpncpy.$ac_objext"
 
 
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS strchrnul.$ac_objext"
+
   :
+fi
 
-  fi
 
 
 
 
-  GNULIB_STPNCPY=1
+          GNULIB_STRCHRNUL=1
 
 
 
-$as_echo "#define GNULIB_TEST_STPNCPY 1" >>confdefs.h
+
+
+$as_echo "#define GNULIB_TEST_STRCHRNUL 1" >>confdefs.h
 
 
 
-  # Code from module streq:
-  # Code from module string:
 
 
 
-  # Code from module strndup:
 
 
 
@@ -25710,6 +28946,7 @@ $as_echo "#define GNULIB_TEST_STPNCPY 1" >>confdefs.h
   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; }
@@ -25733,8 +28970,12 @@ int
 main ()
 {
 
-#ifndef HAVE_DECL_STRNDUP
-  extern char *strndup (const char *, size_t);
+#if !HAVE_DECL_STRNDUP
+  extern
+  #ifdef __cplusplus
+  "C"
+  #endif
+  char *strndup (const char *, size_t);
 #endif
   char *s;
   s = strndup ("some longer string", 15);
 { $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
-
-
-
-
-
+      *no) REPLACE_STRNDUP=1 ;;
+    esac
+  else
+    HAVE_STRNDUP=0
+  fi
 
+if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then
 
 
-  gl_LIBOBJS="$gl_LIBOBJS strndup.$ac_objext"
 
-        ;;
-    esac
-  else
 
 
 
 
 
+  gl_LIBOBJS="$gl_LIBOBJS strndup.$ac_objext"
 
+fi
 
 
-  gl_LIBOBJS="$gl_LIBOBJS strndup.$ac_objext"
 
-  fi
 
 
+          GNULIB_STRNDUP=1
 
 
-  GNULIB_STRNDUP=1
 
 
 
@@ -25796,7 +29032,6 @@ $as_echo "#define GNULIB_TEST_STRNDUP 1" >>confdefs.h
 
 
 
-  # Code from module strnlen:
 
 
 
@@ -25812,7 +29047,8 @@ $as_echo "#define GNULIB_TEST_STRNDUP 1" >>confdefs.h
   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 "$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
 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 &&
-
-
+test $ac_cv_func_strnlen_working = no && :
 
 
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext"
-
-
-        if test $ac_cv_func_strnlen_working = no; then
+    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
+
+if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then
 
 
 
@@ -25888,13 +29117,16 @@ test $ac_cv_func_strnlen_working = no &&
 
   gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext"
 
-    :
-  fi
+  :
+fi
+
+
+
 
 
+          GNULIB_STRNLEN=1
 
 
-  GNULIB_STRNLEN=1
 
 
 
@@ -25902,8 +29134,6 @@ $as_echo "#define GNULIB_TEST_STRNLEN 1" >>confdefs.h
 
 
 
-  # Code from module strnlen1:
-  # Code from module strstr:
 
 
   if test $REPLACE_STRSTR = 0; then
@@ -25913,12 +29143,13 @@ 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
+                             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
@@ -25933,7 +29164,7 @@ else
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   $EGREP "Lucky user" >/dev/null 2>&1; then :
-  gl_cv_func_strstr_linear=yes
+  gl_cv_func_strstr_linear="guessing yes"
 else
   gl_cv_func_strstr_linear="guessing no"
 fi
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_linear" >&5
 $as_echo "$gl_cv_func_strstr_linear" >&6; }
-    if test "$gl_cv_func_strstr_linear" != yes; then
-      REPLACE_STRSTR=1
-    fi
+    case "$gl_cv_func_strstr_linear" in
+      *yes) ;;
+      *)
+        REPLACE_STRSTR=1
+        ;;
+    esac
   fi
-  if test $REPLACE_STRSTR = 1; then
 
+if test $REPLACE_STRSTR = 1; then
 
 
 
@@ -26006,26 +29240,15 @@ $as_echo "$gl_cv_func_strstr_linear" >&6; }
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext"
 
-  fi
+  gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext"
 
-  # Code from module strstr-simple:
+fi
 
 
 
   if test "$gl_cv_func_memchr_works" != yes; then
     REPLACE_STRSTR=1
-
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext"
-
   else
         { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5
 $as_echo_n "checking whether strstr works... " >&6; }
@@ -26054,7 +29277,7 @@ else
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   $EGREP "Lucky user" >/dev/null 2>&1; then :
-  gl_cv_func_strstr_works_always=yes
+  gl_cv_func_strstr_works_always="guessing yes"
 else
   gl_cv_func_strstr_works_always="guessing no"
 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; }
-    if test "$gl_cv_func_strstr_works_always" != yes; then
-      REPLACE_STRSTR=1
+    case "$gl_cv_func_strstr_works_always" in
+      *yes) ;;
+      *)
+        REPLACE_STRSTR=1
+        ;;
+    esac
+  fi
+
+if test $REPLACE_STRSTR = 1; then
 
 
 
@@ -26104,13 +29334,15 @@ $as_echo "$gl_cv_func_strstr_works_always" >&6; }
 
   gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext"
 
-    fi
-  fi
+fi
+
+
 
 
 
+          GNULIB_STRSTR=1
+
 
-  GNULIB_STRSTR=1
 
 
 
@@ -26118,7 +29350,6 @@ $as_echo "#define GNULIB_TEST_STRSTR 1" >>confdefs.h
 
 
 
-  # Code from module sys_stat:
 
 
 
@@ -26162,13 +29393,27 @@ _ACEOF
                  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/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_next_sys_stat_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-                  sed -n '\#/sys/stat.h#{
-                    s#.*"\(.*/sys/stat.h\)".*#\1#
-                    s#^/[^/]#//&#
-                    p
-                    q
-                  }'`'"'
+                      sed -n "$gl_absolute_header_sed"`'"'
           else
                gl_cv_next_sys_stat_h='<'sys/stat.h'>'
              fi
@@ -26193,6 +29438,18 @@ $as_echo "$gl_cv_next_sys_stat_h" >&6; }
 
 
 
+
+
+
+
+
+
+  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>
 "
@@ -26206,7 +29463,7 @@ fi
 
 
 
-    for gl_func in fchmodat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat     mknod mknodat stat utimensat; do
+    for gl_func in fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat     mknod mknodat stat utimensat; do
     as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
 $as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
@@ -26236,7 +29493,7 @@ fi
 eval ac_res=\$$as_gl_Symbol
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-     if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
 _ACEOF
 
 
 
-  # Code from module sys_wait:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+     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
+
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.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/types.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_next_sys_types_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
+
+
+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; }
+     fi
+     NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_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/types.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_sys_types_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+
+
+
 
 
 
@@ -26287,13 +29624,27 @@ _ACEOF
                  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_next_sys_wait_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-                  sed -n '\#/sys/wait.h#{
-                    s#.*"\(.*/sys/wait.h\)".*#\1#
-                    s#^/[^/]#//&#
-                    p
-                    q
-                  }'`'"'
+                      sed -n "$gl_absolute_header_sed"`'"'
           else
                gl_cv_next_sys_wait_h='<'sys/wait.h'>'
              fi
@@ -26319,6 +29670,8 @@ $as_echo "$gl_cv_next_sys_wait_h" >&6; }
 
 
 
+
+
     for gl_func in waitpid; do
     as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
@@ -26348,7 +29701,7 @@ fi
 eval ac_res=\$$as_gl_Symbol
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-     if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
 _ACEOF
 
 
 
-  # Code from module time:
+
+
+  :
+
+
 
 
 
-  # Code from module unistd:
 
 
 
@@ -26404,13 +29760,27 @@ _ACEOF
                  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_next_unistd_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-                  sed -n '\#/unistd.h#{
-                    s#.*"\(.*/unistd.h\)".*#\1#
-                    s#^/[^/]#//&#
-                    p
-                    q
-                  }'`'"'
+                      sed -n "$gl_absolute_header_sed"`'"'
           else
                gl_cv_next_unistd_h='<'unistd.h'>'
              fi
@@ -26442,7 +29812,11 @@ $as_echo "$gl_cv_next_unistd_h" >&6; }
 
 
 
-    for gl_func in chown dup2 dup3 environ euidaccess faccessat fchdir fchownat     fsync ftruncate getcwd getdomainname getdtablesize getgroups     gethostname getlogin getlogin_r getpagesize getusershell setusershell     endusershell lchown link linkat lseek pipe pipe2 pread pwrite readlink     readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat     usleep; do
+
+
+
+
+    for gl_func in chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat     fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups     gethostname getlogin getlogin_r getpagesize     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; do
     as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
 $as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
@@ -26451,7 +29825,10 @@ if eval \${$as_gl_Symbol+:} false; then :
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <unistd.h>
+
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
 /* Some systems declare various items in the wrong headers.  */
 #if !(defined __GLIBC__ && !defined __UCLIBC__)
 # include <fcntl.h>
@@ -26481,7 +29858,7 @@ fi
 eval ac_res=\$$as_gl_Symbol
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-     if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
 _ACEOF
@@ -26491,8 +29868,6 @@ fi
       done
 
 
-  # Code from module unused-parameter:
-  # Code from module vasnprintf:
 
 
   :
@@ -26584,7 +29959,6 @@ fi
 
   fi
 
-  # Code from module vasprintf:
 
   for ac_func in vasprintf
 do :
@@ -26638,25 +30012,19 @@ done
 
 
 
-  GNULIB_VASPRINTF=1
 
 
-
-$as_echo "#define GNULIB_TEST_VASPRINTF 1" >>confdefs.h
+          GNULIB_VASPRINTF=1
 
 
 
 
 
-  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=asprintf:2:c-format"
+$as_echo "#define GNULIB_TEST_VASPRINTF 1" >>confdefs.h
 
 
 
-  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=vasprintf:2:c-format"
 
-  # Code from module verify:
-  # Code from module warn-on-use:
-  # Code from module wchar:
 
 
 
@@ -26696,13 +30064,27 @@ _ACEOF
                  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_next_wchar_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-                  sed -n '\#/wchar.h#{
-                    s#.*"\(.*/wchar.h\)".*#\1#
-                    s#^/[^/]#//&#
-                    p
-                    q
-                  }'`'"'
+                      sed -n "$gl_absolute_header_sed"`'"'
           else
                gl_cv_next_wchar_h='<'wchar.h'>'
              fi
@@ -26784,7 +30166,7 @@ fi
 eval ac_res=\$$as_gl_Symbol
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-     if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
 _ACEOF
@@ -26794,7 +30176,6 @@ fi
       done
 
 
-  # Code from module wcrtomb:
 
 
 
@@ -26960,11 +30341,6 @@ $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
   else
     REPLACE_MBSTATE_T=1
   fi
-  if test $REPLACE_MBSTATE_T = 1; then
-
-    :
-
-  fi
 
 
 
@@ -26976,6 +30352,30 @@ $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
 
   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>
+
+"
+if test "x$ac_cv_have_decl_wcrtomb" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_WCRTOMB $ac_have_decl
+_ACEOF
+
+    if test $ac_cv_have_decl_wcrtomb = yes; then
+                        REPLACE_WCRTOMB=1
+    fi
   else
     if test $REPLACE_MBSTATE_T = 1; then
       REPLACE_WCRTOMB=1
@@ -27060,10 +30460,8 @@ $as_echo "$gl_cv_func_wcrtomb_retval" >&6; }
       esac
     fi
   fi
-  if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then
-
-    :
 
+if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then
 
 
 
@@ -27077,12 +30475,15 @@ $as_echo "$gl_cv_func_wcrtomb_retval" >&6; }
 
   :
 
-  fi
+fi
 
 
 
 
-  GNULIB_WCRTOMB=1
+
+          GNULIB_WCRTOMB=1
+
+
 
 
 
@@ -27090,7 +30491,6 @@ $as_echo "#define GNULIB_TEST_WCRTOMB 1" >>confdefs.h
 
 
 
-  # Code from module wctype-h:
 
 
 
@@ -27155,13 +30555,27 @@ _ACEOF
                  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_next_wctype_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-                  sed -n '\#/wctype.h#{
-                    s#.*"\(.*/wctype.h\)".*#\1#
-                    s#^/[^/]#//&#
-                    p
-                    q
-                  }'`'"'
+                      sed -n "$gl_absolute_header_sed"`'"'
           else
                gl_cv_next_wctype_h='<'wctype.h'>'
              fi
@@ -27209,9 +30623,9 @@ main ()
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_func_iswcntrl_works=yes
+  gl_cv_func_iswcntrl_works="guessing yes"
 else
-  gl_cv_func_iswcntrl_works=no
+  gl_cv_func_iswcntrl_works="guessing no"
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
@@ -27251,14 +30665,66 @@ $as_echo "$gl_cv_func_iswcntrl_works" >&6; }
   fi
 
 
-  if test "$gl_cv_func_iswcntrl_works" = no; then
-    REPLACE_ISWCNTRL=1
+  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
-    REPLACE_ISWCNTRL=0
+    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
+
+      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_ISWCNTRL = 1; then
+  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then
         :
   fi
 
@@ -27386,7 +30852,7 @@ fi
 eval ac_res=\$$as_gl_Symbol
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-     if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
 _ACEOF
@@ -27396,7 +30862,6 @@ fi
       done
 
 
-  # Code from module xsize:
 
 
 
@@ -27442,6 +30907,7 @@ done
 
 
 
+
   { $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 :
@@ -27463,9 +30929,9 @@ char buf[16];
 int main () {
   /* Check whether the given locale name is recognized by the system.  */
 #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -27474,7 +30940,7 @@ int main () {
   if (setlocale (LC_ALL, "") == NULL) return 1;
 #endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -27500,10 +30966,12 @@ int main () {
      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;
 }
 
@@ -27521,7 +30989,7 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the native Win32 locale name.
+          # 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
@@ -27531,7 +30999,7 @@ _ACEOF
           ;;
         *)
           # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -27599,9 +31067,9 @@ int main () {
 #if !(defined __BEOS__ || defined __HAIKU__)
   /* Check whether the given locale name is recognized by the system.  */
 # if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -27610,7 +31078,7 @@ int main () {
   if (setlocale (LC_ALL, "") == NULL) return 1;
 # endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -27636,10 +31104,12 @@ int main () {
       || 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;
 }
 
@@ -27657,7 +31127,7 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the hypothetical native Win32 locale name.
+          # 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
@@ -27667,7 +31137,7 @@ _ACEOF
           ;;
         *)
           # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -27722,9 +31192,9 @@ char buf[16];
 int main () {
   /* Check whether the given locale name is recognized by the system.  */
 #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -27733,7 +31203,7 @@ int main () {
   if (setlocale (LC_ALL, "") == NULL) return 1;
 #endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -27759,10 +31229,12 @@ int main () {
      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;
 }
 
@@ -27780,7 +31252,7 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the native Win32 locale name.
+          # 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
@@ -27790,7 +31262,7 @@ _ACEOF
           ;;
         *)
           # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -27860,9 +31332,9 @@ int main () {
      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 Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -27871,7 +31343,7 @@ int main () {
   if (setlocale (LC_ALL, "") == NULL) return 1;
 #endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET)
+     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,
@@ -27918,7 +31390,7 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the hypothetical native Win32 locale name.
+          # 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
@@ -27928,7 +31400,7 @@ _ACEOF
           ;;
         *)
           # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -27964,6 +31436,13 @@ $as_echo "$gt_cv_locale_tr_utf8" >&6; }
 
 
 
+  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+    REPLACE_CLOSE=1
+  fi
+
+
+
+
 
   :
 
@@ -27971,11 +31450,36 @@ $as_echo "$gt_cv_locale_tr_utf8" >&6; }
 
 
 
+  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
+
+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
+
+
+    if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
+                        REPLACE_CLOSE=1
+    fi
 
 
 
-  if test $ac_cv_func_dup2 = no; then
-    HAVE_DUP2=0
+if test $REPLACE_CLOSE = 1; then
 
 
 
@@ -27984,9 +31488,39 @@ $as_echo "$gt_cv_locale_tr_utf8" >&6; }
 
 
 
-  gltests_LIBOBJS="$gltests_LIBOBJS dup2.$ac_objext"
+  gltests_LIBOBJS="$gltests_LIBOBJS close.$ac_objext"
 
-  else
+fi
+
+
+
+
+
+    if test "$GNULIB_CLOSE" != 1; then
+        if test "$GNULIB_CLOSE" = 0; then
+      GNULIB_CLOSE=$gl_module_indicator_condition
+    else
+      GNULIB_CLOSE="($GNULIB_CLOSE || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_CLOSE 1" >>confdefs.h
+
+
+
+
+
+
+
+
+$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 :
@@ -27995,17 +31529,17 @@ 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=no;;
+             gl_cv_func_dup2_works="guessing no" ;;
            cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
-             gl_cv_func_dup2_works=no;;
+             gl_cv_func_dup2_works="guessing no" ;;
            linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a
                    # closed fd may yield -EBADF instead of -1 / errno=EBADF.
-             gl_cv_func_dup2_works=no;;
+             gl_cv_func_dup2_works="guessing no" ;;
            freebsd*) # on FreeBSD 6.1, dup2(1,1000000) gives EMFILE, not EBADF.
-             gl_cv_func_dup2_works=no;;
+             gl_cv_func_dup2_works="guessing no" ;;
            haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
-             gl_cv_func_dup2_works=no;;
-           *) gl_cv_func_dup2_works=yes;;
+             gl_cv_func_dup2_works="guessing no" ;;
+           *) gl_cv_func_dup2_works="guessing yes" ;;
          esac
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -28018,13 +31552,13 @@ int
 main ()
 {
 int result = 0;
-#if HAVE_FCNTL
+#ifdef FD_CLOEXEC
             if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
               result |= 1;
-#endif HAVE_FCNTL
+#endif
             if (dup2 (1, 1) == 0)
               result |= 2;
-#if HAVE_FCNTL
+#ifdef FD_CLOEXEC
             if (fcntl (1, F_GETFD) != FD_CLOEXEC)
               result |= 4;
 #endif
@@ -28040,60 +31574,220 @@ int result = 0;
   return 0;
 }
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_dup2_works=yes
-else
-  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
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_dup2_works=yes
+else
+  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
+{ $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
+        ;;
+    esac
+  fi
+
+
+if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
+
+
+
+
+
+
+
+
+  gltests_LIBOBJS="$gltests_LIBOBJS dup2.$ac_objext"
+
+
+fi
+
+
+
+
+
+    if test "$GNULIB_DUP2" != 1; then
+        if test "$GNULIB_DUP2" = 0; then
+      GNULIB_DUP2=$gl_module_indicator_condition
+    else
+      GNULIB_DUP2="($GNULIB_DUP2 || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_DUP2 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+    if test "$GNULIB_ENVIRON" != 1; then
+        if test "$GNULIB_ENVIRON" = 0; then
+      GNULIB_ENVIRON=$gl_module_indicator_condition
+    else
+      GNULIB_ENVIRON="($GNULIB_ENVIRON || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_ENVIRON 1" >>confdefs.h
+
+
+
+
+
+
+  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
+
+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
+
+
+
+
+
+
+
+
+  gltests_LIBOBJS="$gltests_LIBOBJS fdopen.$ac_objext"
+
+
+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
+  fi
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FDOPEN 1" >>confdefs.h
+
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5
-$as_echo "$gl_cv_func_dup2_works" >&6; }
-    if test "$gl_cv_func_dup2_works" = no; then
 
 
-  if test $ac_cv_func_dup2 = yes; then
-    REPLACE_DUP2=1
+
+
+  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+    REPLACE_FSTAT=1
   fi
 
 
+  if test $WINDOWS_64_BIT_ST_SIZE = 1; then
+    REPLACE_FSTAT=1
+  fi
 
 
 
+if test $REPLACE_FSTAT = 1; then
 
 
 
-  gltests_LIBOBJS="$gltests_LIBOBJS dup2.$ac_objext"
 
 
-    fi
-  fi
 
 
 
+  gltests_LIBOBJS="$gltests_LIBOBJS fstat.$ac_objext"
 
-  GNULIB_DUP2=$gl_module_indicator_condition
 
 
 
-$as_echo "#define GNULIB_TEST_DUP2 1" >>confdefs.h
+fi
 
 
 
 
 
+    if test "$GNULIB_FSTAT" != 1; then
+        if test "$GNULIB_FSTAT" = 0; then
+      GNULIB_FSTAT=$gl_module_indicator_condition
+    else
+      GNULIB_FSTAT="($GNULIB_FSTAT || $gl_module_indicator_condition)"
+    fi
+  fi
 
 
-  GNULIB_ENVIRON=$gl_module_indicator_condition
 
 
 
-$as_echo "#define GNULIB_TEST_ENVIRON 1" >>confdefs.h
+$as_echo "#define GNULIB_TEST_FSTAT 1" >>confdefs.h
 
 
 
@@ -28102,97 +31796,44 @@ $as_echo "#define GNULIB_TEST_ENVIRON 1" >>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
 
 
 
 
 
-     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
 
-               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
-                                                            gl_cv_next_fcntl_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-                  sed -n '\#/fcntl.h#{
-                    s#.*"\(.*/fcntl.h\)".*#\1#
-                    s#^/[^/]#//&#
-                    p
-                    q
-                  }'`'"'
 
+  gltests_LIBOBJS="$gltests_LIBOBJS getcwd-lgpl.$ac_objext"
 
 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
 
 
 
 
+    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)"
+    fi
+  fi
 
 
-    for gl_func in fcntl openat; do
-    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
-$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
-if eval \${$as_gl_Symbol+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <fcntl.h>
 
-int
-main ()
-{
-#undef $gl_func
-  (void) $gl_func;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval "$as_gl_Symbol=yes"
-else
-  eval "$as_gl_Symbol=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$as_gl_Symbol
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-     if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
-_ACEOF
 
-                     eval ac_cv_have_decl_$gl_func=yes
-fi
-      done
+
+$as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h
+
 
 
 
@@ -28245,6 +31886,17 @@ done
   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
+
+
+if test $REPLACE_GETPAGESIZE = 1; then
 
 
 
@@ -28255,25 +31907,279 @@ done
 
   gltests_LIBOBJS="$gltests_LIBOBJS getpagesize.$ac_objext"
 
-      ;;
-  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 :
+fi
+
+
+
+
+
+    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
+  fi
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_GETPAGESIZE 1" >>confdefs.h
+
+
+
 
+
+
+
+
+
+  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
+
+
+
+  { $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
-  HAVE_DECL_GETPAGESIZE=0
+  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
+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;
+  fi
+
+
+  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
+  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
 
-  GNULIB_GETPAGESIZE=$gl_module_indicator_condition
+            #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
 
-$as_echo "#define GNULIB_TEST_GETPAGESIZE 1" >>confdefs.h
 
+  else
+    UINT64_MAX_EQ_ULONG_MAX=-1
+  fi
 
 
 
@@ -28310,7 +32216,7 @@ done
 
 
   if test "$gl_threads_api" = posix; then
-    # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the
+    # 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>
 "
@@ -28375,9 +32281,9 @@ char buf[16];
 int main () {
   /* Check whether the given locale name is recognized by the system.  */
 #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -28386,7 +32292,7 @@ int main () {
   if (setlocale (LC_ALL, "") == NULL) return 1;
 #endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -28412,10 +32318,12 @@ int main () {
      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;
 }
 
@@ -28433,7 +32341,7 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the native Win32 locale name.
+          # 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
@@ -28443,7 +32351,7 @@ _ACEOF
           ;;
         *)
           # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -28511,9 +32419,9 @@ int main () {
 #if !(defined __BEOS__ || defined __HAIKU__)
   /* Check whether the given locale name is recognized by the system.  */
 # if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -28522,7 +32430,7 @@ int main () {
   if (setlocale (LC_ALL, "") == NULL) return 1;
 # endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -28548,10 +32456,12 @@ int main () {
       || 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;
 }
 
@@ -28569,7 +32479,7 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the hypothetical native Win32 locale name.
+          # 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
@@ -28579,7 +32489,7 @@ _ACEOF
           ;;
         *)
           # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -28636,9 +32546,9 @@ int main ()
   const char *p;
   /* Check whether the given locale name is recognized by the system.  */
 #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -28647,7 +32557,7 @@ int main ()
   if (setlocale (LC_ALL, "") == NULL) return 1;
 #endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -28696,13 +32606,14 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Note that on native Win32, the Japanese locale is Japanese_Japan.932,
-          # and CP932 is very different from EUC-JP, so we cannot use it here.
+          # 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 MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -28775,9 +32686,9 @@ int main ()
   const char *p;
   /* Check whether the given locale name is recognized by the system.  */
 #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -28786,7 +32697,7 @@ int main ()
   if (setlocale (LC_ALL, "") == NULL) return 1;
 #endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -28835,7 +32746,7 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the hypothetical native Win32 locale name.
+          # 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
@@ -28843,9 +32754,15 @@ _ACEOF
             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 MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -28902,9 +32819,272 @@ int main () {
 #if !(defined __BEOS__ || defined __HAIKU__)
   /* Check whether the given locale name is recognized by the system.  */
 # if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 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*
+
+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
+
+    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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -28913,7 +33093,7 @@ int main () {
   if (setlocale (LC_ALL, "") == NULL) return 1;
 # endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -28939,269 +33119,12 @@ int main () {
       || 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;
-  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 Win32 locale name.
-          if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-            gt_cv_locale_fr_utf8=French_France.65001
-          else
-            # None found.
-            gt_cv_locale_fr_utf8=none
-          fi
-          ;;
-        *)
-          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
-          # configure script would override the LC_ALL setting. Likewise for
-          # LC_CTYPE, which is also set at the beginning of the configure script.
-          # Test for the usual locale name.
-          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-            gt_cv_locale_fr_utf8=fr_FR
-          else
-            # Test for the locale name with explicit encoding suffix.
-            if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-              gt_cv_locale_fr_utf8=fr_FR.UTF-8
-            else
-              # Test for the Solaris 7 locale name.
-              if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-                gt_cv_locale_fr_utf8=fr.UTF-8
-              else
-                # None found.
-                gt_cv_locale_fr_utf8=none
-              fi
-            fi
-          fi
-          ;;
-      esac
-    fi
-    rm -fr conftest*
-
-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 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 Win32, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is speficied, it succeeds but sets the LC_CTYPE
-     category of the locale to "C".  */
-  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
-      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
-    return 1;
-#else
-  if (setlocale (LC_ALL, "") == NULL) return 1;
-#endif
-  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
-     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
-     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;
-  /* 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;
-  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 Win32 locale name.
-          if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-            gt_cv_locale_fr=French_France.1252
-          else
-            # None found.
-            gt_cv_locale_fr=none
-          fi
-          ;;
-        *)
-          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
-          # configure script would override the LC_ALL setting. Likewise for
-          # LC_CTYPE, which is also set at the beginning of the configure script.
-          # Test for the usual locale name.
-          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-            gt_cv_locale_fr=fr_FR
-          else
-            # Test for the 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
-
-    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 Win32, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is speficied, it succeeds but sets the LC_CTYPE
-     category of the locale to "C".  */
-  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
-      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
-    return 1;
-# else
-  if (setlocale (LC_ALL, "") == NULL) return 1;
-# endif
-  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
-     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
-     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
-  /* 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;
   return 0;
 }
 
@@ -29219,7 +33142,7 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the hypothetical native Win32 locale name.
+          # 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
@@ -29229,7 +33152,7 @@ _ACEOF
           ;;
         *)
           # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -29286,9 +33209,9 @@ int main ()
   const char *p;
   /* Check whether the given locale name is recognized by the system.  */
 #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -29297,7 +33220,7 @@ int main ()
   if (setlocale (LC_ALL, "") == NULL) return 1;
 #endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -29346,13 +33269,14 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Note that on native Win32, the Japanese locale is Japanese_Japan.932,
-          # and CP932 is very different from EUC-JP, so we cannot use it here.
+          # 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 MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -29425,9 +33349,9 @@ int main ()
   const char *p;
   /* Check whether the given locale name is recognized by the system.  */
 #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -29436,7 +33360,7 @@ int main ()
   if (setlocale (LC_ALL, "") == NULL) return 1;
 #endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -29485,7 +33409,7 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the hypothetical native Win32 locale name.
+          # 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
@@ -29493,9 +33417,15 @@ _ACEOF
             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 MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -29549,12 +33479,12 @@ $as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
 
 #include <sys/mman.h>
 #ifdef MAP_ANONYMOUS
-    I cant identify this map.
+    I cannot identify this map
 #endif
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cant identify this map." >/dev/null 2>&1; then :
+  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
   gl_have_mmap_anonymous=yes
 fi
 rm -f conftest*
@@ -29565,12 +33495,12 @@ rm -f conftest*
 
 #include <sys/mman.h>
 #ifdef MAP_ANON
-    I cant identify this map.
+    I cannot identify this map
 #endif
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cant identify this map." >/dev/null 2>&1; then :
+  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
 
 $as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
 
@@ -29604,6 +33534,51 @@ $as_echo "#define HAVE_MAP_ANONYMOUS 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
+
+  else
+    HAVE_MSVC_INVALID_PARAMETER_HANDLER=0
+  fi
+
+
+if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+
+
+
+
+
+
+
+
+  gltests_LIBOBJS="$gltests_LIBOBJS msvc-inval.$ac_objext"
+
+fi
+
+
+
+if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+
+
+
+
+
+
+
+
+  gltests_LIBOBJS="$gltests_LIBOBJS msvc-nothrow.$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; }
@@ -29626,9 +33601,9 @@ char buf[16];
 int main () {
   /* Check whether the given locale name is recognized by the system.  */
 #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -29637,7 +33612,7 @@ int main () {
   if (setlocale (LC_ALL, "") == NULL) return 1;
 #endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -29663,10 +33638,12 @@ int main () {
      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;
 }
 
@@ -29684,7 +33661,7 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the native Win32 locale name.
+          # 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
@@ -29694,7 +33671,7 @@ _ACEOF
           ;;
         *)
           # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -29762,9 +33739,9 @@ int main () {
 #if !(defined __BEOS__ || defined __HAIKU__)
   /* Check whether the given locale name is recognized by the system.  */
 # if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -29773,7 +33750,7 @@ int main () {
   if (setlocale (LC_ALL, "") == NULL) return 1;
 # endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -29799,10 +33776,12 @@ int main () {
       || 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;
 }
 
@@ -29820,7 +33799,7 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the hypothetical native Win32 locale name.
+          # 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
@@ -29830,7 +33809,7 @@ _ACEOF
           ;;
         *)
           # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -29865,25 +33844,7 @@ $as_echo "$gt_cv_locale_fr_utf8" >&6; }
 
   case "$host_os" in
     mingw* | pw*)
-
-
-  REPLACE_OPEN=1
-
-
-
-
-
-
-
-
-  gltests_LIBOBJS="$gltests_LIBOBJS open.$ac_objext"
-
-
-
-
-  :
-
-
+      REPLACE_OPEN=1
       ;;
     *)
 
@@ -29951,9 +33912,15 @@ $as_echo "$gl_cv_func_open_slash" >&6; }
 
 $as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
 
+          REPLACE_OPEN=1
+          ;;
+      esac
+      ;;
+  esac
+
 
 
-  REPLACE_OPEN=1
+if test $REPLACE_OPEN = 1; then
 
 
 
@@ -29969,16 +33936,21 @@ $as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
 
   :
 
+fi
+
 
-          ;;
-      esac
-      ;;
-  esac
 
 
 
+    if test "$GNULIB_OPEN" != 1; then
+        if test "$GNULIB_OPEN" = 0; then
+      GNULIB_OPEN=$gl_module_indicator_condition
+    else
+      GNULIB_OPEN="($GNULIB_OPEN || $gl_module_indicator_condition)"
+    fi
+  fi
+
 
-  GNULIB_OPEN=$gl_module_indicator_condition
 
 
 
@@ -29988,13 +33960,19 @@ $as_echo "#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 "$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 :
-               gl_cv_func_svid_putenv=no
+               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.  */
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_svid_putenv" >&5
 $as_echo "$gl_cv_func_svid_putenv" >&6; }
-  if test $gl_cv_func_svid_putenv = no; then
-    REPLACE_PUTENV=1
+  case "$gl_cv_func_svid_putenv" in
+    *yes) ;;
+    *)
+      REPLACE_PUTENV=1
+      ;;
+  esac
+
+if test $REPLACE_PUTENV = 1; then
 
 
 
@@ -30046,12 +34030,21 @@ $as_echo "$gl_cv_func_svid_putenv" >&6; }
 
   gltests_LIBOBJS="$gltests_LIBOBJS putenv.$ac_objext"
 
-  fi
+fi
 
 
 
 
-  GNULIB_PUTENV=$gl_module_indicator_condition
+
+    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
+
+
 
 
 
@@ -30061,23 +34054,176 @@ $as_echo "#define GNULIB_TEST_PUTENV 1" >>confdefs.h
 
 
 
-  if test $HAVE_SETENV$REPLACE_SETENV != 10; 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.  */
 
+#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 :
 
-  gltests_LIBOBJS="$gltests_LIBOBJS setenv.$ac_objext"
+$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
 
 
+  :
+
+
+
+
+
+
+  :
+
+
+
+
+
+
+
+     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
+  fi
+
+if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then
+
+
+
+
+
+
+
+
+  gltests_LIBOBJS="$gltests_LIBOBJS setenv.$ac_objext"
+
+fi
+
+
+
+
+
+    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
 
 
-  GNULIB_SETENV=$gl_module_indicator_condition
 
 
 
@@ -30090,11 +34236,14 @@ $as_echo "#define GNULIB_TEST_SETENV 1" >>confdefs.h
 
   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
-
-    :
 
+if test $REPLACE_SETLOCALE = 1; then
 
 
 
@@ -30108,12 +34257,21 @@ $as_echo "#define GNULIB_TEST_SETENV 1" >>confdefs.h
 
   :
 
-  fi
+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
 
 
-  GNULIB_SETLOCALE=$gl_module_indicator_condition
 
 
 
@@ -30145,9 +34303,9 @@ char buf[16];
 int main () {
   /* Check whether the given locale name is recognized by the system.  */
 #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -30156,7 +34314,7 @@ int main () {
   if (setlocale (LC_ALL, "") == NULL) return 1;
 #endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -30182,10 +34340,12 @@ int main () {
      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;
 }
 
@@ -30203,7 +34363,7 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the native Win32 locale name.
+          # 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
@@ -30213,7 +34373,7 @@ _ACEOF
           ;;
         *)
           # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -30281,9 +34441,9 @@ int main () {
 #if !(defined __BEOS__ || defined __HAIKU__)
   /* Check whether the given locale name is recognized by the system.  */
 # if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -30292,7 +34452,7 @@ int main () {
   if (setlocale (LC_ALL, "") == NULL) return 1;
 # endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -30318,10 +34478,12 @@ int main () {
       || 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;
 }
 
@@ -30339,7 +34501,7 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the hypothetical native Win32 locale name.
+          # 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
@@ -30349,7 +34511,7 @@ _ACEOF
           ;;
         *)
           # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -30406,9 +34568,9 @@ int main ()
   const char *p;
   /* Check whether the given locale name is recognized by the system.  */
 #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -30417,7 +34579,7 @@ int main ()
   if (setlocale (LC_ALL, "") == NULL) return 1;
 #endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -30466,13 +34628,14 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Note that on native Win32, the Japanese locale is Japanese_Japan.932,
-          # and CP932 is very different from EUC-JP, so we cannot use it here.
+          # 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 MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -30545,9 +34708,9 @@ int main ()
   const char *p;
   /* Check whether the given locale name is recognized by the system.  */
 #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -30556,7 +34719,7 @@ int main ()
   if (setlocale (LC_ALL, "") == NULL) return 1;
 #endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -30605,7 +34768,7 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the hypothetical native Win32 locale name.
+          # 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
@@ -30613,9 +34776,15 @@ _ACEOF
             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 MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -30743,96 +34912,12 @@ $as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
 
 #include <sys/mman.h>
 #ifdef MAP_ANONYMOUS
-    I cant identify this map.
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cant 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 cant identify this map.
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cant 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
-
-
-  :
-
-
-
-
-
-
-  :
-
-
-
-
-
-
-  :
-
-
-
-
-
-
-
-
-  # 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 cant identify this map.
+    I cannot identify this map
 #endif
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cant identify this map." >/dev/null 2>&1; then :
+  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
   gl_have_mmap_anonymous=yes
 fi
 rm -f conftest*
@@ -30843,12 +34928,12 @@ rm -f conftest*
 
 #include <sys/mman.h>
 #ifdef MAP_ANON
-    I cant identify this map.
+    I cannot identify this map
 #endif
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cant identify this map." >/dev/null 2>&1; then :
+  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
 
 $as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
 
@@ -30881,6 +34966,74 @@ $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
+/* 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*
+
+    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
 
 
   :
@@ -30889,9 +35042,8 @@ $as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
 
 
 
-        if test $ac_cv_func_symlink = no; then
-    HAVE_SYMLINK=0
 
+  :
 
 
 
@@ -30899,8 +35051,15 @@ $as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
 
 
 
-  gltests_LIBOBJS="$gltests_LIBOBJS symlink.$ac_objext"
 
+  :
+
+
+
+
+
+        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; }
@@ -30908,7 +35067,13 @@ if ${gl_cv_func_symlink_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
-  gl_cv_func_symlink_works="guessing 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" ;;
+          esac
+
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_symlink_works" >&5
 $as_echo "$gl_cv_func_symlink_works" >&6; }
-    if test "$gl_cv_func_symlink_works" != yes; then
-      REPLACE_SYMLINK=1
+    case "$gl_cv_func_symlink_works" in
+      *yes) ;;
+      *)
+        REPLACE_SYMLINK=1
+        ;;
+    esac
+  fi
+
+if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then
 
 
 
@@ -30955,13 +35127,21 @@ $as_echo "$gl_cv_func_symlink_works" >&6; }
 
   gltests_LIBOBJS="$gltests_LIBOBJS symlink.$ac_objext"
 
-    fi
-  fi
+fi
+
+
 
 
 
+    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
+  fi
+
 
-  GNULIB_SYMLINK=$gl_module_indicator_condition
 
 
 
 done
 
   if test $ac_cv_func_unsetenv = no; then
-
-
-
-
-
-
-
-
-  gltests_LIBOBJS="$gltests_LIBOBJS unsetenv.$ac_objext"
-
-
-
-
-  :
-
-
-
-
-
-
+    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 :
@@ -31054,11 +35216,7 @@ extern
 #ifdef __cplusplus
 "C"
 #endif
-#if defined(__STDC__) || defined(__cplusplus)
 int unsetenv (const char *name);
-#else
-int unsetenv();
-#endif
 
 int
 main ()
@@ -31082,16 +35240,6 @@ $as_echo "$gt_cv_func_unsetenv_ret" >&6; }
 $as_echo "#define VOID_UNSETENV 1" >>confdefs.h
 
       REPLACE_UNSETENV=1
-
-
-
-
-
-
-
-
-  gltests_LIBOBJS="$gltests_LIBOBJS unsetenv.$ac_objext"
-
     fi
 
                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5
@@ -31100,7 +35248,13 @@ if ${gl_cv_func_unsetenv_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
-  gl_cv_func_unsetenv_works="guessing 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
+
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5
 $as_echo "$gl_cv_func_unsetenv_works" >&6; }
-    if test "$gl_cv_func_unsetenv_works" != yes; then
-      REPLACE_UNSETENV=1
+    case "$gl_cv_func_unsetenv_works" in
+      *yes) ;;
+      *)
+        REPLACE_UNSETENV=1
+        ;;
+    esac
+  fi
+
+if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then
 
 
 
@@ -31157,13 +35318,31 @@ $as_echo "$gl_cv_func_unsetenv_works" >&6; }
 
   gltests_LIBOBJS="$gltests_LIBOBJS unsetenv.$ac_objext"
 
-    fi
-  fi
 
 
 
+  :
+
+
+
+
+
+
+fi
+
+
+
+
+
+    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
+  fi
+
 
-  GNULIB_UNSETENV=$gl_module_indicator_condition
 
 
 
@@ -31195,9 +35374,9 @@ char buf[16];
 int main () {
   /* Check whether the given locale name is recognized by the system.  */
 #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -31206,7 +35385,7 @@ int main () {
   if (setlocale (LC_ALL, "") == NULL) return 1;
 #endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -31232,10 +35411,12 @@ int main () {
      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;
 }
 
@@ -31253,7 +35434,7 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the native Win32 locale name.
+          # 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
@@ -31263,7 +35444,7 @@ _ACEOF
           ;;
         *)
           # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -31331,9 +35512,9 @@ int main () {
 #if !(defined __BEOS__ || defined __HAIKU__)
   /* Check whether the given locale name is recognized by the system.  */
 # if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -31342,7 +35523,7 @@ int main () {
   if (setlocale (LC_ALL, "") == NULL) return 1;
 # endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -31368,10 +35549,12 @@ int main () {
       || 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;
 }
 
@@ -31389,7 +35572,7 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the hypothetical native Win32 locale name.
+          # 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
@@ -31399,7 +35582,7 @@ _ACEOF
           ;;
         *)
           # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -31456,9 +35639,9 @@ int main ()
   const char *p;
   /* Check whether the given locale name is recognized by the system.  */
 #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -31467,7 +35650,7 @@ int main ()
   if (setlocale (LC_ALL, "") == NULL) return 1;
 #endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -31516,13 +35699,14 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Note that on native Win32, the Japanese locale is Japanese_Japan.932,
-          # and CP932 is very different from EUC-JP, so we cannot use it here.
+          # 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 MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -31595,9 +35779,9 @@ int main ()
   const char *p;
   /* Check whether the given locale name is recognized by the system.  */
 #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -31606,7 +35790,7 @@ int main ()
   if (setlocale (LC_ALL, "") == NULL) return 1;
 #endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -31655,7 +35839,7 @@ _ACEOF
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the hypothetical native Win32 locale name.
+          # 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
@@ -31663,9 +35847,15 @@ _ACEOF
             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 MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -31706,24 +35896,10 @@ $as_echo "$gt_cv_locale_zh_CN" >&6; }
 
 
   if test $ac_cv_func_wctob = no; then
+    HAVE_WCTOB=0
     HAVE_DECL_WCTOB=0
-
-    :
-
-
-
-
-
-
-
-
-
-  gltests_LIBOBJS="$gltests_LIBOBJS wctob.$ac_objext"
-
-
-  :
-
   else
+    HAVE_WCTOB=1
 
 
 
@@ -31831,24 +36007,7 @@ $as_echo "$gl_cv_func_wctob_works" >&6; }
       *yes) ;;
       *) REPLACE_WCTOB=1 ;;
     esac
-    if test $REPLACE_WCTOB = 1; then
-
-    :
-
-
-
-
-
-
-
-
-
-  gltests_LIBOBJS="$gltests_LIBOBJS wctob.$ac_objext"
-
-
-  :
-
-    else
+    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
@@ -31873,17 +36032,39 @@ _ACEOF
 
       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
+
 
 
 
-  GNULIB_WCTOB=$gl_module_indicator_condition
+
+
+
+
+  gltests_LIBOBJS="$gltests_LIBOBJS wctob.$ac_objext"
+
+
+  :
+
+fi
+
+
+
+
+
+    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)"
+    fi
+  fi
+
+
 
 
 
@@ -31897,7 +36078,8 @@ $as_echo "#define GNULIB_TEST_WCTOB 1" >>confdefs.h
   if false; then
     REPLACE_WCTOMB=1
   fi
-  if test $REPLACE_WCTOMB = 1; then
+
+if test $REPLACE_WCTOMB = 1; then
 
 
 
@@ -31911,12 +36093,21 @@ $as_echo "#define GNULIB_TEST_WCTOB 1" >>confdefs.h
 
   :
 
-  fi
+fi
+
 
 
 
 
-  GNULIB_WCTOMB=$gl_module_indicator_condition
+    if test "$GNULIB_WCTOMB" != 1; then
+        if test "$GNULIB_WCTOMB" = 0; then
+      GNULIB_WCTOMB=$gl_module_indicator_condition
+    else
+      GNULIB_WCTOMB="($GNULIB_WCTOMB || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
 
 
 
@@ -32032,6 +36223,7 @@ fi
 
 
 
+
 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
        if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
@@ -32052,7 +36244,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -32095,7 +36287,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -32160,6 +36352,7 @@ if test -n "$LIBXML_CFLAGS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_LIBXML_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -32176,6 +36369,7 @@ if test -n "$LIBXML_LIBS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_LIBXML_LIBS=`$PKG_CONFIG --libs "libxml-2.0" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -32195,9 +36389,9 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-               LIBXML_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libxml-2.0" 2>&1`
+               LIBXML_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libxml-2.0" 2>&1`
         else
-               LIBXML_PKG_ERRORS=`$PKG_CONFIG --print-errors "libxml-2.0" 2>&1`
+               LIBXML_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libxml-2.0" 2>&1`
         fi
        # Put the nasty error message in config.log where it belongs
        echo "$LIBXML_PKG_ERRORS" >&5
@@ -32212,7 +36406,6 @@ installed software in a non-standard prefix.
 Alternatively, you may set the environment variables LIBXML_CFLAGS
 and LIBXML_LIBS to avoid the need to call pkg-config.
 See the pkg-config man page for more details." "$LINENO" 5
-
 elif test $pkg_failed = untried; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
@@ -32228,7 +36421,6 @@ See the pkg-config man page for more details.
 
 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
 See \`config.log' for more details" "$LINENO" 5; }
-
 else
        LIBXML_CFLAGS=$pkg_cv_LIBXML_CFLAGS
        LIBXML_LIBS=$pkg_cv_LIBXML_LIBS
@@ -32346,7 +36538,6 @@ DEFS=-DHAVE_CONFIG_H
 
 ac_libobjs=
 ac_ltlibobjs=
-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$//'
@@ -32361,6 +36552,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; }
+   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; }
  if test -n "$EXEEXT"; then
   am__EXEEXT_TRUE=
   am__EXEEXT_FALSE='#'
@@ -32401,6 +36600,47 @@ 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
 fi
+if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then
+  as_fn_error $? "conditional \"GL_GENERATE_ALLOCA_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_ARGZ_H_TRUE}" && test -z "${GL_GENERATE_ARGZ_H_FALSE}"; then
+  as_fn_error $? "conditional \"GL_GENERATE_ARGZ_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then
+  as_fn_error $? "conditional \"GL_GENERATE_ERRNO_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_FLOAT_H_TRUE}" && test -z "${GL_GENERATE_FLOAT_H_FALSE}"; then
+  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_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then
+  as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_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
+if test -z "${GL_GENERATE_SELINUX_CONTEXT_H_TRUE}" && test -z "${GL_GENERATE_SELINUX_CONTEXT_H_FALSE}"; then
+  as_fn_error $? "conditional \"GL_GENERATE_SELINUX_CONTEXT_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then
+  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.
+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
+
 
     gl_libobjs=
     gl_ltlibobjs=
@@ -32731,16 +36971,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -32800,28 +37040,16 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-       test -d "$1/.";
-      else
-       case $1 in #(
-       -*)set "./$1";;
-       esac;
-       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-       ???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -32842,8 +37070,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 augeas $as_me 0.10.0, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+This file was extended by augeas $as_me 1.3.0, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -32908,11 +37136,11 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-augeas config.status 0.10.0
-configured by $0, generated by GNU Autoconf 2.68,
+augeas config.status 1.3.0
+configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -33003,7 +37231,7 @@ fi
 _ACEOF
 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
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
@@ -33045,6 +37273,7 @@ pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
 enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
 SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
 ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
 host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
 host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
 host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
@@ -33127,7 +37356,6 @@ with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
 allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
 no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
 hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
 hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
 hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
 hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
@@ -33183,6 +37411,7 @@ _LTECHO_EOF'
 # Quote evaled strings.
 for var in SHELL \
 ECHO \
+PATH_SEPARATOR \
 SED \
 GREP \
 EGREP \
@@ -33233,7 +37462,6 @@ with_gnu_ld \
 allow_undefined_flag \
 no_undefined_flag \
 hardcode_libdir_flag_spec \
-hardcode_libdir_flag_spec_ld \
 hardcode_libdir_separator \
 exclude_expsyms \
 include_expsyms \
@@ -33924,7 +38152,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
 
   case $ac_file$ac_mode in
     "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # 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
@@ -33937,7 +38165,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
     # 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
+    # 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.
@@ -33971,21 +38199,19 @@ $as_echo X"$mf" |
       continue
     fi
     # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running `make'.
+    # 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
+    test -z "$am__include" && continue
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # When using ansi2knr, U may be empty or an underscore; expand it
-    U=`sed -n 's/^U = //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' -e 's/\$U/'"$U"'/g'`; do
+        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
       # Make sure the directory exists.
       test -f "$dirpart/$file" && continue
       fdir=`$as_dirname -- "$file" ||
@@ -34039,8 +38265,8 @@ $as_echo X"$file" |
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
 #
 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-#                 Inc.
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 #   This file is part of GNU Libtool.
@@ -34094,6 +38320,9 @@ SHELL=$lt_SHELL
 # An echo program that protects backslashes.
 ECHO=$lt_ECHO
 
+# The PATH separator for the build system.
+PATH_SEPARATOR=$lt_PATH_SEPARATOR
+
 # The host system.
 host_alias=$host_alias
 host=$host
@@ -34395,10 +38624,6 @@ no_undefined_flag=$lt_no_undefined_flag
 # This must work even if \$libdir does not exist
 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
 
-# If ld is used when linking, flag to hardcode \$libdir into a binary
-# during linking.  This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
-
 # Whether we need a single "-rpath" flag with a separated argument.
 hardcode_libdir_separator=$lt_hardcode_libdir_separator
 
index d08d841..08769e6 100644 (file)
@@ -1,6 +1,6 @@
-AC_INIT(augeas, 0.10.0)
+AC_INIT(augeas, 1.3.0)
 AC_CONFIG_SRCDIR([src/augeas.c])
-AC_CONFIG_AUX_DIR([build/aux])
+AC_CONFIG_AUX_DIR([build/ac-aux])
 AM_CONFIG_HEADER([config.h])
 AM_INIT_AUTOMAKE([-Wno-portability 1.11 color-tests parallel-tests])
 AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
@@ -65,8 +65,8 @@ if test x"$enable_debug" = x"yes"; then
 fi
 
 dnl Version info in libtool's notation
-AC_SUBST([LIBAUGEAS_VERSION_INFO], [15:0:15])
-AC_SUBST([LIBFA_VERSION_INFO], [4:5:3])
+AC_SUBST([LIBAUGEAS_VERSION_INFO], [19:0:19])
+AC_SUBST([LIBFA_VERSION_INFO], [5:0:4])
 
 AC_GNU_SOURCE
 
@@ -94,13 +94,16 @@ AC_SUBST(AUGEAS_CFLAGS)
 AUGEAS_CHECK_READLINE
 AC_CHECK_FUNCS([open_memstream uselocale])
 
-VERSION_SCRIPT_FLAGS=
-$(/usr/bin/ld --help 2>&1 | grep -- --version-script >/dev/null) && \
+AC_MSG_CHECKING([how to pass version script to the linker ($LD)])
+VERSION_SCRIPT_FLAGS=none
+if $LD --help 2>&1 | grep "version-script" >/dev/null 2>/dev/null; then
     VERSION_SCRIPT_FLAGS=-Wl,--version-script=
-test "`uname`" == "SunOS" && \
+elif $LD --help 2>&1 | grep "M mapfile" >/dev/null 2>/dev/null; then
     VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,"
+fi
+AC_MSG_RESULT([$VERSION_SCRIPT_FLAGS])
 AC_SUBST(VERSION_SCRIPT_FLAGS)
-AM_CONDITIONAL([USE_VERSION_SCRIPT], [test -n "$VERSION_SCRIPT_FLAGS"])
+AM_CONDITIONAL([USE_VERSION_SCRIPT], [test "$VERSION_SCRIPT_FLAGS" != none])
 
 gl_INIT
 
index 70dd818..6713485 100644 (file)
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in 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.
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -34,13 +78,14 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = doc
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/alloca.m4 \
        $(top_srcdir)/gnulib/m4/argz.m4 \
        $(top_srcdir)/gnulib/m4/btowc.m4 \
        $(top_srcdir)/gnulib/m4/canonicalize.m4 \
+       $(top_srcdir)/gnulib/m4/close.m4 \
        $(top_srcdir)/gnulib/m4/codeset.m4 \
        $(top_srcdir)/gnulib/m4/configmake.m4 \
        $(top_srcdir)/gnulib/m4/ctype.m4 \
@@ -49,24 +94,33 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/eealloc.m4 \
        $(top_srcdir)/gnulib/m4/environ.m4 \
        $(top_srcdir)/gnulib/m4/errno_h.m4 \
+       $(top_srcdir)/gnulib/m4/exponentd.m4 \
        $(top_srcdir)/gnulib/m4/extensions.m4 \
        $(top_srcdir)/gnulib/m4/fcntl-o.m4 \
        $(top_srcdir)/gnulib/m4/fcntl_h.m4 \
+       $(top_srcdir)/gnulib/m4/fdopen.m4 \
        $(top_srcdir)/gnulib/m4/float_h.m4 \
        $(top_srcdir)/gnulib/m4/fnmatch.m4 \
+       $(top_srcdir)/gnulib/m4/fpieee.m4 \
+       $(top_srcdir)/gnulib/m4/fstat.m4 \
+       $(top_srcdir)/gnulib/m4/getcwd.m4 \
        $(top_srcdir)/gnulib/m4/getdelim.m4 \
        $(top_srcdir)/gnulib/m4/getline.m4 \
        $(top_srcdir)/gnulib/m4/getopt.m4 \
        $(top_srcdir)/gnulib/m4/getpagesize.m4 \
+       $(top_srcdir)/gnulib/m4/gettimeofday.m4 \
        $(top_srcdir)/gnulib/m4/glibc21.m4 \
        $(top_srcdir)/gnulib/m4/gnulib-common.m4 \
        $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \
        $(top_srcdir)/gnulib/m4/include_next.m4 \
        $(top_srcdir)/gnulib/m4/intlmacosx.m4 \
        $(top_srcdir)/gnulib/m4/intmax_t.m4 \
+       $(top_srcdir)/gnulib/m4/inttypes-pri.m4 \
+       $(top_srcdir)/gnulib/m4/inttypes.m4 \
        $(top_srcdir)/gnulib/m4/inttypes_h.m4 \
        $(top_srcdir)/gnulib/m4/isblank.m4 \
        $(top_srcdir)/gnulib/m4/langinfo_h.m4 \
+       $(top_srcdir)/gnulib/m4/largefile.m4 \
        $(top_srcdir)/gnulib/m4/lcmessage.m4 \
        $(top_srcdir)/gnulib/m4/lib-ld.m4 \
        $(top_srcdir)/gnulib/m4/lib-link.m4 \
@@ -78,6 +132,7 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/locale-tr.m4 \
        $(top_srcdir)/gnulib/m4/locale-zh.m4 \
        $(top_srcdir)/gnulib/m4/locale_h.m4 \
+       $(top_srcdir)/gnulib/m4/localeconv.m4 \
        $(top_srcdir)/gnulib/m4/localename.m4 \
        $(top_srcdir)/gnulib/m4/lock.m4 \
        $(top_srcdir)/gnulib/m4/longlong.m4 \
@@ -95,15 +150,21 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/mbtowc.m4 \
        $(top_srcdir)/gnulib/m4/memchr.m4 \
        $(top_srcdir)/gnulib/m4/mempcpy.m4 \
+       $(top_srcdir)/gnulib/m4/mkstemp.m4 \
        $(top_srcdir)/gnulib/m4/mmap-anon.m4 \
        $(top_srcdir)/gnulib/m4/mode_t.m4 \
+       $(top_srcdir)/gnulib/m4/msvc-inval.m4 \
+       $(top_srcdir)/gnulib/m4/msvc-nothrow.m4 \
        $(top_srcdir)/gnulib/m4/multiarch.m4 \
        $(top_srcdir)/gnulib/m4/nl_langinfo.m4 \
+       $(top_srcdir)/gnulib/m4/nocrash.m4 \
+       $(top_srcdir)/gnulib/m4/off_t.m4 \
        $(top_srcdir)/gnulib/m4/onceonly.m4 \
        $(top_srcdir)/gnulib/m4/open.m4 \
        $(top_srcdir)/gnulib/m4/pathmax.m4 \
        $(top_srcdir)/gnulib/m4/printf.m4 \
        $(top_srcdir)/gnulib/m4/putenv.m4 \
+       $(top_srcdir)/gnulib/m4/rawmemchr.m4 \
        $(top_srcdir)/gnulib/m4/readlink.m4 \
        $(top_srcdir)/gnulib/m4/realloc.m4 \
        $(top_srcdir)/gnulib/m4/regex.m4 \
@@ -123,13 +184,18 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/stdlib_h.m4 \
        $(top_srcdir)/gnulib/m4/stpcpy.m4 \
        $(top_srcdir)/gnulib/m4/stpncpy.m4 \
+       $(top_srcdir)/gnulib/m4/strchrnul.m4 \
        $(top_srcdir)/gnulib/m4/string_h.m4 \
        $(top_srcdir)/gnulib/m4/strndup.m4 \
        $(top_srcdir)/gnulib/m4/strnlen.m4 \
        $(top_srcdir)/gnulib/m4/strstr.m4 \
        $(top_srcdir)/gnulib/m4/symlink.m4 \
+       $(top_srcdir)/gnulib/m4/sys_socket_h.m4 \
        $(top_srcdir)/gnulib/m4/sys_stat_h.m4 \
+       $(top_srcdir)/gnulib/m4/sys_time_h.m4 \
+       $(top_srcdir)/gnulib/m4/sys_types_h.m4 \
        $(top_srcdir)/gnulib/m4/sys_wait_h.m4 \
+       $(top_srcdir)/gnulib/m4/tempname.m4 \
        $(top_srcdir)/gnulib/m4/thread.m4 \
        $(top_srcdir)/gnulib/m4/threadlib.m4 \
        $(top_srcdir)/gnulib/m4/time_h.m4 \
@@ -153,21 +219,33 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_$(V))
-am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
-am__v_GEN_0 = @echo "  GEN   " $@;
-AM_V_at = $(am__v_at_$(V))
-am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
 am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-       html-recursive info-recursive install-data-recursive \
-       install-dvi-recursive install-exec-recursive \
-       install-html-recursive install-info-recursive \
-       install-pdf-recursive install-ps-recursive install-recursive \
-       installcheck-recursive installdirs-recursive pdf-recursive \
-       ps-recursive uninstall-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+       ctags-recursive dvi-recursive html-recursive info-recursive \
+       install-data-recursive install-dvi-recursive \
+       install-exec-recursive install-html-recursive \
+       install-info-recursive install-pdf-recursive \
+       install-ps-recursive install-recursive installcheck-recursive \
+       installdirs-recursive pdf-recursive ps-recursive \
+       tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -189,13 +267,39 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(vimdir)"
 DATA = $(nobase_vim_DATA)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
   distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-       $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
        distdir
+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
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
@@ -233,6 +337,7 @@ AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 AR = @AR@
+ARFLAGS = @ARFLAGS@
 ARGZ_H = @ARGZ_H@
 AUGEAS_CFLAGS = @AUGEAS_CFLAGS@
 AUTOCONF = @AUTOCONF@
@@ -276,9 +381,11 @@ GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
 GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
+GNULIB_CHDIR = @GNULIB_CHDIR@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
+GNULIB_DUP = @GNULIB_DUP@
 GNULIB_DUP2 = @GNULIB_DUP2@
 GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
@@ -290,16 +397,25 @@ 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_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FFSL = @GNULIB_FFSL@
+GNULIB_FFSLL = @GNULIB_FFSLL@
+GNULIB_FGETC = @GNULIB_FGETC@
+GNULIB_FGETS = @GNULIB_FGETS@
 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_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@
@@ -307,6 +423,8 @@ 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@
@@ -319,8 +437,14 @@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
 GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
+GNULIB_IMAXABS = @GNULIB_IMAXABS@
+GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
+GNULIB_ISATTY = @GNULIB_ISATTY@
 GNULIB_ISBLANK = @GNULIB_ISBLANK@
 GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
 GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
@@ -328,6 +452,7 @@ GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
 GNULIB_LINKAT = @GNULIB_LINKAT@
+GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
@@ -368,25 +493,31 @@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
 GNULIB_MKTIME = @GNULIB_MKTIME@
 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_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_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
 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_RANDOM = @GNULIB_RANDOM@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
 GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
+GNULIB_READ = @GNULIB_READ@
 GNULIB_READLINK = @GNULIB_READLINK@
 GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
@@ -396,12 +527,15 @@ GNULIB_RENAME = @GNULIB_RENAME@
 GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
 GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
+GNULIB_SCANF = @GNULIB_SCANF@
 GNULIB_SETENV = @GNULIB_SETENV@
+GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
 GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
 GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
 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@
@@ -419,9 +553,11 @@ 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@
@@ -431,7 +567,7 @@ GNULIB_TIME_R = @GNULIB_TIME_R@
 GNULIB_TMPFILE = @GNULIB_TMPFILE@
 GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
 GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
-GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
+GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
 GNULIB_UNLINK = @GNULIB_UNLINK@
 GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
@@ -443,8 +579,10 @@ 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@
@@ -493,6 +631,7 @@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
 HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
 HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
 HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
 HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
@@ -503,18 +642,23 @@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 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_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
 HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
 HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
@@ -530,7 +674,10 @@ HAVE_FCHDIR = @HAVE_FCHDIR@
 HAVE_FCHMODAT = @HAVE_FCHMODAT@
 HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
 HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
 HAVE_FSEEKO = @HAVE_FSEEKO@
 HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
@@ -544,7 +691,9 @@ HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
 HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
 HAVE_ISBLANK = @HAVE_ISBLANK@
 HAVE_ISWBLANK = @HAVE_ISWBLANK@
@@ -578,15 +727,21 @@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
 HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
 HAVE_MKSTEMP = @HAVE_MKSTEMP@
 HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
 HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OPENAT = @HAVE_OPENAT@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
 HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
 HAVE_PREAD = @HAVE_PREAD@
 HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
 HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_RANDOM = @HAVE_RANDOM@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
 HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -596,6 +751,7 @@ HAVE_REALPATH = @HAVE_REALPATH@
 HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
 HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
@@ -612,6 +768,7 @@ HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
 HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
 HAVE_SYMLINK = @HAVE_SYMLINK@
 HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
@@ -619,6 +776,7 @@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
 HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
 HAVE_TIMEGM = @HAVE_TIMEGM@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
@@ -660,6 +818,7 @@ HAVE_WCSXFRM = @HAVE_WCSXFRM@
 HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
 HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
 HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WMEMCHR = @HAVE_WMEMCHR@
 HAVE_WMEMCMP = @HAVE_WMEMCMP@
@@ -676,6 +835,8 @@ INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 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@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
@@ -721,6 +882,7 @@ 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_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
 NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
 NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H = @NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H@
@@ -730,6 +892,8 @@ 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_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_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@
@@ -740,6 +904,7 @@ 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_INTTYPES_H = @NEXT_INTTYPES_H@
 NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_LOCALE_H = @NEXT_LOCALE_H@
 NEXT_SELINUX_SELINUX_H = @NEXT_SELINUX_SELINUX_H@
@@ -749,6 +914,8 @@ NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
 NEXT_STRING_H = @NEXT_STRING_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_WAIT_H = @NEXT_SYS_WAIT_H@
 NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
@@ -775,6 +942,8 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 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@
@@ -791,6 +960,7 @@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
 REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
@@ -802,6 +972,7 @@ REPLACE_FSTAT = @REPLACE_FSTAT@
 REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
 REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
 REPLACE_GETDELIM = @REPLACE_GETDELIM@
@@ -810,11 +981,15 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISATTY = @REPLACE_ISATTY@
 REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ITOLD = @REPLACE_ITOLD@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
 REPLACE_LINK = @REPLACE_LINK@
 REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALECONV = @REPLACE_LOCALECONV@
 REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
@@ -843,8 +1018,11 @@ REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
 REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
 REPLACE_REALLOC = @REPLACE_REALLOC@
 REPLACE_REALPATH = @REPLACE_REALPATH@
@@ -858,9 +1036,11 @@ REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
 REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
 REPLACE_STPNCPY = @REPLACE_STPNCPY@
 REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
 REPLACE_STRDUP = @REPLACE_STRDUP@
 REPLACE_STRERROR = @REPLACE_STRERROR@
 REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
@@ -870,10 +1050,14 @@ REPLACE_STRNLEN = @REPLACE_STRNLEN@
 REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
 REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
 REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
+REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
 REPLACE_SYMLINK = @REPLACE_SYMLINK@
 REPLACE_TIMEGM = @REPLACE_TIMEGM@
 REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
 REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
 REPLACE_UNLINK = @REPLACE_UNLINK@
 REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
@@ -906,6 +1090,8 @@ STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+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_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
@@ -913,6 +1099,8 @@ VERSION = @VERSION@
 VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@
 WARN_CFLAGS = @WARN_CFLAGS@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 YACC = @YACC@
 YFLAGS = @YFLAGS@
@@ -1023,15 +1211,18 @@ clean-libtool:
        -rm -rf .libs _libs
 install-nobase_vimDATA: $(nobase_vim_DATA)
        @$(NORMAL_INSTALL)
-       test -z "$(vimdir)" || $(MKDIR_P) "$(DESTDIR)$(vimdir)"
        @list='$(nobase_vim_DATA)'; test -n "$(vimdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(vimdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(vimdir)" || exit 1; \
+       fi; \
        $(am__nobase_list) | while read dir files; do \
          xfiles=; for file in $$files; do \
            if test -f "$$file"; then xfiles="$$xfiles $$file"; \
            else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \
          test -z "$$xfiles" || { \
            test "x$$dir" = x. || { \
-             echo "$(MKDIR_P) '$(DESTDIR)$(vimdir)/$$dir'"; \
+             echo " $(MKDIR_P) '$(DESTDIR)$(vimdir)/$$dir'"; \
              $(MKDIR_P) "$(DESTDIR)$(vimdir)/$$dir"; }; \
            echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(vimdir)/$$dir'"; \
            $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(vimdir)/$$dir" || exit $$?; }; \
@@ -1041,27 +1232,28 @@ uninstall-nobase_vimDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(nobase_vim_DATA)'; test -n "$(vimdir)" || list=; \
        $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
-       test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(vimdir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(vimdir)" && rm -f $$files
+       dir='$(DESTDIR)$(vimdir)'; $(am__uninstall_files_from_dir)
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-       @fail= failcom='exit 1'; \
-       for f in x $$MAKEFLAGS; do \
-         case $$f in \
-           *=* | --[!k]*);; \
-           *k*) failcom='fail=yes';; \
-         esac; \
-       done; \
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+       @fail=; \
+       if $(am__make_keepgoing); then \
+         failcom='fail=yes'; \
+       else \
+         failcom='exit 1'; \
+       fi; \
        dot_seen=no; \
        target=`echo $@ | sed s/-recursive//`; \
-       list='$(SUBDIRS)'; for subdir in $$list; do \
+       case "$@" in \
+         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+         *) list='$(SUBDIRS)' ;; \
+       esac; \
+       for subdir in $$list; do \
          echo "Making $$target in $$subdir"; \
          if test "$$subdir" = "."; then \
            dot_seen=yes; \
@@ -1076,57 +1268,12 @@ $(RECURSIVE_TARGETS):
          $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
        fi; test -z "$$fail"
 
-$(RECURSIVE_CLEAN_TARGETS):
-       @fail= failcom='exit 1'; \
-       for f in x $$MAKEFLAGS; do \
-         case $$f in \
-           *=* | --[!k]*);; \
-           *k*) failcom='fail=yes';; \
-         esac; \
-       done; \
-       dot_seen=no; \
-       case "$@" in \
-         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-         *) list='$(SUBDIRS)' ;; \
-       esac; \
-       rev=''; for subdir in $$list; do \
-         if test "$$subdir" = "."; then :; else \
-           rev="$$subdir $$rev"; \
-         fi; \
-       done; \
-       rev="$$rev ."; \
-       target=`echo $@ | sed s/-recursive//`; \
-       for subdir in $$rev; do \
-         echo "Making $$target in $$subdir"; \
-         if test "$$subdir" = "."; then \
-           local_target="$$target-am"; \
-         else \
-           local_target="$$target"; \
-         fi; \
-         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-         || eval $$failcom; \
-       done && test -z "$$fail"
-tags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-       done
-ctags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-       done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
 
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
        if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -1142,12 +1289,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
          fi; \
        done; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -1159,15 +1301,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -1176,6 +1314,21 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
 
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -1212,13 +1365,10 @@ distdir: $(DISTFILES)
        done
        @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
          if test "$$subdir" = .; then :; else \
-           test -d "$(distdir)/$$subdir" \
-           || $(MKDIR_P) "$(distdir)/$$subdir" \
-           || exit 1; \
-         fi; \
-       done
-       @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-         if test "$$subdir" = .; then :; else \
+           $(am__make_dryrun) \
+             || test -d "$(distdir)/$$subdir" \
+             || $(MKDIR_P) "$(distdir)/$$subdir" \
+             || exit 1; \
            dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
            $(am__relativize); \
            new_distdir=$$reldir; \
@@ -1256,10 +1406,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
 mostlyclean-generic:
 
 clean-generic:
@@ -1337,23 +1492,21 @@ ps-am:
 
 uninstall-am: uninstall-nobase_vimDATA
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-       install-am install-strip tags-recursive
+.MAKE: $(am__recursive_targets) install-am install-strip
 
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-       all all-am all-local check check-am clean clean-generic \
-       clean-libtool clean-local ctags ctags-recursive distclean \
-       distclean-generic distclean-libtool 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-nobase_vimDATA 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 \
-       mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-       uninstall uninstall-am uninstall-nobase_vimDATA
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \
+       check check-am clean clean-generic clean-libtool clean-local \
+       cscopelist-am ctags ctags-am distclean distclean-generic \
+       distclean-libtool 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-nobase_vimDATA 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 mostlyclean-libtool pdf pdf-am ps ps-am \
+       tags tags-am uninstall uninstall-am uninstall-nobase_vimDATA
 
 
 all-local: $(PDFDOCS)
index 4559e43..c9fae11 100644 (file)
@@ -78,7 +78,7 @@ in a number of ways:
     ordered. In addition, several subtrees in such a list may use the same
     label. This makes it possible to accomodate concrete files where
     entries that are logically connected are stored scattered between
-    unrelated entries like hte {\tt AcceptEnv} entries in {\tt
+    unrelated entries like the {\tt AcceptEnv} entries in {\tt
       sshd\_config}.
 \end{itemize}
 
@@ -217,7 +217,7 @@ $C$ and transforms them to trees in $T$. Generally,
 
 \subsection{const}
 
-The $\lens{const} E\,t\,v$ maps words mathcing $E$ in the \nget direction
+The $\lens{const} E\,t\,v$ maps words matching $E$ in the \nget direction
 to a fixed tree $t$ and maps that fixed tree $t$ back in the \nput
 direction. When text needs to be created from $t$, it produces the default
 word $v$.
@@ -402,11 +402,11 @@ $\lput{(\conc{t_2}{t_1})}{\conc{c_1}{c_2}} =
 \conc{l.\lput{t_2}{c_2}}{l.\lput{t_1}{c_1}}$ This can only happen if the
 information to be reordered is in subtrees. In particular, comment lines
 need to become their own subtree, with some support from the language to
-create 'hidden' entries. Simplest: allow {\tt NULL} as the key for a
+create `hidden' entries. Simplest: allow {\tt NULL} as the key for a
 subtree and ignore such tree entries in the public API.
 
 Need to split a tree $t\in T$ into subtrees according to ?? Keeping a fake
-'slot' $\rhd$ around for text that didn't produce a tree should help with
+`slot' $\rhd$ around for text that didn't produce a tree should help with
 that.
 
 For $K^*$ to make any sense, must have $\rhd\in K$ and the application of
@@ -417,7 +417,7 @@ $(l^*).\nparse$ must return $\rhd$ for all except at most one application.
 For type checking, we need to compute the following properties of regular
 languages $R, R_1, R_2$
 \begin{itemize}
-\item decide unamibuguous concatenation $\uaconc{R_1}{R_2}$ and compute
+\item decide unambiguous concatenation $\uaconc{R_1}{R_2}$ and compute
   $\conc{R_1}{R_2}$
 \item decide unambiguous iteration $\uastar{R}$ and compute $R^*$
 \item disjointness $R_1 \cap R_2 = \emptyset$ (we don't need general
index 9213cb8..d82095b 100644 (file)
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in 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.
 
 @SET_MAKE@
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -33,13 +77,14 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = doc/naturaldocs
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/alloca.m4 \
        $(top_srcdir)/gnulib/m4/argz.m4 \
        $(top_srcdir)/gnulib/m4/btowc.m4 \
        $(top_srcdir)/gnulib/m4/canonicalize.m4 \
+       $(top_srcdir)/gnulib/m4/close.m4 \
        $(top_srcdir)/gnulib/m4/codeset.m4 \
        $(top_srcdir)/gnulib/m4/configmake.m4 \
        $(top_srcdir)/gnulib/m4/ctype.m4 \
@@ -48,24 +93,33 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/eealloc.m4 \
        $(top_srcdir)/gnulib/m4/environ.m4 \
        $(top_srcdir)/gnulib/m4/errno_h.m4 \
+       $(top_srcdir)/gnulib/m4/exponentd.m4 \
        $(top_srcdir)/gnulib/m4/extensions.m4 \
        $(top_srcdir)/gnulib/m4/fcntl-o.m4 \
        $(top_srcdir)/gnulib/m4/fcntl_h.m4 \
+       $(top_srcdir)/gnulib/m4/fdopen.m4 \
        $(top_srcdir)/gnulib/m4/float_h.m4 \
        $(top_srcdir)/gnulib/m4/fnmatch.m4 \
+       $(top_srcdir)/gnulib/m4/fpieee.m4 \
+       $(top_srcdir)/gnulib/m4/fstat.m4 \
+       $(top_srcdir)/gnulib/m4/getcwd.m4 \
        $(top_srcdir)/gnulib/m4/getdelim.m4 \
        $(top_srcdir)/gnulib/m4/getline.m4 \
        $(top_srcdir)/gnulib/m4/getopt.m4 \
        $(top_srcdir)/gnulib/m4/getpagesize.m4 \
+       $(top_srcdir)/gnulib/m4/gettimeofday.m4 \
        $(top_srcdir)/gnulib/m4/glibc21.m4 \
        $(top_srcdir)/gnulib/m4/gnulib-common.m4 \
        $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \
        $(top_srcdir)/gnulib/m4/include_next.m4 \
        $(top_srcdir)/gnulib/m4/intlmacosx.m4 \
        $(top_srcdir)/gnulib/m4/intmax_t.m4 \
+       $(top_srcdir)/gnulib/m4/inttypes-pri.m4 \
+       $(top_srcdir)/gnulib/m4/inttypes.m4 \
        $(top_srcdir)/gnulib/m4/inttypes_h.m4 \
        $(top_srcdir)/gnulib/m4/isblank.m4 \
        $(top_srcdir)/gnulib/m4/langinfo_h.m4 \
+       $(top_srcdir)/gnulib/m4/largefile.m4 \
        $(top_srcdir)/gnulib/m4/lcmessage.m4 \
        $(top_srcdir)/gnulib/m4/lib-ld.m4 \
        $(top_srcdir)/gnulib/m4/lib-link.m4 \
@@ -77,6 +131,7 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/locale-tr.m4 \
        $(top_srcdir)/gnulib/m4/locale-zh.m4 \
        $(top_srcdir)/gnulib/m4/locale_h.m4 \
+       $(top_srcdir)/gnulib/m4/localeconv.m4 \
        $(top_srcdir)/gnulib/m4/localename.m4 \
        $(top_srcdir)/gnulib/m4/lock.m4 \
        $(top_srcdir)/gnulib/m4/longlong.m4 \
@@ -94,15 +149,21 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/mbtowc.m4 \
        $(top_srcdir)/gnulib/m4/memchr.m4 \
        $(top_srcdir)/gnulib/m4/mempcpy.m4 \
+       $(top_srcdir)/gnulib/m4/mkstemp.m4 \
        $(top_srcdir)/gnulib/m4/mmap-anon.m4 \
        $(top_srcdir)/gnulib/m4/mode_t.m4 \
+       $(top_srcdir)/gnulib/m4/msvc-inval.m4 \
+       $(top_srcdir)/gnulib/m4/msvc-nothrow.m4 \
        $(top_srcdir)/gnulib/m4/multiarch.m4 \
        $(top_srcdir)/gnulib/m4/nl_langinfo.m4 \
+       $(top_srcdir)/gnulib/m4/nocrash.m4 \
+       $(top_srcdir)/gnulib/m4/off_t.m4 \
        $(top_srcdir)/gnulib/m4/onceonly.m4 \
        $(top_srcdir)/gnulib/m4/open.m4 \
        $(top_srcdir)/gnulib/m4/pathmax.m4 \
        $(top_srcdir)/gnulib/m4/printf.m4 \
        $(top_srcdir)/gnulib/m4/putenv.m4 \
+       $(top_srcdir)/gnulib/m4/rawmemchr.m4 \
        $(top_srcdir)/gnulib/m4/readlink.m4 \
        $(top_srcdir)/gnulib/m4/realloc.m4 \
        $(top_srcdir)/gnulib/m4/regex.m4 \
@@ -122,13 +183,18 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/stdlib_h.m4 \
        $(top_srcdir)/gnulib/m4/stpcpy.m4 \
        $(top_srcdir)/gnulib/m4/stpncpy.m4 \
+       $(top_srcdir)/gnulib/m4/strchrnul.m4 \
        $(top_srcdir)/gnulib/m4/string_h.m4 \
        $(top_srcdir)/gnulib/m4/strndup.m4 \
        $(top_srcdir)/gnulib/m4/strnlen.m4 \
        $(top_srcdir)/gnulib/m4/strstr.m4 \
        $(top_srcdir)/gnulib/m4/symlink.m4 \
+       $(top_srcdir)/gnulib/m4/sys_socket_h.m4 \
        $(top_srcdir)/gnulib/m4/sys_stat_h.m4 \
+       $(top_srcdir)/gnulib/m4/sys_time_h.m4 \
+       $(top_srcdir)/gnulib/m4/sys_types_h.m4 \
        $(top_srcdir)/gnulib/m4/sys_wait_h.m4 \
+       $(top_srcdir)/gnulib/m4/tempname.m4 \
        $(top_srcdir)/gnulib/m4/thread.m4 \
        $(top_srcdir)/gnulib/m4/threadlib.m4 \
        $(top_srcdir)/gnulib/m4/time_h.m4 \
@@ -152,14 +218,26 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_$(V))
-am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
-am__v_GEN_0 = @echo "  GEN   " $@;
-AM_V_at = $(am__v_at_$(V))
-am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
 am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_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)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 pkglibexecdir = @pkglibexecdir@
 ACLOCAL = @ACLOCAL@
@@ -169,6 +247,7 @@ AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 AR = @AR@
+ARFLAGS = @ARFLAGS@
 ARGZ_H = @ARGZ_H@
 AUGEAS_CFLAGS = @AUGEAS_CFLAGS@
 AUTOCONF = @AUTOCONF@
@@ -212,9 +291,11 @@ GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
 GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
+GNULIB_CHDIR = @GNULIB_CHDIR@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
+GNULIB_DUP = @GNULIB_DUP@
 GNULIB_DUP2 = @GNULIB_DUP2@
 GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
@@ -226,16 +307,25 @@ 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_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FFSL = @GNULIB_FFSL@
+GNULIB_FFSLL = @GNULIB_FFSLL@
+GNULIB_FGETC = @GNULIB_FGETC@
+GNULIB_FGETS = @GNULIB_FGETS@
 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_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@
@@ -243,6 +333,8 @@ 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@
@@ -255,8 +347,14 @@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
 GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
+GNULIB_IMAXABS = @GNULIB_IMAXABS@
+GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
+GNULIB_ISATTY = @GNULIB_ISATTY@
 GNULIB_ISBLANK = @GNULIB_ISBLANK@
 GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
 GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
@@ -264,6 +362,7 @@ GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
 GNULIB_LINKAT = @GNULIB_LINKAT@
+GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
@@ -304,25 +403,31 @@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
 GNULIB_MKTIME = @GNULIB_MKTIME@
 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_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_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
 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_RANDOM = @GNULIB_RANDOM@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
 GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
+GNULIB_READ = @GNULIB_READ@
 GNULIB_READLINK = @GNULIB_READLINK@
 GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
@@ -332,12 +437,15 @@ GNULIB_RENAME = @GNULIB_RENAME@
 GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
 GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
+GNULIB_SCANF = @GNULIB_SCANF@
 GNULIB_SETENV = @GNULIB_SETENV@
+GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
 GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
 GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
 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@
@@ -355,9 +463,11 @@ 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@
@@ -367,7 +477,7 @@ GNULIB_TIME_R = @GNULIB_TIME_R@
 GNULIB_TMPFILE = @GNULIB_TMPFILE@
 GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
 GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
-GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
+GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
 GNULIB_UNLINK = @GNULIB_UNLINK@
 GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
@@ -379,8 +489,10 @@ 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@
@@ -429,6 +541,7 @@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
 HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
 HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
 HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
 HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
@@ -439,18 +552,23 @@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 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_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
 HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
 HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
@@ -466,7 +584,10 @@ HAVE_FCHDIR = @HAVE_FCHDIR@
 HAVE_FCHMODAT = @HAVE_FCHMODAT@
 HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
 HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
 HAVE_FSEEKO = @HAVE_FSEEKO@
 HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
@@ -480,7 +601,9 @@ HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
 HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
 HAVE_ISBLANK = @HAVE_ISBLANK@
 HAVE_ISWBLANK = @HAVE_ISWBLANK@
@@ -514,15 +637,21 @@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
 HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
 HAVE_MKSTEMP = @HAVE_MKSTEMP@
 HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
 HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OPENAT = @HAVE_OPENAT@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
 HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
 HAVE_PREAD = @HAVE_PREAD@
 HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
 HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_RANDOM = @HAVE_RANDOM@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
 HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -532,6 +661,7 @@ HAVE_REALPATH = @HAVE_REALPATH@
 HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
 HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
@@ -548,6 +678,7 @@ HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
 HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
 HAVE_SYMLINK = @HAVE_SYMLINK@
 HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
@@ -555,6 +686,7 @@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
 HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
 HAVE_TIMEGM = @HAVE_TIMEGM@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
@@ -596,6 +728,7 @@ HAVE_WCSXFRM = @HAVE_WCSXFRM@
 HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
 HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
 HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WMEMCHR = @HAVE_WMEMCHR@
 HAVE_WMEMCMP = @HAVE_WMEMCMP@
@@ -612,6 +745,8 @@ INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 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@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
@@ -657,6 +792,7 @@ 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_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
 NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
 NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H = @NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H@
@@ -666,6 +802,8 @@ 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_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_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@
@@ -676,6 +814,7 @@ 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_INTTYPES_H = @NEXT_INTTYPES_H@
 NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_LOCALE_H = @NEXT_LOCALE_H@
 NEXT_SELINUX_SELINUX_H = @NEXT_SELINUX_SELINUX_H@
@@ -685,6 +824,8 @@ NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
 NEXT_STRING_H = @NEXT_STRING_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_WAIT_H = @NEXT_SYS_WAIT_H@
 NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
@@ -711,6 +852,8 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 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@
@@ -727,6 +870,7 @@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
 REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
@@ -738,6 +882,7 @@ REPLACE_FSTAT = @REPLACE_FSTAT@
 REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
 REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
 REPLACE_GETDELIM = @REPLACE_GETDELIM@
@@ -746,11 +891,15 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISATTY = @REPLACE_ISATTY@
 REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ITOLD = @REPLACE_ITOLD@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
 REPLACE_LINK = @REPLACE_LINK@
 REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALECONV = @REPLACE_LOCALECONV@
 REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
@@ -779,8 +928,11 @@ REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
 REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
 REPLACE_REALLOC = @REPLACE_REALLOC@
 REPLACE_REALPATH = @REPLACE_REALPATH@
@@ -794,9 +946,11 @@ REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
 REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
 REPLACE_STPNCPY = @REPLACE_STPNCPY@
 REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
 REPLACE_STRDUP = @REPLACE_STRDUP@
 REPLACE_STRERROR = @REPLACE_STRERROR@
 REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
@@ -806,10 +960,14 @@ REPLACE_STRNLEN = @REPLACE_STRNLEN@
 REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
 REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
 REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
+REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
 REPLACE_SYMLINK = @REPLACE_SYMLINK@
 REPLACE_TIMEGM = @REPLACE_TIMEGM@
 REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
 REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
 REPLACE_UNLINK = @REPLACE_UNLINK@
 REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
@@ -842,6 +1000,8 @@ STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+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_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
@@ -849,6 +1009,8 @@ VERSION = @VERSION@
 VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@
 WARN_CFLAGS = @WARN_CFLAGS@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 YACC = @YACC@
 YFLAGS = @YFLAGS@
@@ -959,11 +1121,11 @@ mostlyclean-libtool:
 
 clean-libtool:
        -rm -rf .libs _libs
-tags: TAGS
-TAGS:
+tags TAGS:
+
+ctags CTAGS:
 
-ctags: CTAGS
-CTAGS:
+cscope cscopelist:
 
 
 distdir: $(DISTFILES)
@@ -1011,10 +1173,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
 mostlyclean-generic:
 
 clean-generic:
@@ -1095,16 +1262,17 @@ uninstall-am:
 .MAKE: install-am install-strip
 
 .PHONY: all all-am all-local check check-am clean clean-generic \
-       clean-libtool clean-local distclean distclean-generic \
-       distclean-libtool 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 \
-       maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-       uninstall uninstall-am
+       clean-libtool clean-local cscopelist-am ctags-am distclean \
+       distclean-generic distclean-libtool 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 maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-generic \
+       mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
+       uninstall-am
 
 
 @ND_ENABLED_TRUE@all-local: NaturalDocs
index afe0596..f56a34d 100644 (file)
@@ -47,8 +47,8 @@ SubTitle: C API
 
 Group: Main Links  {
 
-   Link: Main  (http://augeas.net)
-   Link: Documentation  (http://augeas.net/doc)
+   Link: Main  (/index.html)
+   Link: Documentation  (/docs/index.html)
    }  # Group: Main Links
 
 File: Public API  (no auto-title, augeas.h)
index 3616389..17ec75b 100644 (file)
@@ -54,60 +54,140 @@ Group: Main Site  {
 Group: Specific Modules  {
 
    File: Access  (access.aug)
+   File: ActiveMQ_Conf  (activemq_conf.aug)
+   File: ActiveMQ_XML  (activemq_xml.aug)
    File: Aliases  (aliases.aug)
-   File: Approx (approx.aug)
+   File: Anacron  (anacron.aug)
+   File: Approx  (approx.aug)
+   File: Apt_Update_Manager  (apt_update_manager.aug)
+   File: AptCacherNGSecurity  (aptcacherngsecurity.aug)
    File: AptConf  (aptconf.aug)
+   File: AptPreferences  (aptpreferences.aug)
+   File: Aptsources  (aptsources.aug)
+   File: Authorized_Keys  (authorized_keys.aug)
+   File: Automaster  (automaster.aug)
+   File: Automounter  (automounter.aug)
+   File: Avahi  (avahi.aug)
    File: BackupPCHosts  (backuppchosts.aug)
+   File: BootConf  (bootconf.aug)
+   File: Cachefilesd  (cachefilesd.aug)
+   File: Carbon  (carbon.aug)
    File: Cgconfig  (no auto-title, cgconfig.aug)
    File: Cgrules  (no auto-title, cgrules.aug)
+   File: Channels  (channels.aug)
+   File: Chrony  (chrony.aug)
+   File: Collectd  (collectd.aug)
+   File: CPanel  (cpanel.aug)
    File: Cron  (cron.aug)
-   File: crypttab.aug  (crypttab.aug)
+   File: Crypttab  (crypttab.aug)
+   File: Cups  (cups.aug)
    File: Debctrl  (no auto-title, debctrl.aug)
    File: Desktop  (desktop.aug)
    File: Dhcpd  (dhcpd.aug)
+   File: Dovecot  (dovecot.aug)
    File: Dpkg  (dpkg.aug)
    File: Exports  (exports.aug)
    File: FAI_DiskConfig  (fai_diskconfig.aug)
+   File: Fonts  (fonts.aug)
+   File: Fuse  (fuse.aug)
+   File: Gshadow  (gshadow.aug)
    File: Grub  (grub.aug)
+   File: GtkBookmarks  (gtkbookmarks.aug)
+   File: Host_Conf  (host_conf.aug)
    File: Hostname  (hostname.aug)
    File: Hosts_Access  (hosts_access.aug)
-   File: Host_Conf  (host_conf.aug)
+   File: Htpasswd  (htpasswd.aug)
+   File: Inputrc  (inputrc.aug)
+   File: JettyRealm  (jettyrealm.aug)
+   File: JMXAccess  (jmxaccess.aug)
+   File: JMXPassword  (jmxpassword.aug)
    File: Iptables  (iptables.aug)
    File: Kdump  (kdump.aug)
    File: Keepalived  (keepalived.aug)
+   File: Known_Hosts  (known_hosts.aug)
+   File: Koji  (koji.aug)
+   File: Ldif  (ldif.aug)
+   File: Ldso  (no auto-title, ldso.aug)
+   File: Lightdm  (lightdm.aug)
    File: Login_defs  (login_defs.aug)
    File: Lokkit  (lokkit.aug)
+   File: LVM  (lvm.aug)
+   File: MCollective  (mcollective.aug)
+   File: Memcached  (memcached.aug)
    File: Mke2fs  (mke2fs.aug)
    File: Modprobe  (modprobe.aug)
+   File: MongoDBServer  (mongodbserver.aug)
    File: Modules  (modules.aug)
    File: Modules_conf  (modules_conf.aug)
    File: NagiosCfg  (no auto-title, nagioscfg.aug)
    File: NagiosObjects  (nagiosobjects.aug)
+   File: Netmasks  (netmasks.aug)
+   File: NetworkManager  (networkmanager.aug)
    File: Networks  (networks.aug)
+   File: Nginx  (nginx.aug)
    File: Nrpe  (nrpe.aug)
    File: Nsswitch  (nsswitch.aug)
+   File: Ntpd  (ntpd.aug)
+   File: OpenShift_Config  (openshift_config.aug)
+   File: OpenShift_Http  (openshift_http.aug)
+   File: OpenShift_Quickstarts  (openshift_quickstarts.aug)
+   File: Pagekite (pagekite.aug)
+   File: Pam  (pam.aug)
+   File: PamConf  (pamconf.aug)
+   File: Passwd  (passwd.aug)
    File: Pbuilder  (pbuilder.aug)
    File: Pg_Hba  (pg_hba.aug)
+   File: Postfix_Transport  (postfix_transport.aug)
+   File: Postfix_Virtual  (postfix_virtual.aug)
+   File: Postgresql  (postgresql.aug)
+   File: Protocols  (protocols.aug)
    File: PuppetFileserver  (no auto-title, puppetfileserver.aug)
+   File: Puppet_Auth  (no auto-title, puppet_auth.aug)
+   File: Qpid  (qpid.aug)
+   File: Rabbitmq  (rabbitmq.aug)
+   File: Redis  (redis.aug)
    File: Reprepro_Uploaders  (reprepro_uploaders.aug)
    File: Resolv  (resolv.aug)
+   File: Rmt  (rmt.aug)
+   File: Rsyslog  (rsyslog.aug)
    File: Schroot  (schroot.aug)
    File: Services  (services.aug)
+   File: Shadow  (shadow.aug)
    File: Shells  (shells.aug)
+   File: Shellvars  (shellvars.aug)
+   File: Simplelines  (simplelines.aug)
+   File: Simplevars  (simplevars.aug)
+   File: Sip_Conf  (sip_conf.aug)
+   File: SmbUsers  (smbusers.aug)
+   File: Splunk  (splunk.aug)
    File: Solaris_System  (solaris_system.aug)
    File: Ssh  (ssh.aug)
    File: Sshd  (sshd.aug)
+   File: Sssd  (no auto-title, sssd.aug)
+   File: Subversion  (subversion.aug)
    File: Sudoers  (sudoers.aug)
+   File: Sysconfig_Route  (sysconfig_route.aug)
+   File: Sysctl  (sysctl.aug)
    File: Syslog  (syslog.aug)
+   File: Systemd  (systemd.aug)
+   File: Thttpd  (thttpd.aug)
+   File: Tuned  (tuned.aug)
+   File: Up2date  (up2date.aug)
+   File: UpdateDB  (updatedb.aug)
+   File: VWware_Config  (vmware_config.aug)
+   File: Vfstab  (vfstab.aug)
    File: Xinetd  (xinetd.aug)
+   File: Xymon  (xymon.aug)
+   File: XymonAlerting (xymonalerting.aug)
    File: Xorg  (xorg.aug)
-   File: Shellvars  (shellvars.aug)
    }  # Group: Specific Modules
 
 Group: Generic Modules  {
 
    File: Build  (build.aug)
+   File: Erlang  (erlang.aug)
    File: IniFile  (inifile.aug)
+   File: Quote  (quote.aug)
    File: Rx  (rx.aug)
    File: Sep  (sep.aug)
    File: Util  (util.aug)
@@ -116,14 +196,83 @@ Group: Generic Modules  {
 Group: Tests and Examples  {
 
    File: Test_Access  (tests/test_access.aug)
-   File: Test_Approx  (tests/test_approx.aug)
+   File: Test_ActiveMQ_Conf  (tests/test_activemq_conf.aug)
+   File: Test_ActiveMQ_XML  (tests/test_activemq_xml.aug)
    File: Test_Aliases  (tests/test_aliases.aug)
-   File: Test_Reprepro_Uploaders  (tests/test_reprepro_uploaders.aug)
-   File: Test_FAI_DiskConfig  (tests/test_faidiskconfig.aug)
+   File: Test_Anacron  (tests/test_anacron.aug)
+   File: Test_Approx  (tests/test_approx.aug)
+   File: Test_Apt_Update_Manager  (tests/test_apt_update_manager.aug)
+   File: Test_Authorized_Keys  (tests/test_authorized_keys.aug)
+   File: Test_BootConf  (tests/test_bootconf.aug)
+   File: Test_Build  (tests/test_build.aug)
+   File: Test_Carbon  (tests/test_carbon.aug)
+   File: Test_Channels  (tests/test_channels.aug)
+   File: Test_Chrony  (tests/test_chrony.aug)
+   File: Test_Collectd  (tests/test_collectd.aug)
+   File: Test_CPanel  (tests/test_cpanel.aug)
+   File: Test_Cups  (tests/test_cups.aug)
+   File: Test_Dovecot  (tests/test_dovecot.aug)
+   File: Test_Erlang  (tests/test_erlang.aug)
+   File: Test_FAI_DiskConfig  (tests/test_fai_diskconfig.aug)
+   File: Test_Fonts  (tests/test_fonts.aug)
+   File: Test_Fuse  (tests/test_fuse.aug)
+   File: Test_GtkBookmarks  (tests/test_gtkbookmarks.aug)
+   File: Test_Htpasswd  (tests/test_htpasswd.aug)
    File: Test_IniFile  (tests/test_inifile.aug)
+   File: Test_Inputrc  (tests/test_inputrc.aug)
+   File: Test_JettyRealm  (tests/test_jettyrealm.aug)
+   File: Test_JMXAccess  (tests/test_jmxaccess.aug)
+   File: Test_JMXPassword  (tests/test_jmxpassword.aug)
+   File: Test_Kdump  (tests/test_kdump.aug)
    File: Test_Keepalived  (tests/test_keepalived.aug)
-   File: Test_login_defs  (tests/test_login_defs.aug)
+   File: Test_Known_Hosts  (tests/test_known_hosts.aug)
+   File: Test_Koji  (tests/test_koji.aug)
+   File: Test_Ldso  (tests/test_ldso.aug)
+   File: Test_Lightdm  (tests/test_lightdm.aug)
+   File: Test_LVM  (tests/test_lvm.aug)
+   File: Test_MCollective  (tests/test_mcollective.aug)
+   File: Test_Memcached  (tests/test_memcached.aug)
+   File: Test_MongoDBServer  (tests/test_mongodbserver.aug)
+   File: Test_NagiosCfg  (tests/test_nagioscfg.aug)
+   File: Test_NetworkManager  (tests/test_networkmanager.aug)
+   File: Test_Nginx  (tests/test_nginx.aug)
+   File: Test_Ntpd  (tests/test_ntpd.aug)
+   File: Test_OpenShift_Config  (tests/test_openshift_config.aug)
+   File: Test_OpenShift_Http  (tests/test_openshift_http.aug)
+   File: Test_OpenShift_Quickstarts  (tests/test_openshift_quickstarts.aug)
+   File: Test_Postfix_Transport  (tests/test_postfix_transport.aug)
+   File: Test_Postfix_Virtual  (tests/test_postfix_virtual.aug)
+   File: Test_Postgresql  (tests/test_postgresql.aug)
+   File: Test_Protocols  (tests/test_protocols.aug)
+   File: Test_Puppet_Auth  (tests/test_puppet_auth.aug)
+   File: Test_Qpid  (tests/test_qpid.aug)
+   File: Test_Quote  (tests/test_quote.aug)
+   File: Test_Rabbitmq  (tests/test_rabbitmq.aug)
+   File: Test_Redis  (tests/test_redis.aug)
+   File: Test_Reprepro_Uploaders  (tests/test_reprepro_uploaders.aug)
+   File: Test_Rmt  (tests/test_rmt.aug)
+   File: Test_Rsyslog  (tests/test_rsyslog.aug)
+   File: Test_Simplelines  (tests/test_simplelines.aug)
+   File: Test_Simplevars  (tests/test_simplevars.aug)
+   File: Test_SmbUsers  (tests/test_smbusers.aug)
+   File: Test_Subversion  (tests/test_subversion.aug)
+   File: Test_Sysconfig_Route  (tests/test_sysconfig_route.aug)
+   File: Test_Sysctl  (tests/test_sysctl.aug)
+   File: Test_Systemd  (tests/test_systemd.aug)
+   File: Test_Thttpd  (tests/test_thttpd.aug)
+   File: Test_Tuned  (tests/test_tuned.aug)
+   File: Test_Up2date  (tests/test_up2date.aug)
+   File: Test_UpdateDB  (tests/test_updatedb.aug)
+   File: Test_VMware_Config  (tests/test_vmware_config.aug)
    File: Test_Xml  (tests/test_xml.aug)
+   File: Test_Xymon  (tests/test_xymon.aug)
+   File: Test_XymonAlerting  (tests/test_xymonalerting.aug)
+   File: Test_Yum  (tests/test_yum.aug)
+   File: Test_login_defs  (tests/test_login_defs.aug)
+   File: Test_sssd  (tests/test_sssd.aug)
+   File: Test_sudoers  (no auto-title, tests/test_sudoers.aug)
+   File: Test_ssh  (tests/test_ssh.aug)
+   File: Test_sshd  (tests/test_sshd.aug)
    }  # Group: Tests and Examples
 
 Group: Index  {
diff --git a/doc/naturaldocs/conf/lenses/Menu_Backup.txt b/doc/naturaldocs/conf/lenses/Menu_Backup.txt
new file mode 100644 (file)
index 0000000..9782647
--- /dev/null
@@ -0,0 +1,153 @@
+Format: 1.4
+
+
+Title: Augeas Documentation
+SubTitle: Modules
+
+# You can add a footer to your documentation like this:
+# Footer: [text]
+# If you want to add a copyright notice, this would be the place to do it.
+
+# You can add a timestamp to your documentation like one of these:
+# Timestamp: Generated on month day, year
+# Timestamp: Updated mm/dd/yyyy
+# Timestamp: Last updated mon day
+#
+#   m     - One or two digit month.  January is "1"
+#   mm    - Always two digit month.  January is "01"
+#   mon   - Short month word.  January is "Jan"
+#   month - Long month word.  January is "January"
+#   d     - One or two digit day.  1 is "1"
+#   dd    - Always two digit day.  1 is "01"
+#   day   - Day with letter extension.  1 is "1st"
+#   yy    - Two digit year.  2006 is "06"
+#   yyyy  - Four digit year.  2006 is "2006"
+#   year  - Four digit year.  2006 is "2006"
+
+
+# --------------------------------------------------------------------------
+# 
+# Cut and paste the lines below to change the order in which your files
+# appear on the menu.  Don't worry about adding or removing files, Natural
+# Docs will take care of that.
+# 
+# You can further organize the menu by grouping the entries.  Add a
+# "Group: [name] {" line to start a group, and add a "}" to end it.
+# 
+# You can add text and web links to the menu by adding "Text: [text]" and
+# "Link: [name] ([URL])" lines, respectively.
+# 
+# The formatting and comments are auto-generated, so don't worry about
+# neatness when editing the file.  Natural Docs will clean it up the next
+# time it is run.  When working with groups, just deal with the braces and
+# forget about the indentation and comments.
+# 
+# --------------------------------------------------------------------------
+
+
+Group: Main Site  {
+
+   Link: Main  (/index.html)
+   Link: Documentation  (/docs/index.html)
+   }  # Group: Main Site
+
+Group: Specific Modules  {
+
+   File: Aliases (aliases.aug)
+   File: Approx (approx.aug)
+   File: AptPreferences (aptpreferences.aug)
+   File: Aptsources (aptsources.aug)
+   File: BBhosts (bbhosts.aug)
+   File: Cgconfig  (cgconfig.aug)
+   File: Cgrules  (cgrules.aug)
+   File: CobblerModules (cobblermodules.aug)
+   File: CobblerSettings (cobblersettings.aug)
+   File: Cron  (cron.aug)
+   File: Darkice (darkice.aug)
+   File: Debctrl  (debctrl.aug)
+   File: Device_map (device_map.aug)
+   File: Dhclient (dhclient.aug)
+   File: Dnsmasq (dnsmasq.aug)
+   File: Dpkg  (dpkg.aug)
+   File: Dput (dput.aug)
+   File: Ethers (ethers.aug)
+   File: Exports  (exports.aug)
+   File: Fstab (fstab.aug)
+   File: Gdm (gdm.aug)
+   File: Group (group.aug)
+   File: Grub (grub.aug)
+   File: Inetd (inetd.aug)
+   File: Inittab (inittab.aug)
+   File: Interfaces (interfaces.aug)
+   File: Iptables  (iptables.aug)
+   File: Json (json.aug)
+   File: Keepalived (keepalived.aug)
+   File: Krb5 (krb5.aug)
+   File: Limits (limits.aug)
+   File: Login_defs (login_defs.aug)
+   File: Logrotate (logrotate.aug)
+   File: Lokkit  (lokkit.aug)
+   File: Mke2fs (mke2fs.aug)
+   File: Modprobe  (modprobe.aug)
+   File: Modules_conf  (modules_conf.aug)
+   File: Monit (monit.aug)
+   File: Multipath (multipath.aug)
+   File: MySQL (mysql.aug)
+   File: NagiosCfg (nagioscfg.aug)
+   File: Nrpe  (nrpe.aug)
+   File: Nsswitch (nsswitch.aug)
+   File: Ntp (ntp.aug)
+   File: Odbc (odbc.aug)
+   File: OpenVPN (openvpn.aug)
+   File: Pam (pam.aug)
+   File: Passwd (passwd.aug)
+   File: Pbuilder  (pbuilder.aug)
+   File: Pg_Hba  (pg_hba.aug)
+   File: PHP (php.aug)
+   File: Phpvars (phpvars.aug)
+   File: Postfix_Access (postfix_access.aug)
+   File: Postfix_Main (postfix_main.aug)
+   File: Postfix_Master (postfix_master.aug)
+   File: Puppet (puppet.aug)
+   File: Resolv (resolv.aug)
+   File: Rsyncd (rsyncd.aug)
+   File: Samba (samba.aug)
+   File: Securetty (securetty.aug)
+   File: Services  (services.aug)
+   File: Shells (shells.aug)
+   File: Shellvars_list (shellvars_list.aug)
+   File: Shellvars (shellvars.aug)
+   File: Slapd (slapd.aug)
+   File: Soma (soma.aug)
+   File: Spacevars (spacevars.aug)
+   File: Squid (squid.aug)
+   File: Sshd  (sshd.aug)
+   File: Sudoers  (sudoers.aug)
+   File: Sysconfig (sysconfig.aug)
+   File: Sysctl (sysctl.aug)
+   File: Syslog (syslog.aug)
+   File: Vsftpd (vsftpd.aug)
+   File: Webmin (webmin.aug)
+   File: Wine (wine.aug)
+   File: Xinetd  (xinetd.aug)
+   File: Xorg  (xorg.aug)
+   File: Yum (yum.aug)
+   }  # Group: Specific Modules
+
+Group: Generic Modules  {
+
+   File: Build  (build.aug)
+   File: IniFile  (inifile.aug)
+   File: Rx  (rx.aug)
+   File: Sep  (sep.aug)
+   File: Util  (util.aug)
+   }  # Group: Generic Modules
+
+Group: Index  {
+
+   Augeas Lens Index: Lenses
+   Augeas Module Index: Modules
+   Augeas Variable Index: Variables
+   Index: Everything
+   }  # Group: Index
+
index 16c5cd1..c65d016 100644 (file)
@@ -44,12 +44,12 @@ syn region augeasComment    start="(\*"  end="\*)" contains=augeasTodo,augeasSpaceE
 
 if !exists("augeas_no_functions")
   " functions
-  syn keyword augeasLabel      del key store label value
-  syn keyword augeasFunction   Util Build Rx Sep
+  syn keyword augeasLabel      del key store label value square seq
+  syn keyword augeasFunction   Util Build Rx Sep Quote
 endif
 
-syn region  augeasRegexp       start="/"  end="[^\\]/"
-syn region  augeasString       start=+"+  end=+"\([ \t)\.-]\|$\)+
+syn region  augeasRegexp  start="/"  end="[^\\]/"
+syn region  augeasString  start=+"+  end=+"+  skip=+\\"+
 
 
 " Define the default highlighting.
index c76141e..030ee23 100644 (file)
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in 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.
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,13 +79,15 @@ build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = fadot$(EXEEXT)
 subdir = examples
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+       $(top_srcdir)/build/ac-aux/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/alloca.m4 \
        $(top_srcdir)/gnulib/m4/argz.m4 \
        $(top_srcdir)/gnulib/m4/btowc.m4 \
        $(top_srcdir)/gnulib/m4/canonicalize.m4 \
+       $(top_srcdir)/gnulib/m4/close.m4 \
        $(top_srcdir)/gnulib/m4/codeset.m4 \
        $(top_srcdir)/gnulib/m4/configmake.m4 \
        $(top_srcdir)/gnulib/m4/ctype.m4 \
@@ -50,24 +96,33 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/eealloc.m4 \
        $(top_srcdir)/gnulib/m4/environ.m4 \
        $(top_srcdir)/gnulib/m4/errno_h.m4 \
+       $(top_srcdir)/gnulib/m4/exponentd.m4 \
        $(top_srcdir)/gnulib/m4/extensions.m4 \
        $(top_srcdir)/gnulib/m4/fcntl-o.m4 \
        $(top_srcdir)/gnulib/m4/fcntl_h.m4 \
+       $(top_srcdir)/gnulib/m4/fdopen.m4 \
        $(top_srcdir)/gnulib/m4/float_h.m4 \
        $(top_srcdir)/gnulib/m4/fnmatch.m4 \
+       $(top_srcdir)/gnulib/m4/fpieee.m4 \
+       $(top_srcdir)/gnulib/m4/fstat.m4 \
+       $(top_srcdir)/gnulib/m4/getcwd.m4 \
        $(top_srcdir)/gnulib/m4/getdelim.m4 \
        $(top_srcdir)/gnulib/m4/getline.m4 \
        $(top_srcdir)/gnulib/m4/getopt.m4 \
        $(top_srcdir)/gnulib/m4/getpagesize.m4 \
+       $(top_srcdir)/gnulib/m4/gettimeofday.m4 \
        $(top_srcdir)/gnulib/m4/glibc21.m4 \
        $(top_srcdir)/gnulib/m4/gnulib-common.m4 \
        $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \
        $(top_srcdir)/gnulib/m4/include_next.m4 \
        $(top_srcdir)/gnulib/m4/intlmacosx.m4 \
        $(top_srcdir)/gnulib/m4/intmax_t.m4 \
+       $(top_srcdir)/gnulib/m4/inttypes-pri.m4 \
+       $(top_srcdir)/gnulib/m4/inttypes.m4 \
        $(top_srcdir)/gnulib/m4/inttypes_h.m4 \
        $(top_srcdir)/gnulib/m4/isblank.m4 \
        $(top_srcdir)/gnulib/m4/langinfo_h.m4 \
+       $(top_srcdir)/gnulib/m4/largefile.m4 \
        $(top_srcdir)/gnulib/m4/lcmessage.m4 \
        $(top_srcdir)/gnulib/m4/lib-ld.m4 \
        $(top_srcdir)/gnulib/m4/lib-link.m4 \
@@ -79,6 +134,7 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/locale-tr.m4 \
        $(top_srcdir)/gnulib/m4/locale-zh.m4 \
        $(top_srcdir)/gnulib/m4/locale_h.m4 \
+       $(top_srcdir)/gnulib/m4/localeconv.m4 \
        $(top_srcdir)/gnulib/m4/localename.m4 \
        $(top_srcdir)/gnulib/m4/lock.m4 \
        $(top_srcdir)/gnulib/m4/longlong.m4 \
@@ -96,15 +152,21 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/mbtowc.m4 \
        $(top_srcdir)/gnulib/m4/memchr.m4 \
        $(top_srcdir)/gnulib/m4/mempcpy.m4 \
+       $(top_srcdir)/gnulib/m4/mkstemp.m4 \
        $(top_srcdir)/gnulib/m4/mmap-anon.m4 \
        $(top_srcdir)/gnulib/m4/mode_t.m4 \
+       $(top_srcdir)/gnulib/m4/msvc-inval.m4 \
+       $(top_srcdir)/gnulib/m4/msvc-nothrow.m4 \
        $(top_srcdir)/gnulib/m4/multiarch.m4 \
        $(top_srcdir)/gnulib/m4/nl_langinfo.m4 \
+       $(top_srcdir)/gnulib/m4/nocrash.m4 \
+       $(top_srcdir)/gnulib/m4/off_t.m4 \
        $(top_srcdir)/gnulib/m4/onceonly.m4 \
        $(top_srcdir)/gnulib/m4/open.m4 \
        $(top_srcdir)/gnulib/m4/pathmax.m4 \
        $(top_srcdir)/gnulib/m4/printf.m4 \
        $(top_srcdir)/gnulib/m4/putenv.m4 \
+       $(top_srcdir)/gnulib/m4/rawmemchr.m4 \
        $(top_srcdir)/gnulib/m4/readlink.m4 \
        $(top_srcdir)/gnulib/m4/realloc.m4 \
        $(top_srcdir)/gnulib/m4/regex.m4 \
@@ -124,13 +186,18 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/stdlib_h.m4 \
        $(top_srcdir)/gnulib/m4/stpcpy.m4 \
        $(top_srcdir)/gnulib/m4/stpncpy.m4 \
+       $(top_srcdir)/gnulib/m4/strchrnul.m4 \
        $(top_srcdir)/gnulib/m4/string_h.m4 \
        $(top_srcdir)/gnulib/m4/strndup.m4 \
        $(top_srcdir)/gnulib/m4/strnlen.m4 \
        $(top_srcdir)/gnulib/m4/strstr.m4 \
        $(top_srcdir)/gnulib/m4/symlink.m4 \
+       $(top_srcdir)/gnulib/m4/sys_socket_h.m4 \
        $(top_srcdir)/gnulib/m4/sys_stat_h.m4 \
+       $(top_srcdir)/gnulib/m4/sys_time_h.m4 \
+       $(top_srcdir)/gnulib/m4/sys_types_h.m4 \
        $(top_srcdir)/gnulib/m4/sys_wait_h.m4 \
+       $(top_srcdir)/gnulib/m4/tempname.m4 \
        $(top_srcdir)/gnulib/m4/thread.m4 \
        $(top_srcdir)/gnulib/m4/threadlib.m4 \
        $(top_srcdir)/gnulib/m4/time_h.m4 \
@@ -159,11 +226,24 @@ PROGRAMS = $(bin_PROGRAMS)
 am_fadot_OBJECTS = fadot.$(OBJEXT)
 fadot_OBJECTS = $(am_fadot_OBJECTS)
 fadot_DEPENDENCIES = $(top_builddir)/src/libfa.la $(GNULIB)
-AM_V_lt = $(am__v_lt_$(V))
-am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+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 = 
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/build/aux/depcomp
+depcomp = $(SHELL) $(top_srcdir)/build/ac-aux/depcomp
 am__depfiles_maybe = depfiles
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -172,24 +252,42 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
        $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
        $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_$(V))
-am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
-am__v_CC_0 = @echo "  CC    " $@;
-AM_V_at = $(am__v_at_$(V))
-am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
-am__v_at_0 = @
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_$(V))
-am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
-am__v_CCLD_0 = @echo "  CCLD  " $@;
-AM_V_GEN = $(am__v_GEN_$(V))
-am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
-am__v_GEN_0 = @echo "  GEN   " $@;
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
 SOURCES = $(fadot_SOURCES)
 DIST_SOURCES = $(fadot_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)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -201,6 +299,7 @@ AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 AR = @AR@
+ARFLAGS = @ARFLAGS@
 ARGZ_H = @ARGZ_H@
 AUGEAS_CFLAGS = @AUGEAS_CFLAGS@
 AUTOCONF = @AUTOCONF@
@@ -244,9 +343,11 @@ GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
 GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
+GNULIB_CHDIR = @GNULIB_CHDIR@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
+GNULIB_DUP = @GNULIB_DUP@
 GNULIB_DUP2 = @GNULIB_DUP2@
 GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
@@ -258,16 +359,25 @@ 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_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FFSL = @GNULIB_FFSL@
+GNULIB_FFSLL = @GNULIB_FFSLL@
+GNULIB_FGETC = @GNULIB_FGETC@
+GNULIB_FGETS = @GNULIB_FGETS@
 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_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@
@@ -275,6 +385,8 @@ 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@
@@ -287,8 +399,14 @@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
 GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
+GNULIB_IMAXABS = @GNULIB_IMAXABS@
+GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
+GNULIB_ISATTY = @GNULIB_ISATTY@
 GNULIB_ISBLANK = @GNULIB_ISBLANK@
 GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
 GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
@@ -296,6 +414,7 @@ GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
 GNULIB_LINKAT = @GNULIB_LINKAT@
+GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
@@ -336,25 +455,31 @@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
 GNULIB_MKTIME = @GNULIB_MKTIME@
 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_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_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
 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_RANDOM = @GNULIB_RANDOM@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
 GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
+GNULIB_READ = @GNULIB_READ@
 GNULIB_READLINK = @GNULIB_READLINK@
 GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
@@ -364,12 +489,15 @@ GNULIB_RENAME = @GNULIB_RENAME@
 GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
 GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
+GNULIB_SCANF = @GNULIB_SCANF@
 GNULIB_SETENV = @GNULIB_SETENV@
+GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
 GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
 GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
 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@
@@ -387,9 +515,11 @@ 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@
@@ -399,7 +529,7 @@ GNULIB_TIME_R = @GNULIB_TIME_R@
 GNULIB_TMPFILE = @GNULIB_TMPFILE@
 GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
 GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
-GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
+GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
 GNULIB_UNLINK = @GNULIB_UNLINK@
 GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
@@ -411,8 +541,10 @@ 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@
@@ -461,6 +593,7 @@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
 HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
 HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
 HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
 HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
@@ -471,18 +604,23 @@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 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_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
 HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
 HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
@@ -498,7 +636,10 @@ HAVE_FCHDIR = @HAVE_FCHDIR@
 HAVE_FCHMODAT = @HAVE_FCHMODAT@
 HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
 HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
 HAVE_FSEEKO = @HAVE_FSEEKO@
 HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
@@ -512,7 +653,9 @@ HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
 HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
 HAVE_ISBLANK = @HAVE_ISBLANK@
 HAVE_ISWBLANK = @HAVE_ISWBLANK@
@@ -546,15 +689,21 @@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
 HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
 HAVE_MKSTEMP = @HAVE_MKSTEMP@
 HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
 HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OPENAT = @HAVE_OPENAT@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
 HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
 HAVE_PREAD = @HAVE_PREAD@
 HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
 HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_RANDOM = @HAVE_RANDOM@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
 HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -564,6 +713,7 @@ HAVE_REALPATH = @HAVE_REALPATH@
 HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
 HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
@@ -580,6 +730,7 @@ HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
 HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
 HAVE_SYMLINK = @HAVE_SYMLINK@
 HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
@@ -587,6 +738,7 @@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
 HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
 HAVE_TIMEGM = @HAVE_TIMEGM@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
@@ -628,6 +780,7 @@ HAVE_WCSXFRM = @HAVE_WCSXFRM@
 HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
 HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
 HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WMEMCHR = @HAVE_WMEMCHR@
 HAVE_WMEMCMP = @HAVE_WMEMCMP@
@@ -644,6 +797,8 @@ INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 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@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
@@ -689,6 +844,7 @@ 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_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
 NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
 NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H = @NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H@
@@ -698,6 +854,8 @@ 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_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_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@
@@ -708,6 +866,7 @@ 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_INTTYPES_H = @NEXT_INTTYPES_H@
 NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_LOCALE_H = @NEXT_LOCALE_H@
 NEXT_SELINUX_SELINUX_H = @NEXT_SELINUX_SELINUX_H@
@@ -717,6 +876,8 @@ NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
 NEXT_STRING_H = @NEXT_STRING_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_WAIT_H = @NEXT_SYS_WAIT_H@
 NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
@@ -743,6 +904,8 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 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@
@@ -759,6 +922,7 @@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
 REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
@@ -770,6 +934,7 @@ REPLACE_FSTAT = @REPLACE_FSTAT@
 REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
 REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
 REPLACE_GETDELIM = @REPLACE_GETDELIM@
@@ -778,11 +943,15 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISATTY = @REPLACE_ISATTY@
 REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ITOLD = @REPLACE_ITOLD@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
 REPLACE_LINK = @REPLACE_LINK@
 REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALECONV = @REPLACE_LOCALECONV@
 REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
@@ -811,8 +980,11 @@ REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
 REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
 REPLACE_REALLOC = @REPLACE_REALLOC@
 REPLACE_REALPATH = @REPLACE_REALPATH@
@@ -826,9 +998,11 @@ REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
 REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
 REPLACE_STPNCPY = @REPLACE_STPNCPY@
 REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
 REPLACE_STRDUP = @REPLACE_STRDUP@
 REPLACE_STRERROR = @REPLACE_STRERROR@
 REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
@@ -838,10 +1012,14 @@ REPLACE_STRNLEN = @REPLACE_STRNLEN@
 REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
 REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
 REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
+REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
 REPLACE_SYMLINK = @REPLACE_SYMLINK@
 REPLACE_TIMEGM = @REPLACE_TIMEGM@
 REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
 REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
 REPLACE_UNLINK = @REPLACE_UNLINK@
 REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
@@ -874,6 +1052,8 @@ STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+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_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
@@ -881,6 +1061,8 @@ VERSION = @VERSION@
 VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@
 WARN_CFLAGS = @WARN_CFLAGS@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 YACC = @YACC@
 YFLAGS = @YFLAGS@
@@ -986,14 +1168,19 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-binPROGRAMS: $(bin_PROGRAMS)
        @$(NORMAL_INSTALL)
-       test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
        @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+       fi; \
        for p in $$list; do echo "$$p $$p"; done | \
        sed 's/$(EXEEXT)$$//' | \
-       while read p p1; do if test -f $$p || test -f $$p1; \
-         then echo "$$p"; echo "$$p"; else :; fi; \
+       while read p p1; do if test -f $$p \
+        || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
        done | \
-       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
            -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
        sed 'N;N;N;s,\n, ,g' | \
        $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
@@ -1014,7 +1201,8 @@ uninstall-binPROGRAMS:
        @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
        files=`for p in $$list; do echo "$$p"; done | \
          sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-             -e 's/$$/$(EXEEXT)/' `; \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
        test -n "$$list" || exit 0; \
        echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(bindir)" && rm -f $$files
@@ -1027,7 +1215,8 @@ clean-binPROGRAMS:
        list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
        echo " rm -f" $$list; \
        rm -f $$list
-fadot$(EXEEXT): $(fadot_OBJECTS) $(fadot_DEPENDENCIES) 
+
+fadot$(EXEEXT): $(fadot_OBJECTS) $(fadot_DEPENDENCIES) $(EXTRA_fadot_DEPENDENCIES) 
        @rm -f fadot$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(fadot_OBJECTS) $(fadot_LDADD) $(LIBS)
 
@@ -1042,26 +1231,23 @@ distclean-compile:
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
 
 .c.obj:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
 
 mostlyclean-libtool:
        -rm -f *.lo
@@ -1069,26 +1255,15 @@ mostlyclean-libtool:
 clean-libtool:
        -rm -rf .libs _libs
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -1100,15 +1275,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -1117,6 +1288,21 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
 
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -1168,10 +1354,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
 mostlyclean-generic:
 
 clean-generic:
@@ -1255,19 +1446,19 @@ uninstall-am: uninstall-binPROGRAMS
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-       clean-generic clean-libtool ctags distclean distclean-compile \
-       distclean-generic distclean-libtool distclean-tags distdir dvi \
-       dvi-am html html-am info info-am install install-am \
-       install-binPROGRAMS 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 \
-       maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
-       pdf pdf-am ps ps-am tags uninstall uninstall-am \
-       uninstall-binPROGRAMS
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+       clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
+       ctags ctags-am distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-binPROGRAMS \
+       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 maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       tags tags-am uninstall uninstall-am uninstall-binPROGRAMS
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
index b299e53..963b22d 100644 (file)
@@ -1,15 +1,27 @@
 ## DO NOT EDIT! GENERATED AUTOMATICALLY!
 ## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2011 Free Software Foundation, Inc.
+# Copyright (C) 2002-2012 Free Software Foundation, Inc.
 #
-# This file is free software, distributed under the terms of the GNU
-# General Public License.  As a special exception to the GNU General
-# Public License, this file may be distributed as part of a program
-# that contains a configuration script generated by Autoconf, under
+# 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 this file.  If not, see <http://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
+# contains a configuration script generated by Autoconf, under
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --tests-base=gnulib/tests --aux-dir=build/aux --with-tests --lgpl=2 --libtool --macro-prefix=gl argz canonicalize-lgpl fnmatch getline getopt-gnu gitlog-to-changelog isblank locale regex safe-alloc selinux-h stpcpy stpncpy strndup sys_wait vasprintf
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --tests-base=gnulib/tests --aux-dir=build/ac-aux --with-tests --lgpl=2 --no-conditional-dependencies --libtool --macro-prefix=gl argz canonicalize-lgpl fnmatch getline getopt-gnu gitlog-to-changelog isblank locale mkstemp regex safe-alloc selinux-h stpcpy stpncpy strchrnul strndup sys_wait vasprintf
 
 AUTOMAKE_OPTIONS = 1.5 gnits
 
@@ -43,12 +55,12 @@ libgnu_la_LDFLAGS += $(LTLIBINTL)
 ## begin gnulib module alloca
 
 
+libgnu_la_LIBADD += @LTALLOCA@
+libgnu_la_DEPENDENCIES += @LTALLOCA@
 EXTRA_DIST += alloca.c
 
 EXTRA_libgnu_la_SOURCES += alloca.c
 
-libgnu_la_LIBADD += @LTALLOCA@
-libgnu_la_DEPENDENCIES += @LTALLOCA@
 ## end   gnulib module alloca
 
 ## begin gnulib module alloca-opt
@@ -57,54 +69,40 @@ BUILT_SOURCES += $(ALLOCA_H)
 
 # We need the following in order to create <alloca.h> when the system
 # doesn't have one that works with the given compiler.
-alloca.h: alloca.in.h
+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; \
        } > $@-t && \
        mv -f $@-t $@
+else
+alloca.h: $(top_builddir)/config.status
+       rm -f $@
+endif
 MOSTLYCLEANFILES += alloca.h alloca.h-t
 
 EXTRA_DIST += alloca.in.h
 
 ## end   gnulib module alloca-opt
 
-## begin gnulib module 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/arg-nonnull.h, except that it has the copyright header cut off.
-arg-nonnull.h: $(top_srcdir)/build/aux/arg-nonnull.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/GL_ARG_NONNULL/,$$p' \
-         < $(top_srcdir)/build/aux/arg-nonnull.h \
-         > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
-
-ARG_NONNULL_H=arg-nonnull.h
-
-EXTRA_DIST += $(top_srcdir)/build/aux/arg-nonnull.h
-
-## end   gnulib module arg-nonnull
-
 ## begin gnulib module argz
 
 BUILT_SOURCES += $(ARGZ_H)
 
 # We need the following in order to create <argz.h> when the system
 # doesn't have one that works with the given compiler.
-argz.h: argz.in.h
+if GL_GENERATE_ARGZ_H
+argz.h: argz.in.h $(top_builddir)/config.status
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          cat $(srcdir)/argz.in.h; \
        } > $@-t && \
        mv -f $@-t $@
+else
+argz.h: $(top_builddir)/config.status
+       rm -f $@
+endif
 MOSTLYCLEANFILES += argz.h argz.h-t
 
 EXTRA_DIST += argz.c argz.in.h
@@ -122,30 +120,6 @@ EXTRA_libgnu_la_SOURCES += btowc.c
 
 ## end   gnulib module btowc
 
-## begin gnulib module 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/c++defs.h, except that it has the copyright header cut off.
-c++defs.h: $(top_srcdir)/build/aux/c++defs.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/_GL_CXXDEFS/,$$p' \
-         < $(top_srcdir)/build/aux/c++defs.h \
-         > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += c++defs.h c++defs.h-t
-
-CXXDEFS_H=c++defs.h
-
-EXTRA_DIST += $(top_srcdir)/build/aux/c++defs.h
-
-## end   gnulib module c++defs
-
 ## begin gnulib module canonicalize-lgpl
 
 
@@ -192,11 +166,7 @@ configmake.h: Makefile
          echo '#define PKGLIBDIR "$(pkglibdir)"'; \
          echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \
        } | sed '/""/d' > $@-t && \
-       if test -f $@ && cmp $@-t $@ > /dev/null; then \
-         rm -f $@-t; \
-       else \
-         rm -f $@; mv $@-t $@; \
-       fi
+       mv -f $@-t $@
 
 BUILT_SOURCES += configmake.h
 CLEANFILES += configmake.h configmake.h-t
@@ -209,10 +179,11 @@ BUILT_SOURCES += ctype.h
 
 # 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 $(CXXDEFS_H) $(WARN_ON_USE_H)
+ctype.h: ctype.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|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_CTYPE_H''@|$(NEXT_CTYPE_H)|g' \
@@ -242,10 +213,12 @@ BUILT_SOURCES += $(ERRNO_H)
 
 # We need the following in order to create <errno.h> when the system
 # doesn't have one that is POSIX compliant.
-errno.h: errno.in.h
+if GL_GENERATE_ERRNO_H
+errno.h: errno.in.h $(top_builddir)/config.status
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
@@ -258,31 +231,79 @@ errno.h: errno.in.h
              < $(srcdir)/errno.in.h; \
        } > $@-t && \
        mv $@-t $@
+else
+errno.h: $(top_builddir)/config.status
+       rm -f $@
+endif
 MOSTLYCLEANFILES += errno.h errno.h-t
 
 EXTRA_DIST += errno.in.h
 
 ## end   gnulib module errno
 
+## begin gnulib module fcntl-h
+
+BUILT_SOURCES += fcntl.h
+
+# We need the following in order to create <fcntl.h> when the system
+# doesn't have one that works with the given compiler.
+fcntl.h: fcntl.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|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_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|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
+             -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
+             -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \
+             -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
+             -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|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)/fcntl.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += fcntl.h fcntl.h-t
+
+EXTRA_DIST += fcntl.in.h
+
+## end   gnulib module fcntl-h
+
 ## begin gnulib module float
 
 BUILT_SOURCES += $(FLOAT_H)
 
 # We need the following in order to create <float.h> when the system
 # doesn't have one that works with the given compiler.
-float.h: float.in.h
+if GL_GENERATE_FLOAT_H
+float.h: float.in.h $(top_builddir)/config.status
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
+             -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \
              < $(srcdir)/float.in.h; \
        } > $@-t && \
        mv $@-t $@
+else
+float.h: $(top_builddir)/config.status
+       rm -f $@
+endif
 MOSTLYCLEANFILES += float.h float.h-t
 
-EXTRA_DIST += float.in.h
+EXTRA_DIST += float.c float.in.h itold.c
+
+EXTRA_libgnu_la_SOURCES += float.c itold.c
 
 ## end   gnulib module float
 
@@ -292,13 +313,18 @@ BUILT_SOURCES += $(FNMATCH_H)
 
 # We need the following in order to create <fnmatch.h> when the system
 # doesn't have one that supports the required API.
-fnmatch.h: fnmatch.in.h $(ARG_NONNULL_H)
+if GL_GENERATE_FNMATCH_H
+fnmatch.h: fnmatch.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              < $(srcdir)/fnmatch.in.h; \
        } > $@-t && \
        mv -f $@-t $@
+else
+fnmatch.h: $(top_builddir)/config.status
+       rm -f $@
+endif
 MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t
 
 EXTRA_DIST += fnmatch.c fnmatch.in.h fnmatch_loop.c
@@ -331,10 +357,11 @@ BUILT_SOURCES += $(GETOPT_H)
 
 # We need the following in order to create <getopt.h> when the system
 # doesn't have one that works with the given compiler.
-getopt.h: getopt.in.h $(ARG_NONNULL_H)
+getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_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' \
@@ -357,10 +384,19 @@ libgnu_la_SOURCES += gettext.h
 
 ## end   gnulib module gettext-h
 
+## begin gnulib module gettimeofday
+
+
+EXTRA_DIST += gettimeofday.c
+
+EXTRA_libgnu_la_SOURCES += gettimeofday.c
+
+## end   gnulib module gettimeofday
+
 ## begin gnulib module gitlog-to-changelog
 
 
-EXTRA_DIST += $(top_srcdir)/build/aux/gitlog-to-changelog
+EXTRA_DIST += $(top_srcdir)/build/ac-aux/gitlog-to-changelog
 
 ## end   gnulib module gitlog-to-changelog
 
@@ -379,15 +415,16 @@ BUILT_SOURCES += langinfo.h
 
 # 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 $(CXXDEFS_H) $(WARN_ON_USE_H)
+langinfo.h: langinfo.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|@''HAVE_LANGINFO_H''@|$(HAVE_LANGINFO_H)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''HAVE_LANGINFO_H''@|$(HAVE_LANGINFO_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_LANGINFO_H''@|$(NEXT_LANGINFO_H)|g' \
-             -e 's|@''GNULIB_NL_LANGINFO''@|$(GNULIB_NL_LANGINFO)|g' \
+             -e 's/@''GNULIB_NL_LANGINFO''@/$(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_ERA''@|$(HAVE_LANGINFO_ERA)|g' \
@@ -485,19 +522,23 @@ BUILT_SOURCES += locale.h
 
 # 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 $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+locale.h: locale.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|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_LOCALE_H''@|$(NEXT_LOCALE_H)|g' \
-             -e 's|@''GNULIB_SETLOCALE''@|$(GNULIB_SETLOCALE)|g' \
-             -e 's|@''GNULIB_DUPLOCALE''@|$(GNULIB_DUPLOCALE)|g' \
+             -e 's/@''GNULIB_LOCALECONV''@/$(GNULIB_LOCALECONV)/g' \
+             -e 's/@''GNULIB_SETLOCALE''@/$(GNULIB_SETLOCALE)/g' \
+             -e 's/@''GNULIB_DUPLOCALE''@/$(GNULIB_DUPLOCALE)/g' \
              -e 's|@''HAVE_DUPLOCALE''@|$(HAVE_DUPLOCALE)|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_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \
+             -e 's|@''REPLACE_STRUCT_LCONV''@|$(REPLACE_STRUCT_LCONV)|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)' \
@@ -510,6 +551,15 @@ EXTRA_DIST += locale.in.h
 
 ## end   gnulib module locale
 
+## begin gnulib module localeconv
+
+
+EXTRA_DIST += localeconv.c
+
+EXTRA_libgnu_la_SOURCES += localeconv.c
+
+## end   gnulib module localeconv
+
 ## begin gnulib module lstat
 
 
@@ -599,6 +649,15 @@ EXTRA_libgnu_la_SOURCES += mempcpy.c
 
 ## end   gnulib module mempcpy
 
+## begin gnulib module mkstemp
+
+
+EXTRA_DIST += mkstemp.c
+
+EXTRA_libgnu_la_SOURCES += mkstemp.c
+
+## end   gnulib module mkstemp
+
 ## begin gnulib module nl_langinfo
 
 
@@ -615,6 +674,15 @@ EXTRA_DIST += pathmax.h
 
 ## end   gnulib module pathmax
 
+## begin gnulib module rawmemchr
+
+
+EXTRA_DIST += rawmemchr.c rawmemchr.valgrind
+
+EXTRA_libgnu_la_SOURCES += rawmemchr.c
+
+## end   gnulib module rawmemchr
+
 ## begin gnulib module readlink
 
 
@@ -644,10 +712,9 @@ EXTRA_libgnu_la_SOURCES += regcomp.c regex.c regex_internal.c regexec.c
 
 ## begin gnulib module safe-alloc
 
+libgnu_la_SOURCES += safe-alloc.c
 
-EXTRA_DIST += safe-alloc.c safe-alloc.h
-
-EXTRA_libgnu_la_SOURCES += safe-alloc.c
+EXTRA_DIST += safe-alloc.h
 
 ## end   gnulib module safe-alloc
 
@@ -656,11 +723,12 @@ EXTRA_libgnu_la_SOURCES += safe-alloc.c
 libgnu_la_SOURCES += se-context.in.h se-selinux.in.h
 
 BUILT_SOURCES += selinux/selinux.h
-selinux/selinux.h: se-selinux.in.h $(UNUSED_PARAMETER_H)
+selinux/selinux.h: se-selinux.in.h $(top_builddir)/config.status $(UNUSED_PARAMETER_H)
        $(AM_V_at)$(MKDIR_P) selinux
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_SELINUX_SELINUX_H''@|$(NEXT_SELINUX_SELINUX_H)|g' \
@@ -672,7 +740,8 @@ selinux/selinux.h: se-selinux.in.h $(UNUSED_PARAMETER_H)
 MOSTLYCLEANFILES += selinux/selinux.h selinux/selinux.h-t
 
 BUILT_SOURCES += $(SELINUX_CONTEXT_H)
-selinux/context.h: se-context.in.h $(UNUSED_PARAMETER_H)
+if GL_GENERATE_SELINUX_CONTEXT_H
+selinux/context.h: se-context.in.h $(top_builddir)/config.status $(UNUSED_PARAMETER_H)
        $(AM_V_at)$(MKDIR_P) selinux
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
@@ -681,6 +750,10 @@ selinux/context.h: se-context.in.h $(UNUSED_PARAMETER_H)
        } > $@-t && \
        chmod a-x $@-t && \
        mv $@-t $@
+else
+selinux/context.h: $(top_builddir)/config.status
+       rm -f $@
+endif
 MOSTLYCLEANFILES += selinux/context.h selinux/context.h-t
 MOSTLYCLEANDIRS += selinux
 
@@ -696,6 +769,112 @@ libgnu_la_SOURCES += size_max.h
 
 ## end   gnulib module size_max
 
+## 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
+# need it. This is ensured by the applicability 'all' defined above.
+
+_NORETURN_H=$(top_srcdir)/build/ac-aux/snippet/_Noreturn.h
+
+EXTRA_DIST += $(top_srcdir)/build/ac-aux/snippet/_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/ac-aux/snippet/arg-nonnull.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/GL_ARG_NONNULL/,$$p' \
+         < $(top_srcdir)/build/ac-aux/snippet/arg-nonnull.h \
+         > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
+
+ARG_NONNULL_H=arg-nonnull.h
+
+EXTRA_DIST += $(top_srcdir)/build/ac-aux/snippet/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/ac-aux/snippet/c++defs.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/_GL_CXXDEFS/,$$p' \
+         < $(top_srcdir)/build/ac-aux/snippet/c++defs.h \
+         > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += c++defs.h c++defs.h-t
+
+CXXDEFS_H=c++defs.h
+
+EXTRA_DIST += $(top_srcdir)/build/ac-aux/snippet/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/ac-aux/snippet/unused-parameter.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/GL_UNUSED_PARAMETER/,$$p' \
+         < $(top_srcdir)/build/ac-aux/snippet/unused-parameter.h \
+         > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += unused-parameter.h unused-parameter.h-t
+
+UNUSED_PARAMETER_H=unused-parameter.h
+
+EXTRA_DIST += $(top_srcdir)/build/ac-aux/snippet/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/ac-aux/snippet/warn-on-use.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/^.ifndef/,$$p' \
+         < $(top_srcdir)/build/ac-aux/snippet/warn-on-use.h \
+         > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
+
+WARN_ON_USE_H=warn-on-use.h
+
+EXTRA_DIST += $(top_srcdir)/build/ac-aux/snippet/warn-on-use.h
+
+## end   gnulib module snippet/warn-on-use
+
 ## begin gnulib module stat
 
 
@@ -711,12 +890,17 @@ BUILT_SOURCES += $(STDBOOL_H)
 
 # We need the following in order to create <stdbool.h> when the system
 # doesn't have one that works.
-stdbool.h: stdbool.in.h
+if GL_GENERATE_STDBOOL_H
+stdbool.h: stdbool.in.h $(top_builddir)/config.status
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
        } > $@-t && \
        mv $@-t $@
+else
+stdbool.h: $(top_builddir)/config.status
+       rm -f $@
+endif
 MOSTLYCLEANFILES += stdbool.h stdbool.h-t
 
 EXTRA_DIST += stdbool.in.h
@@ -729,10 +913,12 @@ BUILT_SOURCES += $(STDDEF_H)
 
 # We need the following in order to create <stddef.h> when the system
 # doesn't have one that works with the given compiler.
-stddef.h: stddef.in.h
+if GL_GENERATE_STDDEF_H
+stddef.h: stddef.in.h $(top_builddir)/config.status
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
@@ -741,6 +927,10 @@ stddef.h: stddef.in.h
              < $(srcdir)/stddef.in.h; \
        } > $@-t && \
        mv $@-t $@
+else
+stddef.h: $(top_builddir)/config.status
+       rm -f $@
+endif
 MOSTLYCLEANFILES += stddef.h stddef.h-t
 
 EXTRA_DIST += stddef.in.h
@@ -753,10 +943,12 @@ BUILT_SOURCES += $(STDINT_H)
 
 # We need the following in order to create <stdint.h> when the system
 # doesn't have one that works with the given compiler.
-stdint.h: stdint.in.h
+if GL_GENERATE_STDINT_H
+stdint.h: stdint.in.h $(top_builddir)/config.status
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_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' \
@@ -785,6 +977,10 @@ stdint.h: stdint.in.h
              < $(srcdir)/stdint.in.h; \
        } > $@-t && \
        mv $@-t $@
+else
+stdint.h: $(top_builddir)/config.status
+       rm -f $@
+endif
 MOSTLYCLEANFILES += stdint.h stdint.h-t
 
 EXTRA_DIST += stdint.in.h
@@ -797,54 +993,67 @@ BUILT_SOURCES += stdio.h
 
 # We need the following in order to create <stdio.h> when the system
 # doesn't have one that works with the given compiler.
-stdio.h: stdio.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+stdio.h: stdio.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|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_STDIO_H''@|$(NEXT_STDIO_H)|g' \
-             -e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \
-             -e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \
-             -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|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_FREOPEN''@|$(GNULIB_FREOPEN)|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_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_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_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \
-             -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|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_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''@/$(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' \
              < $(srcdir)/stdio.in.h | \
          sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
              -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
@@ -857,11 +1066,14 @@ stdio.h: stdio.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
              -e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \
              -e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \
+             -e 's|@''HAVE_PCLOSE''@|$(HAVE_PCLOSE)|g' \
+             -e 's|@''HAVE_POPEN''@|$(HAVE_POPEN)|g' \
              -e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \
              -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
              -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
              -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
              -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
+             -e 's|@''REPLACE_FDOPEN''@|$(REPLACE_FDOPEN)|g' \
              -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
              -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
              -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
@@ -882,6 +1094,7 @@ stdio.h: stdio.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \
              -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
              -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
+             -e 's|@''REPLACE_STDIO_READ_FUNCS''@|$(REPLACE_STDIO_READ_FUNCS)|g' \
              -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
              -e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \
              -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
@@ -908,41 +1121,46 @@ BUILT_SOURCES += stdlib.h
 
 # We need the following in order to create <stdlib.h> when the system
 # doesn't have one that works with the given compiler.
-stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+stdlib.h: stdlib.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|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_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_PTSNAME''@|$(GNULIB_PTSNAME)|g' \
-             -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|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_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''@/$(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_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_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' \
              < $(srcdir)/stdlib.in.h | \
          sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
              -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
@@ -955,7 +1173,10 @@ stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -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_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \
              -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
+             -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \
+             -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_REALPATH''@|$(HAVE_REALPATH)|g' \
@@ -973,7 +1194,9 @@ stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \
              -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
              -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
+             -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
              -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
+             -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \
              -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \
              -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
              -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
@@ -981,6 +1204,7 @@ stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
              -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|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 && \
@@ -1009,6 +1233,15 @@ EXTRA_libgnu_la_SOURCES += stpncpy.c
 
 ## end   gnulib module stpncpy
 
+## begin gnulib module strchrnul
+
+
+EXTRA_DIST += strchrnul.c strchrnul.valgrind
+
+EXTRA_libgnu_la_SOURCES += strchrnul.c
+
+## end   gnulib module strchrnul
+
 ## begin gnulib module streq
 
 
@@ -1022,50 +1255,55 @@ BUILT_SOURCES += string.h
 
 # We need the following in order to create <string.h> when the system
 # doesn't have one that works with the given compiler.
-string.h: string.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+string.h: string.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|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_STRING_H''@|$(NEXT_STRING_H)|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_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' \
              < $(srcdir)/string.in.h | \
-         sed -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
+         sed -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' \
@@ -1088,6 +1326,7 @@ string.h: string.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
              -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
              -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|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' \
@@ -1149,26 +1388,29 @@ BUILT_SOURCES += sys/stat.h
 
 # 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 $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+sys/stat.h: sys_stat.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|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
-             -e 's|@''GNULIB_FCHMODAT''@|$(GNULIB_FCHMODAT)|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_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|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
              -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
              -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \
@@ -1202,21 +1444,81 @@ 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|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
+
+# 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
+       $(AM_V_at)$(MKDIR_P) sys
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \
+             -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
+             < $(srcdir)/sys_types.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += sys/types.h sys/types.h-t
+
+EXTRA_DIST += sys_types.in.h
+
+## end   gnulib module sys_types
+
 ## begin gnulib module sys_wait
 
 BUILT_SOURCES += sys/wait.h
 
 # We need the following in order to create <sys/wait.h> when the system
 # has one that is incomplete.
-sys/wait.h: sys_wait.in.h $(CXXDEFS_H) $(WARN_ON_USE_H)
+sys/wait.h: sys_wait.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|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_WAIT_H''@|$(NEXT_SYS_WAIT_H)|g' \
-             -e 's|@''GNULIB_WAITPID''@|$(GNULIB_WAITPID)|g' \
+             -e 's/@''GNULIB_WAITPID''@/$(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; \
@@ -1229,24 +1531,33 @@ EXTRA_DIST += sys_wait.in.h
 
 ## end   gnulib module sys_wait
 
+## begin gnulib module tempname
+
+libgnu_la_SOURCES += tempname.c
+
+EXTRA_DIST += tempname.h
+
+## end   gnulib module tempname
+
 ## begin gnulib module time
 
 BUILT_SOURCES += time.h
 
 # We need the following in order to create <time.h> when the system
 # doesn't have one that works with the given compiler.
-time.h: time.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+time.h: time.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|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_TIME_H''@|$(NEXT_TIME_H)|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_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|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \
              -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
              -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
@@ -1276,55 +1587,65 @@ BUILT_SOURCES += unistd.h
 
 # We need the following in order to create an empty placeholder for
 # <unistd.h> when the system doesn't have one.
-unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+unistd.h: unistd.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|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_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_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \
-             -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \
-             -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|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_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_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_READLINK''@|$(GNULIB_READLINK)|g' \
-             -e 's|@''GNULIB_READLINKAT''@|$(GNULIB_READLINKAT)|g' \
-             -e 's|@''GNULIB_RMDIR''@|$(GNULIB_RMDIR)|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''@|$(GNULIB_UNISTD_H_GETOPT)|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|@''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_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' \
              < $(srcdir)/unistd.in.h | \
          sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
              -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
@@ -1333,6 +1654,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \
              -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \
              -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \
+             -e 's|@''HAVE_FDATASYNC''@|$(HAVE_FDATASYNC)|g' \
              -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
              -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
              -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
@@ -1340,6 +1662,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
              -e 's|@''HAVE_GETLOGIN''@|$(HAVE_GETLOGIN)|g' \
              -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
+             -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \
              -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
              -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
              -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \
@@ -1349,6 +1672,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \
              -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
              -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \
+             -e 's|@''HAVE_SETHOSTNAME''@|$(HAVE_SETHOSTNAME)|g' \
              -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
              -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \
              -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \
@@ -1356,10 +1680,12 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
              -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|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' \
              -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
              -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_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' \
@@ -1369,17 +1695,20 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
              -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
              -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
+             -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \
              -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
              -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
              -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_ISATTY''@|$(REPLACE_ISATTY)|g' \
              -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
              -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
              -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \
              -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
              -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \
              -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \
+             -e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \
              -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
              -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
              -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
@@ -1402,31 +1731,6 @@ EXTRA_DIST += unistd.in.h
 
 ## end   gnulib module unistd
 
-## begin gnulib module 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/unused-parameter.h, except that it has the copyright header cut
-# off.
-unused-parameter.h: $(top_srcdir)/build/aux/unused-parameter.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/GL_UNUSED_PARAMETER/,$$p' \
-         < $(top_srcdir)/build/aux/unused-parameter.h \
-         > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += unused-parameter.h unused-parameter.h-t
-
-UNUSED_PARAMETER_H=unused-parameter.h
-
-EXTRA_DIST += $(top_srcdir)/build/aux/unused-parameter.h
-
-## end   gnulib module unused-parameter
-
 ## begin gnulib module vasnprintf
 
 
@@ -1447,28 +1751,10 @@ EXTRA_libgnu_la_SOURCES += asprintf.c vasprintf.c
 
 ## begin gnulib module verify
 
-libgnu_la_SOURCES += verify.h
 
-## end   gnulib module verify
-
-## begin gnulib module warn-on-use
+EXTRA_DIST += verify.h
 
-BUILT_SOURCES += warn-on-use.h
-# The warn-on-use.h that gets inserted into generated .h files is the same as
-# build-aux/warn-on-use.h, except that it has the copyright header cut off.
-warn-on-use.h: $(top_srcdir)/build/aux/warn-on-use.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/^.ifndef/,$$p' \
-         < $(top_srcdir)/build/aux/warn-on-use.h \
-         > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
-
-WARN_ON_USE_H=warn-on-use.h
-
-EXTRA_DIST += $(top_srcdir)/build/aux/warn-on-use.h
-
-## end   gnulib module warn-on-use
+## end   gnulib module verify
 
 ## begin gnulib module wchar
 
@@ -1476,54 +1762,55 @@ BUILT_SOURCES += wchar.h
 
 # We need the following in order to create <wchar.h> when the system
 # version does not work standalone.
-wchar.h: wchar.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+wchar.h: wchar.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|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
              -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|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/@''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' \
              < $(srcdir)/wchar.in.h | \
          sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
              -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
@@ -1605,10 +1892,11 @@ BUILT_SOURCES += wctype.h
 
 # We need the following in order to create <wctype.h> when the system
 # doesn't have one that works with the given compiler.
-wctype.h: wctype.in.h $(CXXDEFS_H) $(WARN_ON_USE_H)
+wctype.h: wctype.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/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_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' \
@@ -1625,6 +1913,7 @@ wctype.h: wctype.in.h $(CXXDEFS_H) $(WARN_ON_USE_H)
              -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
              -e 's/@''REPLACE_ISWBLANK''@/$(REPLACE_ISWBLANK)/g' \
              -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \
+             -e 's/@''REPLACE_TOWLOWER''@/$(REPLACE_TOWLOWER)/g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/wctype.in.h; \
index f3b8518..ff9e087 100644 (file)
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in 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.
 
 @SET_MAKE@
 
-# Copyright (C) 2002-2011 Free Software Foundation, Inc.
+# Copyright (C) 2002-2012 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
+# 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.
 #
-# This file is free software, distributed under the terms of the GNU
-# General Public License.  As a special exception to the GNU General
-# Public License, this file may be distributed as part of a program
-# that contains a configuration script generated by Autoconf, under
+# You should have received a copy of the GNU General Public License
+# along with this file.  If not, see <http://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
+# contains a configuration script generated by Autoconf, under
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --tests-base=gnulib/tests --aux-dir=build/aux --with-tests --lgpl=2 --libtool --macro-prefix=gl argz canonicalize-lgpl fnmatch getline getopt-gnu gitlog-to-changelog isblank locale regex safe-alloc selinux-h stpcpy stpncpy strndup sys_wait vasprintf
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --tests-base=gnulib/tests --aux-dir=build/ac-aux --with-tests --lgpl=2 --no-conditional-dependencies --libtool --macro-prefix=gl argz canonicalize-lgpl fnmatch getline getopt-gnu gitlog-to-changelog isblank locale mkstemp regex safe-alloc selinux-h stpcpy stpncpy strchrnul strndup sys_wait vasprintf
 
 
 
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -47,14 +103,15 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = gnulib/lib
-DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in alloca.c
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am alloca.c \
+       $(top_srcdir)/build/ac-aux/depcomp $(noinst_HEADERS)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/alloca.m4 \
        $(top_srcdir)/gnulib/m4/argz.m4 \
        $(top_srcdir)/gnulib/m4/btowc.m4 \
        $(top_srcdir)/gnulib/m4/canonicalize.m4 \
+       $(top_srcdir)/gnulib/m4/close.m4 \
        $(top_srcdir)/gnulib/m4/codeset.m4 \
        $(top_srcdir)/gnulib/m4/configmake.m4 \
        $(top_srcdir)/gnulib/m4/ctype.m4 \
@@ -63,24 +120,33 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/eealloc.m4 \
        $(top_srcdir)/gnulib/m4/environ.m4 \
        $(top_srcdir)/gnulib/m4/errno_h.m4 \
+       $(top_srcdir)/gnulib/m4/exponentd.m4 \
        $(top_srcdir)/gnulib/m4/extensions.m4 \
        $(top_srcdir)/gnulib/m4/fcntl-o.m4 \
        $(top_srcdir)/gnulib/m4/fcntl_h.m4 \
+       $(top_srcdir)/gnulib/m4/fdopen.m4 \
        $(top_srcdir)/gnulib/m4/float_h.m4 \
        $(top_srcdir)/gnulib/m4/fnmatch.m4 \
+       $(top_srcdir)/gnulib/m4/fpieee.m4 \
+       $(top_srcdir)/gnulib/m4/fstat.m4 \
+       $(top_srcdir)/gnulib/m4/getcwd.m4 \
        $(top_srcdir)/gnulib/m4/getdelim.m4 \
        $(top_srcdir)/gnulib/m4/getline.m4 \
        $(top_srcdir)/gnulib/m4/getopt.m4 \
        $(top_srcdir)/gnulib/m4/getpagesize.m4 \
+       $(top_srcdir)/gnulib/m4/gettimeofday.m4 \
        $(top_srcdir)/gnulib/m4/glibc21.m4 \
        $(top_srcdir)/gnulib/m4/gnulib-common.m4 \
        $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \
        $(top_srcdir)/gnulib/m4/include_next.m4 \
        $(top_srcdir)/gnulib/m4/intlmacosx.m4 \
        $(top_srcdir)/gnulib/m4/intmax_t.m4 \
+       $(top_srcdir)/gnulib/m4/inttypes-pri.m4 \
+       $(top_srcdir)/gnulib/m4/inttypes.m4 \
        $(top_srcdir)/gnulib/m4/inttypes_h.m4 \
        $(top_srcdir)/gnulib/m4/isblank.m4 \
        $(top_srcdir)/gnulib/m4/langinfo_h.m4 \
+       $(top_srcdir)/gnulib/m4/largefile.m4 \
        $(top_srcdir)/gnulib/m4/lcmessage.m4 \
        $(top_srcdir)/gnulib/m4/lib-ld.m4 \
        $(top_srcdir)/gnulib/m4/lib-link.m4 \
@@ -92,6 +158,7 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/locale-tr.m4 \
        $(top_srcdir)/gnulib/m4/locale-zh.m4 \
        $(top_srcdir)/gnulib/m4/locale_h.m4 \
+       $(top_srcdir)/gnulib/m4/localeconv.m4 \
        $(top_srcdir)/gnulib/m4/localename.m4 \
        $(top_srcdir)/gnulib/m4/lock.m4 \
        $(top_srcdir)/gnulib/m4/longlong.m4 \
@@ -109,15 +176,21 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/mbtowc.m4 \
        $(top_srcdir)/gnulib/m4/memchr.m4 \
        $(top_srcdir)/gnulib/m4/mempcpy.m4 \
+       $(top_srcdir)/gnulib/m4/mkstemp.m4 \
        $(top_srcdir)/gnulib/m4/mmap-anon.m4 \
        $(top_srcdir)/gnulib/m4/mode_t.m4 \
+       $(top_srcdir)/gnulib/m4/msvc-inval.m4 \
+       $(top_srcdir)/gnulib/m4/msvc-nothrow.m4 \
        $(top_srcdir)/gnulib/m4/multiarch.m4 \
        $(top_srcdir)/gnulib/m4/nl_langinfo.m4 \
+       $(top_srcdir)/gnulib/m4/nocrash.m4 \
+       $(top_srcdir)/gnulib/m4/off_t.m4 \
        $(top_srcdir)/gnulib/m4/onceonly.m4 \
        $(top_srcdir)/gnulib/m4/open.m4 \
        $(top_srcdir)/gnulib/m4/pathmax.m4 \
        $(top_srcdir)/gnulib/m4/printf.m4 \
        $(top_srcdir)/gnulib/m4/putenv.m4 \
+       $(top_srcdir)/gnulib/m4/rawmemchr.m4 \
        $(top_srcdir)/gnulib/m4/readlink.m4 \
        $(top_srcdir)/gnulib/m4/realloc.m4 \
        $(top_srcdir)/gnulib/m4/regex.m4 \
@@ -137,13 +210,18 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/stdlib_h.m4 \
        $(top_srcdir)/gnulib/m4/stpcpy.m4 \
        $(top_srcdir)/gnulib/m4/stpncpy.m4 \
+       $(top_srcdir)/gnulib/m4/strchrnul.m4 \
        $(top_srcdir)/gnulib/m4/string_h.m4 \
        $(top_srcdir)/gnulib/m4/strndup.m4 \
        $(top_srcdir)/gnulib/m4/strnlen.m4 \
        $(top_srcdir)/gnulib/m4/strstr.m4 \
        $(top_srcdir)/gnulib/m4/symlink.m4 \
+       $(top_srcdir)/gnulib/m4/sys_socket_h.m4 \
        $(top_srcdir)/gnulib/m4/sys_stat_h.m4 \
+       $(top_srcdir)/gnulib/m4/sys_time_h.m4 \
+       $(top_srcdir)/gnulib/m4/sys_types_h.m4 \
        $(top_srcdir)/gnulib/m4/sys_wait_h.m4 \
+       $(top_srcdir)/gnulib/m4/tempname.m4 \
        $(top_srcdir)/gnulib/m4/thread.m4 \
        $(top_srcdir)/gnulib/m4/threadlib.m4 \
        $(top_srcdir)/gnulib/m4/time_h.m4 \
@@ -170,16 +248,30 @@ CONFIG_CLEAN_VPATH_FILES =
 LIBRARIES = $(noinst_LIBRARIES)
 LTLIBRARIES = $(noinst_LTLIBRARIES)
 am__DEPENDENCIES_1 =
-am_libgnu_la_OBJECTS = localcharset.lo malloca.lo strnlen1.lo
+am_libgnu_la_OBJECTS = localcharset.lo malloca.lo safe-alloc.lo \
+       strnlen1.lo tempname.lo
 libgnu_la_OBJECTS = $(am_libgnu_la_OBJECTS)
-AM_V_lt = $(am__v_lt_$(V))
-am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+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 = 
 libgnu_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(libgnu_la_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/build/aux/depcomp
+depcomp = $(SHELL) $(top_srcdir)/build/ac-aux/depcomp
 am__depfiles_maybe = depfiles
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -188,37 +280,59 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
        $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
        $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_$(V))
-am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
-am__v_CC_0 = @echo "  CC    " $@;
-AM_V_at = $(am__v_at_$(V))
-am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
-am__v_at_0 = @
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_$(V))
-am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
-am__v_CCLD_0 = @echo "  CCLD  " $@;
-AM_V_GEN = $(am__v_GEN_$(V))
-am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
-am__v_GEN_0 = @echo "  GEN   " $@;
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
 SOURCES = $(libgnu_la_SOURCES) $(EXTRA_libgnu_la_SOURCES)
 DIST_SOURCES = $(libgnu_la_SOURCES) $(EXTRA_libgnu_la_SOURCES)
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-       html-recursive info-recursive install-data-recursive \
-       install-dvi-recursive install-exec-recursive \
-       install-html-recursive install-info-recursive \
-       install-pdf-recursive install-ps-recursive install-recursive \
-       installcheck-recursive installdirs-recursive pdf-recursive \
-       ps-recursive uninstall-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+       ctags-recursive dvi-recursive html-recursive info-recursive \
+       install-data-recursive install-dvi-recursive \
+       install-exec-recursive install-html-recursive \
+       install-info-recursive install-pdf-recursive \
+       install-ps-recursive install-recursive installcheck-recursive \
+       installdirs-recursive pdf-recursive ps-recursive \
+       tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 HEADERS = $(noinst_HEADERS)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
   distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-       $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
        distdir
+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
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
@@ -256,6 +370,7 @@ AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 AR = @AR@
+ARFLAGS = @ARFLAGS@
 ARGZ_H = @ARGZ_H@
 AUGEAS_CFLAGS = @AUGEAS_CFLAGS@
 AUTOCONF = @AUTOCONF@
@@ -299,9 +414,11 @@ GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
 GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
+GNULIB_CHDIR = @GNULIB_CHDIR@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
+GNULIB_DUP = @GNULIB_DUP@
 GNULIB_DUP2 = @GNULIB_DUP2@
 GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
@@ -313,16 +430,25 @@ 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_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FFSL = @GNULIB_FFSL@
+GNULIB_FFSLL = @GNULIB_FFSLL@
+GNULIB_FGETC = @GNULIB_FGETC@
+GNULIB_FGETS = @GNULIB_FGETS@
 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_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@
@@ -330,6 +456,8 @@ 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@
@@ -342,8 +470,14 @@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
 GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
+GNULIB_IMAXABS = @GNULIB_IMAXABS@
+GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
+GNULIB_ISATTY = @GNULIB_ISATTY@
 GNULIB_ISBLANK = @GNULIB_ISBLANK@
 GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
 GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
@@ -351,6 +485,7 @@ GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
 GNULIB_LINKAT = @GNULIB_LINKAT@
+GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
@@ -391,25 +526,31 @@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
 GNULIB_MKTIME = @GNULIB_MKTIME@
 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_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_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
 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_RANDOM = @GNULIB_RANDOM@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
 GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
+GNULIB_READ = @GNULIB_READ@
 GNULIB_READLINK = @GNULIB_READLINK@
 GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
@@ -419,12 +560,15 @@ GNULIB_RENAME = @GNULIB_RENAME@
 GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
 GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
+GNULIB_SCANF = @GNULIB_SCANF@
 GNULIB_SETENV = @GNULIB_SETENV@
+GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
 GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
 GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
 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@
@@ -442,9 +586,11 @@ 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@
@@ -454,7 +600,7 @@ GNULIB_TIME_R = @GNULIB_TIME_R@
 GNULIB_TMPFILE = @GNULIB_TMPFILE@
 GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
 GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
-GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
+GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
 GNULIB_UNLINK = @GNULIB_UNLINK@
 GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
@@ -466,8 +612,10 @@ 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@
@@ -516,6 +664,7 @@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
 HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
 HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
 HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
 HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
@@ -526,18 +675,23 @@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 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_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
 HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
 HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
@@ -553,7 +707,10 @@ HAVE_FCHDIR = @HAVE_FCHDIR@
 HAVE_FCHMODAT = @HAVE_FCHMODAT@
 HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
 HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
 HAVE_FSEEKO = @HAVE_FSEEKO@
 HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
@@ -567,7 +724,9 @@ HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
 HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
 HAVE_ISBLANK = @HAVE_ISBLANK@
 HAVE_ISWBLANK = @HAVE_ISWBLANK@
@@ -601,15 +760,21 @@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
 HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
 HAVE_MKSTEMP = @HAVE_MKSTEMP@
 HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
 HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OPENAT = @HAVE_OPENAT@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
 HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
 HAVE_PREAD = @HAVE_PREAD@
 HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
 HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_RANDOM = @HAVE_RANDOM@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
 HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -619,6 +784,7 @@ HAVE_REALPATH = @HAVE_REALPATH@
 HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
 HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
@@ -635,6 +801,7 @@ HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
 HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
 HAVE_SYMLINK = @HAVE_SYMLINK@
 HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
@@ -642,6 +809,7 @@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
 HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
 HAVE_TIMEGM = @HAVE_TIMEGM@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
@@ -683,6 +851,7 @@ HAVE_WCSXFRM = @HAVE_WCSXFRM@
 HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
 HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
 HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WMEMCHR = @HAVE_WMEMCHR@
 HAVE_WMEMCMP = @HAVE_WMEMCMP@
@@ -699,6 +868,8 @@ INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 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@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
@@ -744,6 +915,7 @@ 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_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
 NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
 NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H = @NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H@
@@ -753,6 +925,8 @@ 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_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_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@
@@ -763,6 +937,7 @@ 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_INTTYPES_H = @NEXT_INTTYPES_H@
 NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_LOCALE_H = @NEXT_LOCALE_H@
 NEXT_SELINUX_SELINUX_H = @NEXT_SELINUX_SELINUX_H@
@@ -772,6 +947,8 @@ NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
 NEXT_STRING_H = @NEXT_STRING_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_WAIT_H = @NEXT_SYS_WAIT_H@
 NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
@@ -798,6 +975,8 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 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@
@@ -814,6 +993,7 @@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
 REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
@@ -825,6 +1005,7 @@ REPLACE_FSTAT = @REPLACE_FSTAT@
 REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
 REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
 REPLACE_GETDELIM = @REPLACE_GETDELIM@
@@ -833,11 +1014,15 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISATTY = @REPLACE_ISATTY@
 REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ITOLD = @REPLACE_ITOLD@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
 REPLACE_LINK = @REPLACE_LINK@
 REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALECONV = @REPLACE_LOCALECONV@
 REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
@@ -866,8 +1051,11 @@ REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
 REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
 REPLACE_REALLOC = @REPLACE_REALLOC@
 REPLACE_REALPATH = @REPLACE_REALPATH@
@@ -881,9 +1069,11 @@ REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
 REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
 REPLACE_STPNCPY = @REPLACE_STPNCPY@
 REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
 REPLACE_STRDUP = @REPLACE_STRDUP@
 REPLACE_STRERROR = @REPLACE_STRERROR@
 REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
@@ -893,10 +1083,14 @@ REPLACE_STRNLEN = @REPLACE_STRNLEN@
 REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
 REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
 REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
+REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
 REPLACE_SYMLINK = @REPLACE_SYMLINK@
 REPLACE_TIMEGM = @REPLACE_TIMEGM@
 REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
 REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
 REPLACE_UNLINK = @REPLACE_UNLINK@
 REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
@@ -929,6 +1123,8 @@ STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+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_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
@@ -936,6 +1132,8 @@ VERSION = @VERSION@
 VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@
 WARN_CFLAGS = @WARN_CFLAGS@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 YACC = @YACC@
 YFLAGS = @YFLAGS@
@@ -1003,29 +1201,33 @@ SUBDIRS =
 noinst_HEADERS = 
 noinst_LIBRARIES = 
 noinst_LTLIBRARIES = libgnu.la
-EXTRA_DIST = alloca.c alloca.in.h \
-       $(top_srcdir)/build/aux/arg-nonnull.h argz.c argz.in.h btowc.c \
-       $(top_srcdir)/build/aux/c++defs.h canonicalize-lgpl.c \
-       ctype.in.h dosname.h errno.in.h float.in.h fnmatch.c \
-       fnmatch.in.h fnmatch_loop.c getdelim.c getline.c getopt.c \
-       getopt.in.h getopt1.c getopt_int.h \
-       $(top_srcdir)/build/aux/gitlog-to-changelog isblank.c \
+EXTRA_DIST = alloca.c alloca.in.h argz.c argz.in.h btowc.c \
+       canonicalize-lgpl.c ctype.in.h dosname.h errno.in.h fcntl.in.h \
+       float.c float.in.h itold.c fnmatch.c fnmatch.in.h \
+       fnmatch_loop.c getdelim.c getline.c getopt.c getopt.in.h \
+       getopt1.c getopt_int.h gettimeofday.c \
+       $(top_srcdir)/build/ac-aux/gitlog-to-changelog isblank.c \
        langinfo.in.h config.charset ref-add.sin ref-del.sin \
-       locale.in.h lstat.c malloc.c malloc.c malloca.h \
+       locale.in.h localeconv.c lstat.c malloc.c malloc.c malloca.h \
        malloca.valgrind mbrtowc.c mbsinit.c mbsrtowcs-impl.h \
        mbsrtowcs-state.c mbsrtowcs.c mbtowc-impl.h mbtowc.c memchr.c \
-       memchr.valgrind mempcpy.c nl_langinfo.c pathmax.h readlink.c \
-       realloc.c regcomp.c regex.c regex.h regex_internal.c \
-       regex_internal.h regexec.c safe-alloc.c safe-alloc.h \
-       getfilecon.c stat.c stdbool.in.h stddef.in.h stdint.in.h \
-       stdio.in.h stdlib.in.h stpcpy.c stpncpy.c streq.h string.in.h \
-       strndup.c strnlen.c str-two-way.h strstr.c sys_stat.in.h \
-       sys_wait.in.h time.in.h unistd.in.h \
-       $(top_srcdir)/build/aux/unused-parameter.h 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/warn-on-use.h wchar.in.h \
-       wcrtomb.c wctype.in.h
+       memchr.valgrind mempcpy.c mkstemp.c nl_langinfo.c pathmax.h \
+       rawmemchr.c rawmemchr.valgrind readlink.c realloc.c regcomp.c \
+       regex.c regex.h regex_internal.c regex_internal.h regexec.c \
+       safe-alloc.h getfilecon.c \
+       $(top_srcdir)/build/ac-aux/snippet/_Noreturn.h \
+       $(top_srcdir)/build/ac-aux/snippet/arg-nonnull.h \
+       $(top_srcdir)/build/ac-aux/snippet/c++defs.h \
+       $(top_srcdir)/build/ac-aux/snippet/unused-parameter.h \
+       $(top_srcdir)/build/ac-aux/snippet/warn-on-use.h stat.c \
+       stdbool.in.h stddef.in.h stdint.in.h stdio.in.h stdlib.in.h \
+       stpcpy.c stpncpy.c strchrnul.c strchrnul.valgrind streq.h \
+       string.in.h strndup.c strnlen.c str-two-way.h strstr.c \
+       sys_stat.in.h sys_time.in.h sys_types.in.h sys_wait.in.h \
+       tempname.h time.in.h unistd.in.h asnprintf.c float+.h \
+       printf-args.c printf-args.h printf-parse.c printf-parse.h \
+       vasnprintf.c vasnprintf.h asprintf.c vasprintf.c verify.h \
+       wchar.in.h wcrtomb.c wctype.in.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
@@ -1041,24 +1243,26 @@ EXTRA_DIST = alloca.c alloca.in.h \
 # 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) arg-nonnull.h $(ARGZ_H) c++defs.h \
-       configmake.h ctype.h $(ERRNO_H) $(FLOAT_H) $(FNMATCH_H) \
-       $(GETOPT_H) langinfo.h locale.h selinux/selinux.h \
-       $(SELINUX_CONTEXT_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) \
-       stdio.h stdlib.h string.h sys/stat.h sys/wait.h time.h \
-       unistd.h unused-parameter.h warn-on-use.h wchar.h wctype.h
+BUILT_SOURCES = $(ALLOCA_H) $(ARGZ_H) configmake.h ctype.h $(ERRNO_H) \
+       fcntl.h $(FLOAT_H) $(FNMATCH_H) $(GETOPT_H) langinfo.h \
+       locale.h selinux/selinux.h $(SELINUX_CONTEXT_H) arg-nonnull.h \
+       c++defs.h unused-parameter.h warn-on-use.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
 SUFFIXES = .sed .sin
-MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t arg-nonnull.h \
-       arg-nonnull.h-t argz.h argz.h-t c++defs.h c++defs.h-t ctype.h \
-       ctype.h-t errno.h errno.h-t float.h float.h-t fnmatch.h \
-       fnmatch.h-t getopt.h getopt.h-t langinfo.h langinfo.h-t \
-       locale.h locale.h-t selinux/selinux.h selinux/selinux.h-t \
-       selinux/context.h selinux/context.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/wait.h sys/wait.h-t time.h time.h-t unistd.h \
-       unistd.h-t unused-parameter.h unused-parameter.h-t \
-       warn-on-use.h warn-on-use.h-t wchar.h wchar.h-t wctype.h \
+MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t argz.h \
+       argz.h-t ctype.h ctype.h-t errno.h errno.h-t fcntl.h fcntl.h-t \
+       float.h float.h-t fnmatch.h fnmatch.h-t getopt.h getopt.h-t \
+       langinfo.h langinfo.h-t locale.h locale.h-t selinux/selinux.h \
+       selinux/selinux.h-t selinux/context.h selinux/context.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 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
 MOSTLYCLEANDIRS = selinux sys sys
 CLEANFILES = configmake.h configmake.h-t charset.alias ref-add.sed \
@@ -1068,25 +1272,31 @@ MAINTAINERCLEANFILES =
 AM_CPPFLAGS = 
 AM_CFLAGS = 
 libgnu_la_SOURCES = gettext.h localcharset.h localcharset.c malloca.c \
-       se-context.in.h se-selinux.in.h size_max.h strnlen1.h \
-       strnlen1.c verify.h xsize.h
+       safe-alloc.c se-context.in.h se-selinux.in.h size_max.h \
+       strnlen1.h strnlen1.c tempname.c xsize.h
 libgnu_la_LIBADD = $(gl_LTLIBOBJS) @LTALLOCA@
 libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS) @LTALLOCA@
 EXTRA_libgnu_la_SOURCES = alloca.c argz.c btowc.c canonicalize-lgpl.c \
-       fnmatch.c fnmatch_loop.c getdelim.c getline.c getopt.c \
-       getopt1.c isblank.c lstat.c malloc.c malloc.c mbrtowc.c \
-       mbsinit.c mbsrtowcs-state.c mbsrtowcs.c mbtowc.c memchr.c \
-       mempcpy.c nl_langinfo.c readlink.c realloc.c regcomp.c regex.c \
-       regex_internal.c regexec.c safe-alloc.c getfilecon.c stat.c \
-       stpcpy.c stpncpy.c strndup.c strnlen.c strstr.c asnprintf.c \
-       printf-args.c printf-parse.c vasnprintf.c asprintf.c \
-       vasprintf.c wcrtomb.c
+       float.c itold.c fnmatch.c fnmatch_loop.c getdelim.c getline.c \
+       getopt.c getopt1.c gettimeofday.c isblank.c localeconv.c \
+       lstat.c malloc.c malloc.c mbrtowc.c mbsinit.c \
+       mbsrtowcs-state.c mbsrtowcs.c mbtowc.c memchr.c mempcpy.c \
+       mkstemp.c nl_langinfo.c rawmemchr.c readlink.c realloc.c \
+       regcomp.c regex.c regex_internal.c regexec.c getfilecon.c \
+       stat.c stpcpy.c stpncpy.c strchrnul.c strndup.c strnlen.c \
+       strstr.c asnprintf.c printf-args.c printf-parse.c vasnprintf.c \
+       asprintf.c vasprintf.c wcrtomb.c
 libgnu_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(LIB_SELINUX) \
        $(LTLIBINTL)
-ARG_NONNULL_H = arg-nonnull.h
-CXXDEFS_H = c++defs.h
 charset_alias = $(DESTDIR)$(libdir)/charset.alias
 charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all Makefile.am that
+# need it. This is ensured by the applicability 'all' defined above.
+_NORETURN_H = $(top_srcdir)/build/ac-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
 all: $(BUILT_SOURCES)
@@ -1130,13 +1340,16 @@ clean-noinstLIBRARIES:
 
 clean-noinstLTLIBRARIES:
        -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
-       @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
-         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-         test "$$dir" != "$$p" || dir=.; \
-         echo "rm -f \"$${dir}/so_locations\""; \
-         rm -f "$${dir}/so_locations"; \
-       done
-libgnu.la: $(libgnu_la_OBJECTS) $(libgnu_la_DEPENDENCIES) 
+       @list='$(noinst_LTLIBRARIES)'; \
+       locs=`for p in $$list; do echo $$p; done | \
+             sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+             sort -u`; \
+       test -z "$$locs" || { \
+         echo rm -f $${locs}; \
+         rm -f $${locs}; \
+       }
+
+libgnu.la: $(libgnu_la_OBJECTS) $(libgnu_la_DEPENDENCIES) $(EXTRA_libgnu_la_DEPENDENCIES) 
        $(AM_V_CCLD)$(libgnu_la_LINK)  $(libgnu_la_OBJECTS) $(libgnu_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -1152,6 +1365,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asprintf.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btowc.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/canonicalize-lgpl.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/float.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fnmatch.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fnmatch_loop.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdelim.Plo@am__quote@
@@ -1159,8 +1373,11 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getline.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettimeofday.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isblank.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/itold.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localcharset.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localeconv.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloca.Plo@am__quote@
@@ -1171,9 +1388,11 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbtowc.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memchr.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mempcpy.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkstemp.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nl_langinfo.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-args.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-parse.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rawmemchr.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/realloc.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regcomp.Plo@am__quote@
@@ -1184,10 +1403,12 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stpcpy.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stpncpy.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strchrnul.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strndup.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strnlen.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strnlen1.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strstr.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tempname.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasnprintf.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasprintf.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wcrtomb.Plo@am__quote@
@@ -1195,26 +1416,23 @@ distclean-compile:
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
 
 .c.obj:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
 
 mostlyclean-libtool:
        -rm -f *.lo
@@ -1223,22 +1441,25 @@ clean-libtool:
        -rm -rf .libs _libs
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-       @fail= failcom='exit 1'; \
-       for f in x $$MAKEFLAGS; do \
-         case $$f in \
-           *=* | --[!k]*);; \
-           *k*) failcom='fail=yes';; \
-         esac; \
-       done; \
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+       @fail=; \
+       if $(am__make_keepgoing); then \
+         failcom='fail=yes'; \
+       else \
+         failcom='exit 1'; \
+       fi; \
        dot_seen=no; \
        target=`echo $@ | sed s/-recursive//`; \
-       list='$(SUBDIRS)'; for subdir in $$list; do \
+       case "$@" in \
+         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+         *) list='$(SUBDIRS)' ;; \
+       esac; \
+       for subdir in $$list; do \
          echo "Making $$target in $$subdir"; \
          if test "$$subdir" = "."; then \
            dot_seen=yes; \
@@ -1253,57 +1474,12 @@ $(RECURSIVE_TARGETS):
          $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
        fi; test -z "$$fail"
 
-$(RECURSIVE_CLEAN_TARGETS):
-       @fail= failcom='exit 1'; \
-       for f in x $$MAKEFLAGS; do \
-         case $$f in \
-           *=* | --[!k]*);; \
-           *k*) failcom='fail=yes';; \
-         esac; \
-       done; \
-       dot_seen=no; \
-       case "$@" in \
-         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-         *) list='$(SUBDIRS)' ;; \
-       esac; \
-       rev=''; for subdir in $$list; do \
-         if test "$$subdir" = "."; then :; else \
-           rev="$$subdir $$rev"; \
-         fi; \
-       done; \
-       rev="$$rev ."; \
-       target=`echo $@ | sed s/-recursive//`; \
-       for subdir in $$rev; do \
-         echo "Making $$target in $$subdir"; \
-         if test "$$subdir" = "."; then \
-           local_target="$$target-am"; \
-         else \
-           local_target="$$target"; \
-         fi; \
-         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-         || eval $$failcom; \
-       done && test -z "$$fail"
-tags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-       done
-ctags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-       done
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
        if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -1319,12 +1495,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
          fi; \
        done; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -1336,15 +1507,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -1353,6 +1520,21 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
 
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -1389,13 +1571,10 @@ distdir: $(DISTFILES)
        done
        @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
          if test "$$subdir" = .; then :; else \
-           test -d "$(distdir)/$$subdir" \
-           || $(MKDIR_P) "$(distdir)/$$subdir" \
-           || exit 1; \
-         fi; \
-       done
-       @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-         if test "$$subdir" = .; then :; else \
+           $(am__make_dryrun) \
+             || test -d "$(distdir)/$$subdir" \
+             || $(MKDIR_P) "$(distdir)/$$subdir" \
+             || exit 1; \
            dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
            $(am__relativize); \
            new_distdir=$$reldir; \
@@ -1432,10 +1611,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
 mostlyclean-generic:
        -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
 
@@ -1523,60 +1707,47 @@ ps-am:
 
 uninstall-am: uninstall-local
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \
-       ctags-recursive install install-am install-strip \
-       tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-       all all-am all-local check check-am clean clean-generic \
-       clean-libtool clean-noinstLIBRARIES clean-noinstLTLIBRARIES \
-       ctags ctags-recursive distclean distclean-compile \
-       distclean-generic distclean-libtool 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 \
+.MAKE: $(am__recursive_targets) all check install install-am \
+       install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \
+       check check-am clean clean-generic clean-libtool \
+       clean-noinstLIBRARIES clean-noinstLTLIBRARIES cscopelist-am \
+       ctags ctags-am distclean distclean-compile distclean-generic \
+       distclean-libtool 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 \
        installdirs-am maintainer-clean maintainer-clean-generic \
        mostlyclean mostlyclean-compile mostlyclean-generic \
        mostlyclean-libtool mostlyclean-local pdf pdf-am ps ps-am tags \
-       tags-recursive uninstall uninstall-am uninstall-local
+       tags-am uninstall uninstall-am uninstall-local
 
 
 # We need the following in order to create <alloca.h> when the system
 # doesn't have one that works with the given compiler.
-alloca.h: alloca.in.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         cat $(srcdir)/alloca.in.h; \
-       } > $@-t && \
-       mv -f $@-t $@
-# The arg-nonnull.h that gets inserted into generated .h files is the same as
-# build-aux/arg-nonnull.h, except that it has the copyright header cut off.
-arg-nonnull.h: $(top_srcdir)/build/aux/arg-nonnull.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/GL_ARG_NONNULL/,$$p' \
-         < $(top_srcdir)/build/aux/arg-nonnull.h \
-         > $@-t && \
-       mv $@-t $@
+@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@    } > $@-t && \
+@GL_GENERATE_ALLOCA_H_TRUE@    mv -f $@-t $@
+@GL_GENERATE_ALLOCA_H_FALSE@alloca.h: $(top_builddir)/config.status
+@GL_GENERATE_ALLOCA_H_FALSE@   rm -f $@
 
 # We need the following in order to create <argz.h> when the system
 # doesn't have one that works with the given compiler.
-argz.h: argz.in.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         cat $(srcdir)/argz.in.h; \
-       } > $@-t && \
-       mv -f $@-t $@
-# The c++defs.h that gets inserted into generated .h files is the same as
-# build-aux/c++defs.h, except that it has the copyright header cut off.
-c++defs.h: $(top_srcdir)/build/aux/c++defs.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/_GL_CXXDEFS/,$$p' \
-         < $(top_srcdir)/build/aux/c++defs.h \
-         > $@-t && \
-       mv $@-t $@
+@GL_GENERATE_ARGZ_H_TRUE@argz.h: argz.in.h $(top_builddir)/config.status
+@GL_GENERATE_ARGZ_H_TRUE@      $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_ARGZ_H_TRUE@      { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+@GL_GENERATE_ARGZ_H_TRUE@        cat $(srcdir)/argz.in.h; \
+@GL_GENERATE_ARGZ_H_TRUE@      } > $@-t && \
+@GL_GENERATE_ARGZ_H_TRUE@      mv -f $@-t $@
+@GL_GENERATE_ARGZ_H_FALSE@argz.h: $(top_builddir)/config.status
+@GL_GENERATE_ARGZ_H_FALSE@     rm -f $@
 
 # Listed in the same order as the GNU makefile conventions, and
 # provided by autoconf 2.59c+.
@@ -1613,18 +1784,15 @@ configmake.h: Makefile
          echo '#define PKGLIBDIR "$(pkglibdir)"'; \
          echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \
        } | sed '/""/d' > $@-t && \
-       if test -f $@ && cmp $@-t $@ > /dev/null; then \
-         rm -f $@-t; \
-       else \
-         rm -f $@; mv $@-t $@; \
-       fi
+       mv -f $@-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 $(CXXDEFS_H) $(WARN_ON_USE_H)
+ctype.h: ctype.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|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_CTYPE_H''@|$(NEXT_CTYPE_H)|g' \
@@ -1638,52 +1806,88 @@ ctype.h: ctype.in.h $(CXXDEFS_H) $(WARN_ON_USE_H)
 
 # We need the following in order to create <errno.h> when the system
 # doesn't have one that is POSIX compliant.
-errno.h: errno.in.h
+@GL_GENERATE_ERRNO_H_TRUE@errno.h: errno.in.h $(top_builddir)/config.status
+@GL_GENERATE_ERRNO_H_TRUE@     $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_ERRNO_H_TRUE@     { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+@GL_GENERATE_ERRNO_H_TRUE@       sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_ERRNO_H_TRUE@           -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@           -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_ERRNO_H_TRUE@           -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_ERRNO_H_TRUE@           -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@           -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@           -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@           -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@           -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@           -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@           -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@           < $(srcdir)/errno.in.h; \
+@GL_GENERATE_ERRNO_H_TRUE@     } > $@-t && \
+@GL_GENERATE_ERRNO_H_TRUE@     mv $@-t $@
+@GL_GENERATE_ERRNO_H_FALSE@errno.h: $(top_builddir)/config.status
+@GL_GENERATE_ERRNO_H_FALSE@    rm -f $@
+
+# We need the following in order to create <fcntl.h> when the system
+# doesn't have one that works with the given compiler.
+fcntl.h: fcntl.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|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
-             -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \
-             -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \
-             -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \
-             -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \
-             -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
-             -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
-             < $(srcdir)/errno.in.h; \
+             -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|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
+             -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
+             -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \
+             -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
+             -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|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)/fcntl.in.h; \
        } > $@-t && \
        mv $@-t $@
 
 # We need the following in order to create <float.h> when the system
 # doesn't have one that works with the given compiler.
-float.h: float.in.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -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_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
-             < $(srcdir)/float.in.h; \
-       } > $@-t && \
-       mv $@-t $@
+@GL_GENERATE_FLOAT_H_TRUE@float.h: float.in.h $(top_builddir)/config.status
+@GL_GENERATE_FLOAT_H_TRUE@     $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_FLOAT_H_TRUE@     { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+@GL_GENERATE_FLOAT_H_TRUE@       sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_FLOAT_H_TRUE@           -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_FLOAT_H_TRUE@           -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_FLOAT_H_TRUE@           -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_FLOAT_H_TRUE@           -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
+@GL_GENERATE_FLOAT_H_TRUE@           -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \
+@GL_GENERATE_FLOAT_H_TRUE@           < $(srcdir)/float.in.h; \
+@GL_GENERATE_FLOAT_H_TRUE@     } > $@-t && \
+@GL_GENERATE_FLOAT_H_TRUE@     mv $@-t $@
+@GL_GENERATE_FLOAT_H_FALSE@float.h: $(top_builddir)/config.status
+@GL_GENERATE_FLOAT_H_FALSE@    rm -f $@
 
 # We need the following in order to create <fnmatch.h> when the system
 # doesn't have one that supports the required API.
-fnmatch.h: fnmatch.in.h $(ARG_NONNULL_H)
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-             < $(srcdir)/fnmatch.in.h; \
-       } > $@-t && \
-       mv -f $@-t $@
+@GL_GENERATE_FNMATCH_H_TRUE@fnmatch.h: fnmatch.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
+@GL_GENERATE_FNMATCH_H_TRUE@   $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_FNMATCH_H_TRUE@   { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+@GL_GENERATE_FNMATCH_H_TRUE@     sed -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+@GL_GENERATE_FNMATCH_H_TRUE@         < $(srcdir)/fnmatch.in.h; \
+@GL_GENERATE_FNMATCH_H_TRUE@   } > $@-t && \
+@GL_GENERATE_FNMATCH_H_TRUE@   mv -f $@-t $@
+@GL_GENERATE_FNMATCH_H_FALSE@fnmatch.h: $(top_builddir)/config.status
+@GL_GENERATE_FNMATCH_H_FALSE@  rm -f $@
 
 # We need the following in order to create <getopt.h> when the system
 # doesn't have one that works with the given compiler.
-getopt.h: getopt.in.h $(ARG_NONNULL_H)
+getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_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' \
@@ -1695,15 +1899,16 @@ getopt.h: getopt.in.h $(ARG_NONNULL_H)
 
 # 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 $(CXXDEFS_H) $(WARN_ON_USE_H)
+langinfo.h: langinfo.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|@''HAVE_LANGINFO_H''@|$(HAVE_LANGINFO_H)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''HAVE_LANGINFO_H''@|$(HAVE_LANGINFO_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_LANGINFO_H''@|$(NEXT_LANGINFO_H)|g' \
-             -e 's|@''GNULIB_NL_LANGINFO''@|$(GNULIB_NL_LANGINFO)|g' \
+             -e 's/@''GNULIB_NL_LANGINFO''@/$(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_ERA''@|$(HAVE_LANGINFO_ERA)|g' \
@@ -1777,30 +1982,35 @@ charset.alias: config.charset
 
 # 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 $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+locale.h: locale.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|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_LOCALE_H''@|$(NEXT_LOCALE_H)|g' \
-             -e 's|@''GNULIB_SETLOCALE''@|$(GNULIB_SETLOCALE)|g' \
-             -e 's|@''GNULIB_DUPLOCALE''@|$(GNULIB_DUPLOCALE)|g' \
+             -e 's/@''GNULIB_LOCALECONV''@/$(GNULIB_LOCALECONV)/g' \
+             -e 's/@''GNULIB_SETLOCALE''@/$(GNULIB_SETLOCALE)/g' \
+             -e 's/@''GNULIB_DUPLOCALE''@/$(GNULIB_DUPLOCALE)/g' \
              -e 's|@''HAVE_DUPLOCALE''@|$(HAVE_DUPLOCALE)|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_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \
+             -e 's|@''REPLACE_STRUCT_LCONV''@|$(REPLACE_STRUCT_LCONV)|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)/locale.in.h; \
        } > $@-t && \
        mv $@-t $@
-selinux/selinux.h: se-selinux.in.h $(UNUSED_PARAMETER_H)
+selinux/selinux.h: se-selinux.in.h $(top_builddir)/config.status $(UNUSED_PARAMETER_H)
        $(AM_V_at)$(MKDIR_P) selinux
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_SELINUX_SELINUX_H''@|$(NEXT_SELINUX_SELINUX_H)|g' \
@@ -1809,125 +2019,183 @@ selinux/selinux.h: se-selinux.in.h $(UNUSED_PARAMETER_H)
        } > $@-t && \
        chmod a-x $@-t && \
        mv $@-t $@
-selinux/context.h: se-context.in.h $(UNUSED_PARAMETER_H)
-       $(AM_V_at)$(MKDIR_P) selinux
+@GL_GENERATE_SELINUX_CONTEXT_H_TRUE@selinux/context.h: se-context.in.h $(top_builddir)/config.status $(UNUSED_PARAMETER_H)
+@GL_GENERATE_SELINUX_CONTEXT_H_TRUE@   $(AM_V_at)$(MKDIR_P) selinux
+@GL_GENERATE_SELINUX_CONTEXT_H_TRUE@   $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_SELINUX_CONTEXT_H_TRUE@   { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+@GL_GENERATE_SELINUX_CONTEXT_H_TRUE@     sed -e '/definition of _GL_UNUSED_PARAMETER/r $(UNUSED_PARAMETER_H)' \
+@GL_GENERATE_SELINUX_CONTEXT_H_TRUE@         < $(srcdir)/se-context.in.h; \
+@GL_GENERATE_SELINUX_CONTEXT_H_TRUE@   } > $@-t && \
+@GL_GENERATE_SELINUX_CONTEXT_H_TRUE@   chmod a-x $@-t && \
+@GL_GENERATE_SELINUX_CONTEXT_H_TRUE@   mv $@-t $@
+@GL_GENERATE_SELINUX_CONTEXT_H_FALSE@selinux/context.h: $(top_builddir)/config.status
+@GL_GENERATE_SELINUX_CONTEXT_H_FALSE@  rm -f $@
+# 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/ac-aux/snippet/arg-nonnull.h
        $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e '/definition of _GL_UNUSED_PARAMETER/r $(UNUSED_PARAMETER_H)' \
-             < $(srcdir)/se-context.in.h; \
-       } > $@-t && \
-       chmod a-x $@-t && \
+       sed -n -e '/GL_ARG_NONNULL/,$$p' \
+         < $(top_srcdir)/build/ac-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/ac-aux/snippet/c++defs.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/_GL_CXXDEFS/,$$p' \
+         < $(top_srcdir)/build/ac-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/ac-aux/snippet/unused-parameter.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/GL_UNUSED_PARAMETER/,$$p' \
+         < $(top_srcdir)/build/ac-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/ac-aux/snippet/warn-on-use.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/^.ifndef/,$$p' \
+         < $(top_srcdir)/build/ac-aux/snippet/warn-on-use.h \
+         > $@-t && \
        mv $@-t $@
 
 # We need the following in order to create <stdbool.h> when the system
 # doesn't have one that works.
-stdbool.h: stdbool.in.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
-       } > $@-t && \
-       mv $@-t $@
+@GL_GENERATE_STDBOOL_H_TRUE@stdbool.h: stdbool.in.h $(top_builddir)/config.status
+@GL_GENERATE_STDBOOL_H_TRUE@   $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_STDBOOL_H_TRUE@   { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+@GL_GENERATE_STDBOOL_H_TRUE@     sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
+@GL_GENERATE_STDBOOL_H_TRUE@   } > $@-t && \
+@GL_GENERATE_STDBOOL_H_TRUE@   mv $@-t $@
+@GL_GENERATE_STDBOOL_H_FALSE@stdbool.h: $(top_builddir)/config.status
+@GL_GENERATE_STDBOOL_H_FALSE@  rm -f $@
 
 # We need the following in order to create <stddef.h> when the system
 # doesn't have one that works with the given compiler.
-stddef.h: stddef.in.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -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_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
-             -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
-             -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
-             < $(srcdir)/stddef.in.h; \
-       } > $@-t && \
-       mv $@-t $@
+@GL_GENERATE_STDDEF_H_TRUE@stddef.h: stddef.in.h $(top_builddir)/config.status
+@GL_GENERATE_STDDEF_H_TRUE@    $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_STDDEF_H_TRUE@    { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+@GL_GENERATE_STDDEF_H_TRUE@      sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_STDDEF_H_TRUE@          -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_STDDEF_H_TRUE@          -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_STDDEF_H_TRUE@          -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_STDDEF_H_TRUE@          -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
+@GL_GENERATE_STDDEF_H_TRUE@          -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
+@GL_GENERATE_STDDEF_H_TRUE@          -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
+@GL_GENERATE_STDDEF_H_TRUE@          < $(srcdir)/stddef.in.h; \
+@GL_GENERATE_STDDEF_H_TRUE@    } > $@-t && \
+@GL_GENERATE_STDDEF_H_TRUE@    mv $@-t $@
+@GL_GENERATE_STDDEF_H_FALSE@stddef.h: $(top_builddir)/config.status
+@GL_GENERATE_STDDEF_H_FALSE@   rm -f $@
 
 # We need the following in order to create <stdint.h> when the system
 # doesn't have one that works with the given compiler.
-stdint.h: stdint.in.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_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_STDINT_H''@|$(NEXT_STDINT_H)|g' \
-             -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
-             -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
-             -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' \
-             -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
-             -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \
-             -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \
-             -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \
-             -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \
-             -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \
-             -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \
-             -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \
-             -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' \
-             < $(srcdir)/stdint.in.h; \
-       } > $@-t && \
-       mv $@-t $@
+@GL_GENERATE_STDINT_H_TRUE@stdint.h: stdint.in.h $(top_builddir)/config.status
+@GL_GENERATE_STDINT_H_TRUE@    $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_STDINT_H_TRUE@    { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+@GL_GENERATE_STDINT_H_TRUE@      sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
+@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' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \
+@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@          < $(srcdir)/stdint.in.h; \
+@GL_GENERATE_STDINT_H_TRUE@    } > $@-t && \
+@GL_GENERATE_STDINT_H_TRUE@    mv $@-t $@
+@GL_GENERATE_STDINT_H_FALSE@stdint.h: $(top_builddir)/config.status
+@GL_GENERATE_STDINT_H_FALSE@   rm -f $@
 
 # We need the following in order to create <stdio.h> when the system
 # doesn't have one that works with the given compiler.
-stdio.h: stdio.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+stdio.h: stdio.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|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_STDIO_H''@|$(NEXT_STDIO_H)|g' \
-             -e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \
-             -e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \
-             -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|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_FREOPEN''@|$(GNULIB_FREOPEN)|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_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_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_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \
-             -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|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_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''@/$(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' \
              < $(srcdir)/stdio.in.h | \
          sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
              -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
@@ -1940,11 +2208,14 @@ stdio.h: stdio.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
              -e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \
              -e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \
+             -e 's|@''HAVE_PCLOSE''@|$(HAVE_PCLOSE)|g' \
+             -e 's|@''HAVE_POPEN''@|$(HAVE_POPEN)|g' \
              -e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \
              -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
              -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
              -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
              -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
+             -e 's|@''REPLACE_FDOPEN''@|$(REPLACE_FDOPEN)|g' \
              -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
              -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
              -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
@@ -1965,6 +2236,7 @@ stdio.h: stdio.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \
              -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
              -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
+             -e 's|@''REPLACE_STDIO_READ_FUNCS''@|$(REPLACE_STDIO_READ_FUNCS)|g' \
              -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
              -e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \
              -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
@@ -1982,41 +2254,46 @@ stdio.h: stdio.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
 
 # We need the following in order to create <stdlib.h> when the system
 # doesn't have one that works with the given compiler.
-stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+stdlib.h: stdlib.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|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_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_PTSNAME''@|$(GNULIB_PTSNAME)|g' \
-             -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|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_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''@/$(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_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_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' \
              < $(srcdir)/stdlib.in.h | \
          sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
              -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
@@ -2029,7 +2306,10 @@ stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -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_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \
              -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
+             -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \
+             -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_REALPATH''@|$(HAVE_REALPATH)|g' \
@@ -2047,7 +2327,9 @@ stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \
              -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
              -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
+             -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
              -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
+             -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \
              -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \
              -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
              -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
@@ -2055,6 +2337,7 @@ stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
              -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|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 && \
@@ -2062,50 +2345,55 @@ stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
 
 # We need the following in order to create <string.h> when the system
 # doesn't have one that works with the given compiler.
-string.h: string.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+string.h: string.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|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_STRING_H''@|$(NEXT_STRING_H)|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_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' \
              < $(srcdir)/string.in.h | \
-         sed -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
+         sed -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' \
@@ -2128,6 +2416,7 @@ string.h: string.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
              -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
              -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|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' \
@@ -2147,26 +2436,29 @@ string.h: string.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
 
 # 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 $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+sys/stat.h: sys_stat.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|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
-             -e 's|@''GNULIB_FCHMODAT''@|$(GNULIB_FCHMODAT)|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_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|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
              -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
              -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \
@@ -2194,17 +2486,59 @@ sys/stat.h: sys_stat.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        } > $@-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|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
+       $(AM_V_at)$(MKDIR_P) sys
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \
+             -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
+             < $(srcdir)/sys_types.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+
 # We need the following in order to create <sys/wait.h> when the system
 # has one that is incomplete.
-sys/wait.h: sys_wait.in.h $(CXXDEFS_H) $(WARN_ON_USE_H)
+sys/wait.h: sys_wait.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|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_WAIT_H''@|$(NEXT_SYS_WAIT_H)|g' \
-             -e 's|@''GNULIB_WAITPID''@|$(GNULIB_WAITPID)|g' \
+             -e 's/@''GNULIB_WAITPID''@/$(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; \
@@ -2213,18 +2547,19 @@ sys/wait.h: sys_wait.in.h $(CXXDEFS_H) $(WARN_ON_USE_H)
 
 # We need the following in order to create <time.h> when the system
 # doesn't have one that works with the given compiler.
-time.h: time.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+time.h: time.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|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_TIME_H''@|$(NEXT_TIME_H)|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_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|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \
              -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
              -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
@@ -2245,55 +2580,65 @@ time.h: time.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
 
 # We need the following in order to create an empty placeholder for
 # <unistd.h> when the system doesn't have one.
-unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+unistd.h: unistd.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|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_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_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \
-             -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \
-             -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|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_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_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_READLINK''@|$(GNULIB_READLINK)|g' \
-             -e 's|@''GNULIB_READLINKAT''@|$(GNULIB_READLINKAT)|g' \
-             -e 's|@''GNULIB_RMDIR''@|$(GNULIB_RMDIR)|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''@|$(GNULIB_UNISTD_H_GETOPT)|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|@''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_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' \
              < $(srcdir)/unistd.in.h | \
          sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
              -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
@@ -2302,6 +2647,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \
              -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \
              -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \
+             -e 's|@''HAVE_FDATASYNC''@|$(HAVE_FDATASYNC)|g' \
              -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
              -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
              -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
@@ -2309,6 +2655,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
              -e 's|@''HAVE_GETLOGIN''@|$(HAVE_GETLOGIN)|g' \
              -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
+             -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \
              -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
              -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
              -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \
@@ -2318,6 +2665,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \
              -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
              -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \
+             -e 's|@''HAVE_SETHOSTNAME''@|$(HAVE_SETHOSTNAME)|g' \
              -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
              -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \
              -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \
@@ -2325,10 +2673,12 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
              -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|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' \
              -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
              -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_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' \
@@ -2338,17 +2688,20 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
              -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
              -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
+             -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \
              -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
              -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
              -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_ISATTY''@|$(REPLACE_ISATTY)|g' \
              -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
              -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
              -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \
              -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
              -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \
              -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \
+             -e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \
              -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
              -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
              -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
@@ -2365,74 +2718,58 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
        } > $@-t && \
        mv $@-t $@
-# The unused-parameter.h that gets inserted into generated .h files is the same
-# as build-aux/unused-parameter.h, except that it has the copyright header cut
-# off.
-unused-parameter.h: $(top_srcdir)/build/aux/unused-parameter.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/GL_UNUSED_PARAMETER/,$$p' \
-         < $(top_srcdir)/build/aux/unused-parameter.h \
-         > $@-t && \
-       mv $@-t $@
-# The warn-on-use.h that gets inserted into generated .h files is the same as
-# build-aux/warn-on-use.h, except that it has the copyright header cut off.
-warn-on-use.h: $(top_srcdir)/build/aux/warn-on-use.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/^.ifndef/,$$p' \
-         < $(top_srcdir)/build/aux/warn-on-use.h \
-         > $@-t && \
-       mv $@-t $@
 
 # We need the following in order to create <wchar.h> when the system
 # version does not work standalone.
-wchar.h: wchar.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+wchar.h: wchar.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|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
              -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|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/@''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' \
              < $(srcdir)/wchar.in.h | \
          sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
              -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
@@ -2496,10 +2833,11 @@ wchar.h: wchar.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
 
 # We need the following in order to create <wctype.h> when the system
 # doesn't have one that works with the given compiler.
-wctype.h: wctype.in.h $(CXXDEFS_H) $(WARN_ON_USE_H)
+wctype.h: wctype.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/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_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' \
@@ -2516,6 +2854,7 @@ wctype.h: wctype.in.h $(CXXDEFS_H) $(WARN_ON_USE_H)
              -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
              -e 's/@''REPLACE_ISWBLANK''@/$(REPLACE_ISWBLANK)/g' \
              -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \
+             -e 's/@''REPLACE_TOWLOWER''@/$(REPLACE_TOWLOWER)/g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/wctype.in.h; \
index 0e5b796..ee0f018 100644 (file)
@@ -93,25 +93,15 @@ long i00afunc ();
 static int stack_dir;           /* 1 or -1 once known.  */
 #   define STACK_DIR    stack_dir
 
-static void
-find_stack_direction (char **ptr)
+static int
+find_stack_direction (int *addr, int depth)
 {
-  auto char dummy;              /* To get stack address.  */
-
-  if (*ptr == NULL)
-    {                           /* Initial entry.  */
-      *ptr = ADDRESS_FUNCTION (dummy);
-
-      find_stack_direction (ptr);  /* Recurse once.  */
-    }
-  else
-    {
-      /* Second entry.  */
-      if (ADDRESS_FUNCTION (dummy) > *ptr)
-        stack_dir = 1;          /* Stack grew upward.  */
-      else
-        stack_dir = -1;         /* Stack grew downward.  */
-    }
+  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 */
@@ -154,10 +144,7 @@ alloca (size_t size)
 
 #  if STACK_DIRECTION == 0
   if (STACK_DIR == 0)           /* Unknown growth direction.  */
-    {
-      char *addr = NULL;        /* Address of first `dummy', once known.  */
-      find_stack_direction (&addr);
-    }
+    STACK_DIR = find_stack_direction (NULL, (size & 1) + 20);
 #  endif
 
   /* Reclaim garbage, defined as all alloca'd storage that
@@ -488,4 +475,4 @@ i00afunc (long address)
 #  endif /* CRAY */
 
 # endif /* no alloca */
-#endif /* not GCC version 2.1 */
+#endif /* not GCC 2 */
index 8012ce9..feafbc5 100644 (file)
@@ -1,6 +1,6 @@
 /* Memory allocation on the stack.
 
-   Copyright (C) 1995, 1999, 2001-2004, 2006-2011 Free Software Foundation,
+   Copyright (C) 1995, 1999, 2001-2004, 2006-2012 Free Software Foundation,
    Inc.
 
    This program is free software; you can redistribute it and/or modify it
@@ -14,9 +14,9 @@
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-   USA.  */
+   License along with this program; if not, see
+   <http://www.gnu.org/licenses/>.
+  */
 
 /* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
    means there is a real alloca function.  */
 #  define alloca _alloca
 # elif defined __DECC && defined __VMS
 #  define alloca __ALLOCA
+# elif defined __TANDEM && defined _TNS_E_TARGET
+#  ifdef  __cplusplus
+extern "C"
+#  endif
+void *_alloca (unsigned short);
+#  pragma intrinsic (_alloca)
+#  define alloca _alloca
 # else
 #  include <stddef.h>
 #  ifdef  __cplusplus
index 0239432..30bf9b8 100644 (file)
@@ -1,5 +1,5 @@
 /* Functions for dealing with '\0' separated arg vectors.
-   Copyright (C) 1995-1998, 2000-2002, 2006, 2008-2011 Free Software
+   Copyright (C) 1995-1998, 2000-2002, 2006, 2008-2012 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -14,8 +14,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License along
-   with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 3a5adf3..95ba6a1 100644 (file)
@@ -1,5 +1,5 @@
 /* Routines for dealing with '\0' separated arg vectors.
-   Copyright (C) 1995-2000, 2004, 2007, 2009-2011 Free Software Foundation,
+   Copyright (C) 1995-2000, 2004, 2007, 2009-2012 Free Software Foundation,
    Inc.
    This file is part of the GNU C Library.
 
index 0239f4a..2f0fd50 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -12,8 +12,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License along
-   with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 84728b1..42b5e0e 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006-2007, 2009-2011 Free Software Foundation,
+   Copyright (C) 1999, 2002, 2006-2007, 2009-2012 Free Software Foundation,
    Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License along
-   with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index d0fe426..7a96f7b 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert unibyte character to wide character.
-   Copyright (C) 2008, 2010-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2010-2012 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
index 2c5ca9a..d43f17b 100644 (file)
@@ -1,5 +1,5 @@
 /* Return the canonical absolute name of a given file.
-   Copyright (C) 1996-2011 Free Software Foundation, Inc.
+   Copyright (C) 1996-2012 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
@@ -16,6 +16,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _LIBC
+# define _GL_USE_STDLIB_ALLOC 1
 # include <config.h>
 #endif
 
@@ -68,8 +69,6 @@
 # endif
 # define __readlink readlink
 # define __set_errno(e) errno = (e)
-/* Use the system functions, not the gnulib overrides in this file.  */
-# undef malloc
 # ifndef MAXSYMLINKS
 #  ifdef SYMLOOP_MAX
 #   define MAXSYMLINKS SYMLOOP_MAX
 
 #if !FUNC_REALPATH_WORKS || defined _LIBC
 /* Return the canonical absolute name of file NAME.  A canonical name
-   does not contain any `.', `..' components nor any repeated path
+   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'
+   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
@@ -126,7 +125,7 @@ __realpath (const char *name, char *resolved)
 #else
   path_max = pathconf (name, _PC_PATH_MAX);
   if (path_max <= 0)
-    path_max = 1024;
+    path_max = 8192;
 #endif
 
   if (resolved == NULL)
@@ -157,8 +156,12 @@ __realpath (const char *name, char *resolved)
     {
       rpath[0] = '/';
       dest = rpath + 1;
-      if (DOUBLE_SLASH_IS_DISTINCT_ROOT && name[1] == '/')
-        *dest++ = '/';
+      if (DOUBLE_SLASH_IS_DISTINCT_ROOT)
+        {
+          if (name[1] == '/' && name[2] != '/')
+            *dest++ = '/';
+          *dest = '\0';
+        }
     }
 
   for (start = end = name; *start; start = end)
@@ -188,7 +191,7 @@ __realpath (const char *name, char *resolved)
           if (dest > rpath + 1)
             while ((--dest)[-1] != '/');
           if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rpath + 1
-              && *dest == '/')
+              && *dest == '/' && dest[1] != '/')
             dest++;
         }
       else
@@ -299,8 +302,12 @@ __realpath (const char *name, char *resolved)
               if (buf[0] == '/')
                 {
                   dest = rpath + 1;     /* It's an absolute symlink */
-                  if (DOUBLE_SLASH_IS_DISTINCT_ROOT && buf[1] == '/')
-                    *dest++ = '/';
+                  if (DOUBLE_SLASH_IS_DISTINCT_ROOT)
+                    {
+                      if (buf[1] == '/' && buf[2] != '/')
+                        *dest++ = '/';
+                      *dest = '\0';
+                    }
                 }
               else
                 {
@@ -309,7 +316,7 @@ __realpath (const char *name, char *resolved)
                   if (dest > rpath + 1)
                     while ((--dest)[-1] != '/');
                   if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rpath + 1
-                      && *dest == '/')
+                      && *dest == '/' && dest[1] != '/')
                     dest++;
                 }
             }
@@ -322,7 +329,8 @@ __realpath (const char *name, char *resolved)
     }
   if (dest > rpath + 1 && dest[-1] == '/')
     --dest;
-  if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rpath + 1 && *dest == '/')
+  if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rpath + 1
+      && *dest == '/' && dest[1] != '/')
     dest++;
   *dest = '\0';
 
index 74f7fec..ea44c6c 100644 (file)
@@ -1,7 +1,7 @@
 #! /bin/sh
 # Output a system dependent table of character encoding aliases.
 #
-#   Copyright (C) 2000-2004, 2006-2011 Free Software Foundation, Inc.
+#   Copyright (C) 2000-2004, 2006-2012 Free Software Foundation, Inc.
 #
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU Lesser General Public License as published by
@@ -14,8 +14,7 @@
 #   GNU Lesser General Public License for more details.
 #
 #   You should have received a copy of the GNU Lesser General Public License along
-#   with this program; if not, write to the Free Software Foundation,
-#   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#   with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # The table consists of lines of the form
 #    ALIAS  CANONICAL
@@ -30,6 +29,8 @@
 # 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
index d44d82a..86f4edb 100644 (file)
@@ -1,6 +1,6 @@
 /* A substitute for ISO C99 <ctype.h>, for platforms on which it is incomplete.
 
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -13,8 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible.  */
 
@@ -23,7 +22,7 @@
  * <http://www.opengroup.org/onlinepubs/9699919799/basedefs/ctype.h.html>
  */
 
-#ifndef _GL_CTYPE_H
+#ifndef _@GUARD_PREFIX@_CTYPE_H
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
@@ -34,8 +33,8 @@
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_CTYPE_H@
 
-#ifndef _GL_CTYPE_H
-#define _GL_CTYPE_H
+#ifndef _@GUARD_PREFIX@_CTYPE_H
+#define _@GUARD_PREFIX@_CTYPE_H
 
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
@@ -54,5 +53,5 @@ _GL_WARN_ON_USE (isblank, "isblank is unportable - "
 # endif
 #endif
 
-#endif /* _GL_CTYPE_H */
-#endif /* _GL_CTYPE_H */
+#endif /* _@GUARD_PREFIX@_CTYPE_H */
+#endif /* _@GUARD_PREFIX@_CTYPE_H */
index 70bb5c2..08c0c68 100644 (file)
@@ -1,6 +1,6 @@
 /* File names on MS-DOS/Windows systems.
 
-   Copyright (C) 2000-2001, 2004-2006, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2000-2001, 2004-2006, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 2f9ac45..a7df255 100644 (file)
@@ -1,6 +1,6 @@
 /* A POSIX-like <errno.h>.
 
-   Copyright (C) 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef _GL_ERRNO_H
+#ifndef _@GUARD_PREFIX@_ERRNO_H
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_ERRNO_H@
 
-#ifndef _GL_ERRNO_H
-#define _GL_ERRNO_H
+#ifndef _@GUARD_PREFIX@_ERRNO_H
+#define _@GUARD_PREFIX@_ERRNO_H
 
 
 /* On native Windows platforms, many macros are not defined.  */
 # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 
-/* POSIX says that EAGAIN and EWOULDBLOCK may have the same value.  */
-#  define EWOULDBLOCK     EAGAIN
-
-/* Values >= 100 seem safe to use.  */
-#  define ETXTBSY   100
-#  define GNULIB_defined_ETXTBSY 1
+/* These are the same values as defined by MSVC 10, for interoperability.  */
+
+#  ifndef ENOMSG
+#   define ENOMSG    122
+#   define GNULIB_defined_ENOMSG 1
+#  endif
+
+#  ifndef EIDRM
+#   define EIDRM     111
+#   define GNULIB_defined_EIDRM 1
+#  endif
+
+#  ifndef ENOLINK
+#   define ENOLINK   121
+#   define GNULIB_defined_ENOLINK 1
+#  endif
+
+#  ifndef EPROTO
+#   define EPROTO    134
+#   define GNULIB_defined_EPROTO 1
+#  endif
+
+#  ifndef EBADMSG
+#   define EBADMSG   104
+#   define GNULIB_defined_EBADMSG 1
+#  endif
+
+#  ifndef EOVERFLOW
+#   define EOVERFLOW 132
+#   define GNULIB_defined_EOVERFLOW 1
+#  endif
+
+#  ifndef ENOTSUP
+#   define ENOTSUP   129
+#   define GNULIB_defined_ENOTSUP 1
+#  endif
+
+#  ifndef ENETRESET
+#   define ENETRESET 117
+#   define GNULIB_defined_ENETRESET 1
+#  endif
+
+#  ifndef ECONNABORTED
+#   define ECONNABORTED 106
+#   define GNULIB_defined_ECONNABORTED 1
+#  endif
+
+#  ifndef ECANCELED
+#   define ECANCELED 105
+#   define GNULIB_defined_ECANCELED 1
+#  endif
+
+#  ifndef EOWNERDEAD
+#   define EOWNERDEAD 133
+#   define GNULIB_defined_EOWNERDEAD 1
+#  endif
+
+#  ifndef ENOTRECOVERABLE
+#   define ENOTRECOVERABLE 127
+#   define GNULIB_defined_ENOTRECOVERABLE 1
+#  endif
+
+#  ifndef EINPROGRESS
+#   define EINPROGRESS     112
+#   define EALREADY        103
+#   define ENOTSOCK        128
+#   define EDESTADDRREQ    109
+#   define EMSGSIZE        115
+#   define EPROTOTYPE      136
+#   define ENOPROTOOPT     123
+#   define EPROTONOSUPPORT 135
+#   define EOPNOTSUPP      130
+#   define EAFNOSUPPORT    102
+#   define EADDRINUSE      100
+#   define EADDRNOTAVAIL   101
+#   define ENETDOWN        116
+#   define ENETUNREACH     118
+#   define ECONNRESET      108
+#   define ENOBUFS         119
+#   define EISCONN         113
+#   define ENOTCONN        126
+#   define ETIMEDOUT       138
+#   define ECONNREFUSED    107
+#   define ELOOP           114
+#   define EHOSTUNREACH    110
+#   define EWOULDBLOCK     140
+#   define GNULIB_defined_ESOCK 1
+#  endif
+
+#  ifndef ETXTBSY
+#   define ETXTBSY         139
+#   define ENODATA         120  /* not required by POSIX */
+#   define ENOSR           124  /* not required by POSIX */
+#   define ENOSTR          125  /* not required by POSIX */
+#   define ETIME           137  /* not required by POSIX */
+#   define EOTHER          131  /* not required by POSIX */
+#   define GNULIB_defined_ESTREAMS 1
+#  endif
 
 /* These are intentionally the same values as the WSA* error numbers, defined
    in <winsock2.h>.  */
-#  define EINPROGRESS     10036
-#  define EALREADY        10037
-#  define ENOTSOCK        10038
-#  define EDESTADDRREQ    10039
-#  define EMSGSIZE        10040
-#  define EPROTOTYPE      10041
-#  define ENOPROTOOPT     10042
-#  define EPROTONOSUPPORT 10043
 #  define ESOCKTNOSUPPORT 10044  /* not required by POSIX */
-#  define EOPNOTSUPP      10045
 #  define EPFNOSUPPORT    10046  /* not required by POSIX */
-#  define EAFNOSUPPORT    10047
-#  define EADDRINUSE      10048
-#  define EADDRNOTAVAIL   10049
-#  define ENETDOWN        10050
-#  define ENETUNREACH     10051
-#  define ENETRESET       10052
-#  define ECONNABORTED    10053
-#  define ECONNRESET      10054
-#  define ENOBUFS         10055
-#  define EISCONN         10056
-#  define ENOTCONN        10057
 #  define ESHUTDOWN       10058  /* not required by POSIX */
 #  define ETOOMANYREFS    10059  /* not required by POSIX */
-#  define ETIMEDOUT       10060
-#  define ECONNREFUSED    10061
-#  define ELOOP           10062
 #  define EHOSTDOWN       10064  /* not required by POSIX */
-#  define EHOSTUNREACH    10065
 #  define EPROCLIM        10067  /* not required by POSIX */
 #  define EUSERS          10068  /* not required by POSIX */
 #  define EDQUOT          10069
 #  define ESTALE          10070
 #  define EREMOTE         10071  /* not required by POSIX */
-#  define GNULIB_defined_ESOCK 1
+#  define GNULIB_defined_EWINSOCK 1
 
 # endif
 
 #  define GNULIB_defined_ENOTSUP 1
 # endif
 
+# ifndef ENETRESET
+#  define ENETRESET 2011
+#  define GNULIB_defined_ENETRESET 1
+# endif
+
+# ifndef ECONNABORTED
+#  define ECONNABORTED 2012
+#  define GNULIB_defined_ECONNABORTED 1
+# endif
+
 # ifndef ESTALE
 #  define ESTALE    2009
 #  define GNULIB_defined_ESTALE 1
 #  define GNULIB_defined_ECANCELED 1
 # endif
 
+/* On many platforms, the macros EOWNERDEAD and ENOTRECOVERABLE are not
+   defined.  */
+
+# ifndef EOWNERDEAD
+#  if defined __sun
+    /* Use the same values as defined for Solaris >= 8, for
+       interoperability.  */
+#   define EOWNERDEAD      58
+#   define ENOTRECOVERABLE 59
+#  elif (defined _WIN32 || 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
+     /* Use the same values as defined by pthreads-win32, for
+        interoperability.  */
+#    define EOWNERDEAD      43
+#    define ENOTRECOVERABLE 44
+#   else
+     /* Use the same values as defined by MSVC 10, for
+        interoperability.  */
+#    define EOWNERDEAD      133
+#    define ENOTRECOVERABLE 127
+#   endif
+#  else
+#   define EOWNERDEAD      2013
+#   define ENOTRECOVERABLE 2014
+#  endif
+#  define GNULIB_defined_EOWNERDEAD 1
+#  define GNULIB_defined_ENOTRECOVERABLE 1
+# endif
 
-#endif /* _GL_ERRNO_H */
-#endif /* _GL_ERRNO_H */
+#endif /* _@GUARD_PREFIX@_ERRNO_H */
+#endif /* _@GUARD_PREFIX@_ERRNO_H */
similarity index 83%
rename from gnulib/tests/fcntl.in.h
rename to gnulib/lib/fcntl.in.h
index 18cac45..14e5780 100644 (file)
@@ -1,18 +1,18 @@
 /* Like <fcntl.h>, but with non-working flags defined to 0.
 
-   Copyright (C) 2006-2011 Free Software Foundation, Inc.
+   Copyright (C) 2006-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation; either version 2.1 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   GNU Lesser General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* written by Paul Eggert */
@@ -25,6 +25,8 @@
 #if defined __need_system_fcntl_h
 /* Special invocation convention.  */
 
+/* Needed before <sys/stat.h>.
+   May also define off_t to a 64-bit type on native Windows.  */
 #include <sys/types.h>
 /* On some systems other than glibc, <sys/stat.h> is a prerequisite of
    <fcntl.h>.  On glibc systems, we would like to avoid namespace pollution.
 #else
 /* Normal invocation convention.  */
 
-#ifndef _GL_FCNTL_H
+#ifndef _@GUARD_PREFIX@_FCNTL_H
 
+/* Needed before <sys/stat.h>.
+   May also define off_t to a 64-bit type on native Windows.  */
 #include <sys/types.h>
 /* On some systems other than glibc, <sys/stat.h> is a prerequisite of
    <fcntl.h>.  On glibc systems, we would like to avoid namespace pollution.
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_FCNTL_H@
 
-#ifndef _GL_FCNTL_H
-#define _GL_FCNTL_H
+#ifndef _@GUARD_PREFIX@_FCNTL_H
+#define _@GUARD_PREFIX@_FCNTL_H
 
 #ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems.  */
 # 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.  */
 
@@ -177,13 +187,12 @@ _GL_WARN_ON_USE (openat, "openat is not portable - "
 /* Fix up the O_* macros.  */
 
 #if !defined O_DIRECT && defined O_DIRECTIO
-/* Tru64 spells it `O_DIRECTIO'.  */
+/* Tru64 spells it 'O_DIRECTIO'.  */
 # define O_DIRECT O_DIRECTIO
 #endif
 
 #if !defined O_CLOEXEC && defined O_NOINHERIT
-/* Mingw spells it `O_NOINHERIT'.  Intentionally leave it
-   undefined if not available.  */
+/* Mingw spells it 'O_NOINHERIT'.  */
 # define O_CLOEXEC O_NOINHERIT
 #endif
 
@@ -219,6 +228,19 @@ _GL_WARN_ON_USE (openat, "openat is not portable - "
 # define O_NONBLOCK O_NDELAY
 #endif
 
+/* If the gnulib module 'nonblocking' is in use, guarantee a working non-zero
+   value of O_NONBLOCK.  Otherwise, O_NONBLOCK is defined (above) to O_NDELAY
+   or to 0 as fallback.  */
+#if @GNULIB_NONBLOCKING@
+# if O_NONBLOCK
+#  define GNULIB_defined_O_NONBLOCK 0
+# else
+#  define GNULIB_defined_O_NONBLOCK 1
+#  undef O_NONBLOCK
+#  define O_NONBLOCK 0x40000000
+# endif
+#endif
+
 #ifndef O_NOCTTY
 # define O_NOCTTY 0
 #endif
@@ -247,6 +269,11 @@ _GL_WARN_ON_USE (openat, "openat is not portable - "
 # define O_TTY_INIT 0
 #endif
 
+#if O_ACCMODE != (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH)
+# undef O_ACCMODE
+# define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH)
+#endif
+
 /* For systems that distinguish between text and binary I/O.
    O_BINARY is usually declared in fcntl.h  */
 #if !defined O_BINARY && defined _O_BINARY
@@ -303,6 +330,6 @@ _GL_WARN_ON_USE (openat, "openat is not portable - "
 #endif
 
 
-#endif /* _GL_FCNTL_H */
-#endif /* _GL_FCNTL_H */
+#endif /* _@GUARD_PREFIX@_FCNTL_H */
+#endif /* _@GUARD_PREFIX@_FCNTL_H */
 #endif
index f40544f..6933c4a 100644 (file)
@@ -1,5 +1,5 @@
 /* Supplemental information about the floating-point formats.
-   Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 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,8 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _FLOATPLUS_H
 #define _FLOATPLUS_H
diff --git a/gnulib/lib/float.c b/gnulib/lib/float.c
new file mode 100644 (file)
index 0000000..50276a5
--- /dev/null
@@ -0,0 +1,33 @@
+/* Auxiliary definitions for <float.h>.
+   Copyright (C) 2011-2012 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 Lesser General Public License as published by
+   the Free Software Foundation; either version 2.1 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <float.h>
+
+#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
+const union gl_long_double_union gl_LDBL_MAX =
+  { { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL } };
+#elif defined __i386__
+const union gl_long_double_union gl_LDBL_MAX =
+  { { 0xFFFFFFFF, 0xFFFFFFFF, 32766 } };
+#else
+/* This declaration is solely to ensure that after preprocessing
+   this file is never empty.  */
+typedef int dummy;
+#endif
index f77a5ef..a769007 100644 (file)
@@ -1,6 +1,6 @@
 /* A correct <float.h>.
 
-   Copyright (C) 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -15,7 +15,7 @@
    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef _GL_FLOAT_H
+#ifndef _@GUARD_PREFIX@_FLOAT_H
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_FLOAT_H@
 
-#ifndef _GL_FLOAT_H
-#define _GL_FLOAT_H
+#ifndef _@GUARD_PREFIX@_FLOAT_H
+#define _@GUARD_PREFIX@_FLOAT_H
 
 /* 'long double' properties.  */
+
 #if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
 /* Number of mantissa units, in base FLT_RADIX.  */
 # undef LDBL_MANT_DIG
 # define LDBL_MAX_10_EXP 4932
 #endif
 
-#endif /* _GL_FLOAT_H */
-#endif /* _GL_FLOAT_H */
+/* 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__
+/* Number of mantissa units, in base FLT_RADIX.  */
+# undef LDBL_MANT_DIG
+# define LDBL_MANT_DIG   64
+/* Number of decimal digits that is sufficient for representing a number.  */
+# undef LDBL_DIG
+# define LDBL_DIG        18
+/* x-1 where x is the smallest representable number > 1.  */
+# undef LDBL_EPSILON
+# define LDBL_EPSILON 1.084202172485504434007452800869941711426e-19L /* 2^-63 */
+/* Minimum e such that FLT_RADIX^(e-1) is a normalized number.  */
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP    (-16381)
+/* Maximum e such that FLT_RADIX^(e-1) is a representable finite number.  */
+# undef LDBL_MAX_EXP
+# define LDBL_MAX_EXP    16384
+/* Minimum positive normalized number.  */
+# undef LDBL_MIN
+# define LDBL_MIN        3.3621031431120935E-4932L /* = 0x1p-16382L */
+/* Maximum representable finite number.  */
+# undef LDBL_MAX
+/* LDBL_MAX is represented as { 0xFFFFFFFF, 0xFFFFFFFF, 32766 }.
+   But the largest literal that GCC allows us to write is
+   0x0.fffffffffffff8p16384L = { 0xFFFFF800, 0xFFFFFFFF, 32766 }.
+   So, define it like this through a reference to an external variable
+
+     const unsigned int LDBL_MAX[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 32766 };
+     extern const long double LDBL_MAX;
+
+   Unfortunately, this is not a constant expression.  */
+union gl_long_double_union
+  {
+    struct { unsigned int lo; unsigned int hi; unsigned int exponent; } xd;
+    long double ld;
+  };
+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.  */
+# undef LDBL_MIN_10_EXP
+# define LDBL_MIN_10_EXP (-4931)
+/* Maximum e such that 10^e is in the range of representable finite numbers.  */
+# undef LDBL_MAX_10_EXP
+# define LDBL_MAX_10_EXP 4932
+#endif
+
+/* On AIX 7.1 with gcc 4.2, the values of LDBL_MIN_EXP, LDBL_MIN, LDBL_MAX are
+   wrong.
+   On Linux/PowerPC with gcc 4.4, the value of LDBL_MAX is wrong.  */
+#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
+# undef LDBL_MIN_10_EXP
+# define LDBL_MIN_10_EXP DBL_MIN_10_EXP
+# undef LDBL_MIN
+# define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */
+#endif
+#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
+# undef LDBL_MAX
+/* LDBL_MAX is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xFFFFFFFF }.
+   It is not easy to define:
+     #define LDBL_MAX 1.79769313486231580793728971405302307166e308L
+   is too small, whereas
+     #define LDBL_MAX 1.79769313486231580793728971405302307167e308L
+   is too large.  Apparently a bug in GCC decimal-to-binary conversion.
+   Also, I can't get values larger than
+     #define LDBL63 ((long double) (1ULL << 63))
+     #define LDBL882 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
+     #define LDBL945 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
+     #define LDBL1008 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
+     #define LDBL_MAX (LDBL1008 * 65535.0L + LDBL945 * (long double) 9223372036821221375ULL + LDBL882 * (long double) 4611686018427387904ULL)
+   which is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xF8000000 }.
+   So, define it like this through a reference to an external variable
+
+     const double LDBL_MAX[2] = { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL };
+     extern const long double LDBL_MAX;
+
+   or through a pointer cast
+
+     #define LDBL_MAX \
+       (*(const long double *) (double[]) { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL })
+
+   Unfortunately, this is not a constant expression, and the latter expression
+   does not work well when GCC is optimizing..  */
+union gl_long_double_union
+  {
+    struct { double hi; double lo; } dd;
+    long double ld;
+  };
+extern const union gl_long_double_union gl_LDBL_MAX;
+# define LDBL_MAX (gl_LDBL_MAX.ld)
+#endif
+
+/* On IRIX 6.5, with cc, the value of LDBL_MANT_DIG is wrong.
+   On IRIX 6.5, with gcc 4.2, the values of LDBL_MIN_EXP, LDBL_MIN, LDBL_EPSILON
+   are wrong.  */
+#if defined __sgi && (LDBL_MANT_DIG >= 106)
+# undef LDBL_MANT_DIG
+# define LDBL_MANT_DIG 106
+# if defined __GNUC__
+#  undef LDBL_MIN_EXP
+#  define LDBL_MIN_EXP DBL_MIN_EXP
+#  undef LDBL_MIN_10_EXP
+#  define LDBL_MIN_10_EXP DBL_MIN_10_EXP
+#  undef LDBL_MIN
+#  define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */
+#  undef LDBL_EPSILON
+#  define LDBL_EPSILON 2.46519032881566189191165176650870696773e-32L /* 2^-105 */
+# endif
+#endif
+
+#if @REPLACE_ITOLD@
+/* Pull in a function that fixes the 'int' to 'long double' conversion
+   of glibc 2.7.  */
+extern
+# ifdef __cplusplus
+"C"
+# endif
+void _Qp_itoq (long double *, int);
+static void (*_gl_float_fix_itold) (long double *, int) = _Qp_itoq;
+#endif
+
+#endif /* _@GUARD_PREFIX@_FLOAT_H */
+#endif /* _@GUARD_PREFIX@_FLOAT_H */
index 83a1722..444b6d8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1993, 1996-2007, 2009-2011 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1993, 1996-2007, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -11,8 +11,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _LIBC
 # include <config.h>
@@ -42,7 +41,7 @@
   (HAVE_WCTYPE_H && HAVE_BTOWC && HAVE_ISWCTYPE \
    && HAVE_WMEMCHR && (HAVE_WMEMCPY || HAVE_WMEMPCPY))
 
-/* For platform which support the ISO C amendement 1 functionality we
+/* For platform which support the ISO C amendment 1 functionality we
    support user defined character classes.  */
 #if defined _LIBC || WIDE_CHAR_SUPPORT
 # include <wctype.h>
@@ -78,7 +77,7 @@ extern int fnmatch (const char *pattern, const char *string, int flags);
    Library, but also included in many other GNU distributions.  Compiling
    and linking in this code is a waste when using the GNU C library
    (especially if it is a shared library).  Rather than having every GNU
-   program understand `configure --with-gnu-libc' and omit the object files,
+   program understand 'configure --with-gnu-libc' and omit the object files,
    it is simpler to just do this in the source for each such file.  */
 
 #if defined _LIBC || !defined __GNU_LIBRARY__ || !HAVE_FNMATCH_GNU
@@ -92,7 +91,7 @@ extern int fnmatch (const char *pattern, const char *string, int flags);
 
 # if defined _LIBC || WIDE_CHAR_SUPPORT
 /* The GNU C library provides support for user-defined character classes
-   and the functions from ISO C amendement 1.  */
+   and the functions from ISO C amendment 1.  */
 #  ifdef CHARCLASS_NAME_MAX
 #   define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
 #  else
@@ -119,7 +118,7 @@ extern int fnmatch (const char *pattern, const char *string, int flags);
 #  endif
 
 # else
-#  define CHAR_CLASS_MAX_LENGTH  6 /* Namely, `xdigit'.  */
+#  define CHAR_CLASS_MAX_LENGTH  6 /* Namely, 'xdigit'.  */
 
 #  define IS_CHAR_CLASS(string)                                               \
    (STREQ (string, "alpha") || STREQ (string, "upper")                        \
@@ -168,7 +167,6 @@ static int posixly_correct;
 #  endif
 # endif
 # define MEMCHR(S, C, N) memchr (S, C, N)
-# define STRCOLL(S1, S2) strcoll (S1, S2)
 # include "fnmatch_loop.c"
 
 
@@ -196,7 +194,6 @@ static int posixly_correct;
 #   endif
 #  endif
 #  define MEMCHR(S, C, N) wmemchr (S, C, N)
-#  define STRCOLL(S1, S2) wcscoll (S1, S2)
 #  define WIDE_CHAR_VERSION 1
 
 #  undef IS_CHAR_CLASS
index d5ebd70..0fcf991 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1993, 1996-1999, 2001-2003, 2005, 2007, 2009-2011 Free
+/* Copyright (C) 1991-1993, 1996-1999, 2001-2003, 2005, 2007, 2009-2012 Free
    Software Foundation, Inc.
 
    This file is part of the GNU C Library.
@@ -14,8 +14,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _FNMATCH_H
 #define _FNMATCH_H      1
@@ -32,23 +31,23 @@ extern "C" {
 #undef  FNM_NOESCAPE
 #undef  FNM_PERIOD
 
-/* Bits set in the FLAGS argument to `fnmatch'.  */
-#define FNM_PATHNAME    (1 << 0) /* No wildcard can ever match `/'.  */
+/* Bits set in the FLAGS argument to 'fnmatch'.  */
+#define FNM_PATHNAME    (1 << 0) /* No wildcard can ever match '/'.  */
 #define FNM_NOESCAPE    (1 << 1) /* Backslashes don't quote special chars.  */
-#define FNM_PERIOD      (1 << 2) /* Leading `.' is matched only explicitly.  */
+#define FNM_PERIOD      (1 << 2) /* Leading '.' is matched only explicitly.  */
 
 #if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
 # define FNM_FILE_NAME   FNM_PATHNAME   /* Preferred GNU name.  */
-# define FNM_LEADING_DIR (1 << 3)       /* Ignore `/...' after a match.  */
+# define FNM_LEADING_DIR (1 << 3)       /* Ignore '/...' after a match.  */
 # define FNM_CASEFOLD    (1 << 4)       /* Compare without regard to case.  */
 # define FNM_EXTMATCH    (1 << 5)       /* Use ksh-like extended matching. */
 #endif
 
-/* Value returned by `fnmatch' if STRING does not match PATTERN.  */
+/* Value returned by 'fnmatch' if STRING does not match PATTERN.  */
 #define FNM_NOMATCH     1
 
 /* This value is returned if the implementation does not support
-   `fnmatch'.  Since this is not the case here it will never be
+   'fnmatch'.  Since this is not the case here it will never be
    returned but the conformance test suites still require the symbol
    to be defined.  */
 #ifdef _XOPEN_SOURCE
index bbeb94d..580a320 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1993, 1996-2006, 2009-2011 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1993, 1996-2006, 2009-2012 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,8 +12,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* Match STRING against the file name pattern PATTERN, returning zero if
    it matches, nonzero if not.  */
@@ -200,6 +199,8 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
         case L_('['):
           {
             /* Nonzero if the sense of the character class is inverted.  */
+            const CHAR *p_init = p;
+            const CHAR *n_init = n;
             register bool not;
             CHAR cold;
             UCHAR fn;
@@ -214,7 +215,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
               return FNM_NOMATCH;
 
             if (*n == L_('/') && (flags & FNM_FILE_NAME))
-              /* `/' cannot be matched.  */
+              /* '/' cannot be matched.  */
               return FNM_NOMATCH;
 
             not = (*p == L_('!') || (posixly_correct < 0 && *p == L_('^')));
@@ -380,7 +381,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
                           {
                             /* We found a table entry.  Now see whether the
                                character we are currently at has the same
-                               equivalance class value.  */
+                               equivalence class value.  */
                             int len = weights[idx & 0xffffff];
                             int32_t idx2;
                             const UCHAR *np = (const UCHAR *) n;
@@ -410,8 +411,13 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
                   }
 #endif
                 else if (c == L_('\0'))
-                  /* [ (unterminated) loses.  */
-                  return FNM_NOMATCH;
+                  {
+                    /* [ unterminated, treat as normal character.  */
+                    p = p_init;
+                    n = n_init;
+                    c = L_('[');
+                    goto normal_match;
+                  }
                 else
                   {
                     bool is_range = false;
@@ -629,7 +635,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
                         UCHAR cend = *p++;
 
 # ifdef WIDE_CHAR_VERSION
-                        /* Search in the `names' array for the characters.  */
+                        /* Search in the 'names' array for the characters.  */
                         fcollseq = __collseq_table_lookup (collseq, fn);
                         if (fcollseq == ~((uint32_t) 0))
                           /* XXX We don't know anything about the character
@@ -832,7 +838,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
 #else
                         /* We use a boring value comparison of the character
                            values.  This is better than comparing using
-                           `strcoll' since the latter would have surprising
+                           'strcoll' since the latter would have surprising
                            and sometimes fatal consequences.  */
                         UCHAR cend = *p++;
 
@@ -1149,7 +1155,7 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
 
     case L_('@'):
       do
-        /* I cannot believe it but `strcat' is actually acceptable
+        /* I cannot believe it but 'strcat' is actually acceptable
            here.  Match the entire string with the prefix from the
            pattern list and the rest of the pattern following the
            pattern list.  */
@@ -1207,7 +1213,6 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
 #undef END
 #undef MEMPCPY
 #undef MEMCHR
-#undef STRCOLL
 #undef STRLEN
 #undef STRCAT
 #undef L_
index e00e9b5..5ac31f4 100644 (file)
@@ -1,5 +1,5 @@
 /* getdelim.c --- Implementation of replacement getdelim function.
-   Copyright (C) 1994, 1996-1998, 2001, 2003, 2005-2011 Free Software
+   Copyright (C) 1994, 1996-1998, 2001, 2003, 2005-2012 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or
@@ -13,9 +13,7 @@
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-   02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* Ported from glibc by Simon Josefsson. */
 
index c793367..968915a 100644 (file)
@@ -1,5 +1,5 @@
 /* wrap getfilecon, lgetfilecon, and fgetfilecon
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -12,8 +12,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* written by Jim Meyering */
 
index 9f9afec..d29b929 100644 (file)
@@ -1,5 +1,5 @@
 /* getline.c --- Implementation of replacement getline function.
-   Copyright (C) 2005-2007, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2005-2007, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public License as
@@ -12,9 +12,7 @@
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-   02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* Written by Simon Josefsson. */
 
index 9e79ad4..bf570fb 100644 (file)
@@ -2,7 +2,7 @@
    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-2011 Free Software
+   Copyright (C) 1987-1996, 1998-2004, 2006, 2008-2012 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 
 # include <wchar.h>
 #endif
 
-/* This version of `getopt' appears to the caller like standard Unix `getopt'
+/* 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,
+   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
+   Using 'getopt' or setting the environment variable POSIXLY_CORRECT
    disables permutation.
    Then the behavior is completely standard.
 
 
 #include "getopt_int.h"
 
-/* For communication from `getopt' to the caller.
-   When `getopt' finds an option that takes an argument,
+/* 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,
+   Also, when 'ordering' is RETURN_IN_ORDER,
    each non-option ARGV-element is returned here.  */
 
 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'.
+   and for communication between successive calls to 'getopt'.
 
-   On entry to `getopt', zero means this is the first call; initialize.
+   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
+   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
+   Otherwise, 'optind' communicates from one call to the next
    how much of ARGV has been scanned so far.  */
 
 /* 1003.2 says this must be 1 before any call.  */
@@ -137,7 +137,7 @@ extern char *__getopt_nonoption_flags;
    The other is elements [last_nonopt,optind), which contains all
    the options processed since those non-options were skipped.
 
-   `first_nonopt' and `last_nonopt' are relocated so that they describe
+   'first_nonopt' and 'last_nonopt' are relocated so that they describe
    the new indices of the non-options in ARGV after they are moved.  */
 
 static void
@@ -154,7 +154,7 @@ exchange (char **argv, struct _getopt_data *d)
      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'
+  /* 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)
@@ -291,48 +291,48 @@ _getopt_initialize (int argc _GL_UNUSED,
 
    If an element of ARGV starts with '-', and is not exactly "-" or "--",
    then it is an option element.  The characters of this element
-   (aside from the initial '-') are option characters.  If `getopt'
+   (aside from the initial '-') are option characters.  If 'getopt'
    is called repeatedly, it returns successively each of the option characters
    from each of the option elements.
 
-   If `getopt' finds another option character, it returns that character,
-   updating `optind' and `nextchar' so that the next call to `getopt' can
+   If 'getopt' finds another option character, it returns that character,
+   updating 'optind' and 'nextchar' so that the next call to 'getopt' can
    resume the scan with the following option character or ARGV-element.
 
-   If there are no more option characters, `getopt' returns -1.
-   Then `optind' is the index in ARGV of the first ARGV-element
+   If there are no more option characters, 'getopt' returns -1.
+   Then 'optind' is the index in ARGV of the first ARGV-element
    that is not an option.  (The ARGV-elements have been permuted
    so that those that are not options now come last.)
 
    OPTSTRING is a string containing the legitimate option characters.
    If an option character is seen that is not listed in OPTSTRING,
-   return '?' after printing an error message.  If you set `opterr' to
+   return '?' after printing an error message.  If you set 'opterr' to
    zero, the error message is suppressed but we still return '?'.
 
    If a char in OPTSTRING is followed by a colon, that means it wants an arg,
    so the following text in the same ARGV-element, or the text of the following
-   ARGV-element, is returned in `optarg'.  Two colons mean an option that
+   ARGV-element, is returned in 'optarg'.  Two colons mean an option that
    wants an optional arg; if there is text in the current ARGV-element,
-   it is returned in `optarg', otherwise `optarg' is set to zero.
+   it is returned in 'optarg', otherwise 'optarg' is set to zero.
 
-   If OPTSTRING starts with `-' or `+', it requests different methods of
+   If OPTSTRING starts with '-' or '+', it requests different methods of
    handling the non-option ARGV-elements.
    See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
 
-   Long-named options begin with `--' instead of `-'.
+   Long-named options begin with '--' instead of '-'.
    Their names may be abbreviated as long as the abbreviation is unique
    or is an exact match for some defined option.  If they have an
    argument, it follows the option name in the same ARGV-element, separated
-   from the option name by a `=', or else the in next ARGV-element.
-   When `getopt' finds a long-named option, it returns 0 if that option's
-   `flag' field is nonzero, the value of the option's `val' field
-   if the `flag' field is zero.
+   from the option name by a '=', or else the in next ARGV-element.
+   When 'getopt' finds a long-named option, it returns 0 if that option's
+   'flag' field is nonzero, the value of the option's 'val' field
+   if the 'flag' field is zero.
 
    The elements of ARGV aren't really const, because we permute them.
    But we pretend they're const in the prototype to be compatible
    with other systems.
 
-   LONGOPTS is a vector of `struct option' terminated by an
+   LONGOPTS is a vector of 'struct option' terminated by an
    element containing a name which is zero.
 
    LONGIND returns the index in LONGOPT of the long-named option found.
@@ -409,7 +409,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
           d->__last_nonopt = d->optind;
         }
 
-      /* The special ARGV-element `--' means premature end of options.
+      /* 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.  */
@@ -479,23 +479,28 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
                             || !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;
       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, nameend - d->__nextchar))
+        if (!strncmp (p->name, d->__nextchar, namelen))
           {
-            if ((unsigned int) (nameend - d->__nextchar)
-                == (unsigned int) strlen (p->name))
+            if (namelen == (unsigned int) strlen (p->name))
               {
                 /* Exact match found.  */
                 pfound = p;
@@ -513,35 +518,71 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
                      || pfound->has_arg != p->has_arg
                      || pfound->flag != p->flag
                      || pfound->val != p->val)
-              /* Second or later nonexact match found.  */
-              ambig = 1;
+              {
+                /* Second or later nonexact match found.  */
+                struct option_list *newp = malloc (sizeof (*newp));
+                newp->p = p;
+                newp->next = ambig_list;
+                ambig_list = newp;
+              }
           }
 
-      if (ambig && !exact)
+      if (ambig_list != NULL && !exact)
         {
           if (print_errors)
             {
+              struct option_list first;
+              first.p = pfound;
+              first.next = ambig_list;
+              ambig_list = &first;
+
 #if defined _LIBC && defined USE_IN_LIBIO
-              char *buf;
+              char *buf = NULL;
+              size_t buflen = 0;
 
-              if (__asprintf (&buf, _("%s: option '%s' is ambiguous\n"),
-                              argv[0], argv[d->optind]) >= 0)
+              FILE *fp = open_memstream (&buf, &buflen);
+              if (fp != NULL)
                 {
-                  _IO_flockfile (stderr);
+                  fprintf (fp,
+                           _("%s: option '%s' is ambiguous; possibilities:"),
+                           argv[0], argv[d->optind]);
 
-                  int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                  ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+                  do
+                    {
+                      fprintf (fp, " '--%s'", ambig_list->p->name);
+                      ambig_list = ambig_list->next;
+                    }
+                  while (ambig_list != NULL);
 
-                  __fxprintf (NULL, "%s", buf);
+                  fputc_unlocked ('\n', fp);
 
-                  ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                  _IO_funlockfile (stderr);
+                  if (__builtin_expect (fclose (fp) != EOF, 1))
+                    {
+                      _IO_flockfile (stderr);
 
-                  free (buf);
+                      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\n"),
+              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
             }
           d->__nextchar += strlen (d->__nextchar);
@@ -550,6 +591,13 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
           return '?';
         }
 
+      while (ambig_list != NULL)
+        {
+          struct option_list *pn = ambig_list->next;
+          free (ambig_list);
+          ambig_list = pn;
+        }
+
       if (pfound != NULL)
         {
           option_index = indfound;
@@ -740,7 +788,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
     char c = *d->__nextchar++;
     const char *temp = strchr (optstring, c);
 
-    /* Increment `optind' when we start to process its last character.  */
+    /* Increment 'optind' when we start to process its last character.  */
     if (*d->__nextchar == '\0')
       ++d->optind;
 
@@ -791,6 +839,9 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
         int indfound = 0;
         int option_index;
 
+        if (longopts == NULL)
+          goto no_longs;
+
         /* This is an option that requires an argument.  */
         if (*d->__nextchar != '\0')
           {
@@ -836,7 +887,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
             return c;
           }
         else
-          /* We already incremented `d->optind' once;
+          /* We already incremented 'd->optind' once;
              increment it again when taking next ARGV-elt as argument.  */
           d->optarg = argv[d->optind++];
 
@@ -998,8 +1049,10 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
               }
             return pfound->val;
           }
-          d->__nextchar = NULL;
-          return 'W';   /* Let the application handle it.   */
+
+      no_longs:
+        d->__nextchar = NULL;
+        return 'W';   /* Let the application handle it.   */
       }
     if (temp[1] == ':')
       {
@@ -1061,7 +1114,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
                   c = '?';
               }
             else
-              /* We already incremented `optind' once;
+              /* We already incremented 'optind' once;
                  increment it again when taking next ARGV-elt as argument.  */
               d->optarg = argv[d->optind++];
             d->__nextchar = NULL;
@@ -1124,7 +1177,7 @@ __posix_getopt (int argc, char *const *argv, const char *optstring)
 #ifdef TEST
 
 /* Compile with -DTEST to make an executable for use in testing
-   the above definition of `getopt'.  */
+   the above definition of 'getopt'.  */
 
 int
 main (int argc, char **argv)
index 479493c..09c0a12 100644 (file)
@@ -1,5 +1,5 @@
 /* Declarations for getopt.
-   Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2011 Free Software
+   Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2012 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -16,7 +16,7 @@
    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef _GL_GETOPT_H
+#ifndef _@GUARD_PREFIX@_GETOPT_H
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 # undef _GL_SYSTEM_GETOPT
 #endif
 
-#ifndef _GL_GETOPT_H
+#ifndef _@GUARD_PREFIX@_GETOPT_H
 
 #ifndef __need_getopt
-# define _GL_GETOPT_H 1
+# define _@GUARD_PREFIX@_GETOPT_H 1
 #endif
 
 /* Standalone applications should #define __GETOPT_PREFIX to an
@@ -82,7 +82,7 @@
    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',
+   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.
 extern "C" {
 #endif
 
-/* For communication from `getopt' to the caller.
-   When `getopt' finds an option that takes an argument,
+/* 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,
+   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'.
+   and for communication between successive calls to 'getopt'.
 
-   On entry to `getopt', zero means this is the first call; initialize.
+   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
+   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
+   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
+/* Callers store zero here to inhibit the error message 'getopt' prints
    for unrecognized options.  */
 
 extern int opterr;
@@ -162,24 +162,24 @@ 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
+   of 'struct option' terminated by an element containing a name which is
    zero.
 
-   The field `has_arg' is:
+   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
+   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
+   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.  */
+   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
@@ -194,7 +194,7 @@ struct option
 #  define GNULIB_defined_struct_option 1
 # endif
 
-/* Names for the values of the `has_arg' field of `struct option'.  */
+/* Names for the values of the 'has_arg' field of 'struct option'.  */
 
 # define no_argument            0
 # define required_argument      1
@@ -208,23 +208,23 @@ struct option
 
    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
+   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'.
+   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'.
+   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
+   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
+   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
+   '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)
@@ -249,5 +249,5 @@ extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
 /* Make sure we later can get all the definitions and declarations.  */
 #undef __need_getopt
 
-#endif /* getopt.h */
-#endif /* getopt.h */
+#endif /* _@GUARD_PREFIX@_GETOPT_H */
+#endif /* _@GUARD_PREFIX@_GETOPT_H */
index 5cceeb4..cd053bd 100644 (file)
@@ -1,5 +1,5 @@
 /* getopt_long and getopt_long_only entry points for GNU getopt.
-   Copyright (C) 1987-1994, 1996-1998, 2004, 2006, 2009-2011 Free Software
+   Copyright (C) 1987-1994, 1996-1998, 2004, 2006, 2009-2012 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -141,11 +141,11 @@ main (int argc, char **argv)
           break;
 
         case 'c':
-          printf ("option c with value `%s'\n", optarg);
+          printf ("option c with value '%s'\n", optarg);
           break;
 
         case 'd':
-          printf ("option d with value `%s'\n", optarg);
+          printf ("option d with value '%s'\n", optarg);
           break;
 
         case '?':
index 17be98e..ce0853d 100644 (file)
@@ -1,5 +1,5 @@
 /* Internal declarations for getopt.
-   Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2004, 2009-2011 Free Software
+   Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2004, 2009-2012 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -40,7 +40,7 @@ extern int _getopt_internal (int ___argc, char **___argv,
    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
+   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
@@ -52,12 +52,12 @@ extern int _getopt_internal (int ___argc, char **___argv,
    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
+   with character code 1.  Using '-' as the first character of the
    list of option characters selects this mode of operation.
 
-   The special argument `--' forces an end of option-scanning regardless
-   of the value of `ordering'.  In the case of RETURN_IN_ORDER, only
-   `--' can cause `getopt' to return -1 with `optind' != ARGC.  */
+   The special argument '--' forces an end of option-scanning regardless
+   of the value of 'ordering'.  In the case of RETURN_IN_ORDER, only
+   '--' can cause 'getopt' to return -1 with 'optind' != ARGC.  */
 
 enum __ord
   {
@@ -99,8 +99,8 @@ struct _getopt_data
   /* Handle permutation of arguments.  */
 
   /* Describe the part of ARGV that contains non-options that have
-     been skipped.  `first_nonopt' is the index in ARGV of the first
-     of them; `last_nonopt' is the index after the last of them.  */
+     been skipped.  'first_nonopt' is the index in ARGV of the first
+     of them; 'last_nonopt' is the index after the last of them.  */
 
   int __first_nonopt;
   int __last_nonopt;
index c6b7925..151ba4f 100644 (file)
@@ -1,5 +1,5 @@
 /* Convenience header for conditional use of GNU <libintl.h>.
-   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2011 Free Software
+   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2012 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License along
-   with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _LIBGETTEXT_H
 #define _LIBGETTEXT_H 1
@@ -184,9 +183,12 @@ npgettext_aux (const char *domain,
 
 #include <string.h>
 
-#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
-  (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \
-   /* || __STDC_VERSION__ >= 199901L */ )
+#if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
+     /* || __STDC_VERSION__ >= 199901L */ )
+# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1
+#else
+# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0
+#endif
 
 #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
 #include <stdlib.h>
diff --git a/gnulib/lib/gettimeofday.c b/gnulib/lib/gettimeofday.c
new file mode 100644 (file)
index 0000000..17fcd43
--- /dev/null
@@ -0,0 +1,154 @@
+/* Provide gettimeofday for systems that don't have it or for which it's broken.
+
+   Copyright (C) 2001-2003, 2005-2007, 2009-2012 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation; either version 2.1, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser 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
+}
index b7e1289..cc7fefa 100644 (file)
@@ -1,6 +1,6 @@
 /* Test whether a character is a blank.
 
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/gnulib/lib/itold.c b/gnulib/lib/itold.c
new file mode 100644 (file)
index 0000000..8bc02ff
--- /dev/null
@@ -0,0 +1,28 @@
+/* Replacement for 'int' to 'long double' conversion routine.
+   Copyright (C) 2011-2012 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 Lesser General Public License as published by
+   the Free Software Foundation; either version 2.1 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <float.h>
+
+void
+_Qp_itoq (long double *result, int a)
+{
+  /* Convert from 'int' to 'double', then from 'double' to 'long double'.  */
+  *result = (double) a;
+}
index 0f5d5dc..30b5560 100644 (file)
@@ -1,5 +1,5 @@
 /* Substitute for and wrapper around <langinfo.h>.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://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>
  */
 
-#ifndef _GL_LANGINFO_H
+#ifndef _@GUARD_PREFIX@_LANGINFO_H
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
@@ -32,8 +31,8 @@
 # @INCLUDE_NEXT@ @NEXT_LANGINFO_H@
 #endif
 
-#ifndef _GL_LANGINFO_H
-#define _GL_LANGINFO_H
+#ifndef _@GUARD_PREFIX@_LANGINFO_H
+#define _@GUARD_PREFIX@_LANGINFO_H
 
 
 #if !@HAVE_LANGINFO_H@
@@ -173,5 +172,5 @@ _GL_WARN_ON_USE (nl_langinfo, "nl_langinfo is not portable - "
 #endif
 
 
-#endif /* _GL_LANGINFO_H */
-#endif /* _GL_LANGINFO_H */
+#endif /* _@GUARD_PREFIX@_LANGINFO_H */
+#endif /* _@GUARD_PREFIX@_LANGINFO_H */
index 3a49593..48e8a48 100644 (file)
@@ -1,6 +1,6 @@
 /* Determine a canonical name for the current locale's character encoding.
 
-   Copyright (C) 2000-2006, 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2000-2006, 2008-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -13,8 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License along
-   with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>.  */
 
 #include <stdlib.h>
 
 #if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET
-# define DARWIN7 /* Darwin 7 or newer, i.e. MacOS X 10.3 or newer */
+# define DARWIN7 /* Darwin 7 or newer, i.e. Mac OS X 10.3 or newer */
 #endif
 
 #if defined _WIN32 || defined __WIN32__
-# define WIN32_NATIVE
+# define WINDOWS_NATIVE
 #endif
 
 #if defined __EMX__
@@ -44,7 +43,7 @@
 # endif
 #endif
 
-#if !defined WIN32_NATIVE
+#if !defined WINDOWS_NATIVE
 # include <unistd.h>
 # if HAVE_LANGINFO_CODESET
 #  include <langinfo.h>
@@ -57,7 +56,7 @@
 #  define WIN32_LEAN_AND_MEAN
 #  include <windows.h>
 # endif
-#elif defined WIN32_NATIVE
+#elif defined WINDOWS_NATIVE
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
 #endif
@@ -83,7 +82,7 @@
 #endif
 
 #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
-  /* Win32, Cygwin, OS/2, DOS */
+  /* Native Windows, Cygwin, OS/2, DOS */
 # define ISSLASH(C) ((C) == '/' || (C) == '\\')
 #endif
 
@@ -123,7 +122,7 @@ get_charset_aliases (void)
   cp = charset_aliases;
   if (cp == NULL)
     {
-#if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE || defined __CYGWIN__)
+#if !(defined DARWIN7 || defined VMS || defined WINDOWS_NATIVE || defined __CYGWIN__)
       const char *dir;
       const char *base = "charset.alias";
       char *file_name;
@@ -308,7 +307,7 @@ get_charset_aliases (void)
            "DECKOREAN" "\0" "EUC-KR" "\0";
 # endif
 
-# if defined WIN32_NATIVE || defined __CYGWIN__
+# 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.  */
@@ -360,7 +359,7 @@ locale_charset (void)
   const char *codeset;
   const char *aliases;
 
-#if !(defined WIN32_NATIVE || defined OS2)
+#if !(defined WINDOWS_NATIVE || defined OS2)
 
 # if HAVE_LANGINFO_CODESET
 
@@ -407,10 +406,10 @@ locale_charset (void)
             }
         }
 
-      /* Woe32 has a function returning the locale's codepage as a number:
-         GetACP().  This encoding is used by Cygwin, unless the user has set
-         the environment variable CYGWIN=codepage:oem (which very few people
-         do).
+      /* The Windows API has a function returning the locale's codepage as a
+         number: GetACP().  This encoding is used by Cygwin, unless the user
+         has set the environment variable CYGWIN=codepage:oem (which very few
+         people do).
          Output directed to console windows needs to be converted (to
          GetOEMCP() if the console is using a raster font, or to
          GetConsoleOutputCP() if it is using a TrueType font).  Cygwin does
@@ -453,12 +452,12 @@ locale_charset (void)
 
 # endif
 
-#elif defined WIN32_NATIVE
+#elif defined WINDOWS_NATIVE
 
   static char buf[2 + 10 + 1];
 
-  /* Woe32 has a function returning the locale's codepage as a number:
-     GetACP().
+  /* 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.
index a38a1f6..7c30e69 100644 (file)
@@ -1,5 +1,5 @@
 /* Determine a canonical name for the current locale's character encoding.
-   Copyright (C) 2000-2003, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2000-2003, 2009-2012 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,8 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License along
-   with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _LOCALCHARSET_H
 #define _LOCALCHARSET_H
index 266b093..605b3fe 100644 (file)
@@ -1,5 +1,5 @@
 /* A POSIX <locale.h>.
-   Copyright (C) 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -14,7 +14,7 @@
    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef _GL_LOCALE_H
+#ifndef _@GUARD_PREFIX@_LOCALE_H
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_LOCALE_H@
 
-#ifndef _GL_LOCALE_H
-#define _GL_LOCALE_H
+#ifndef _@GUARD_PREFIX@_LOCALE_H
+#define _@GUARD_PREFIX@_LOCALE_H
 
 /* NetBSD 5.0 mis-defines NULL.  */
 #include <stddef.h>
 
-/* MacOS X 10.5 defines the locale_t type in <xlocale.h>.  */
+/* Mac OS X 10.5 defines the locale_t type in <xlocale.h>.  */
 #if @HAVE_XLOCALE_H@
 # include <xlocale.h>
 #endif
 # define LC_MESSAGES 1729
 #endif
 
+/* Bionic libc's 'struct lconv' is just a dummy.  */
+#if @REPLACE_STRUCT_LCONV@
+# define lconv rpl_lconv
+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> */
+
+  /* Symbol used as decimal point.  */
+  char *decimal_point;
+  /* Symbol used to separate groups of digits to the left of the decimal
+     point.  */
+  char *thousands_sep;
+  /* Definition of the size of groups of digits to the left of the decimal
+     point.  */
+  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> */
+
+  /* Symbol used as decimal point.  */
+  char *mon_decimal_point;
+  /* Symbol used to separate groups of digits to the left of the decimal
+     point.  */
+  char *mon_thousands_sep;
+  /* Definition of the size of groups of digits to the left of the decimal
+     point.  */
+  char *mon_grouping;
+  /* Sign used to indicate a value >= 0.  */
+  char *positive_sign;
+  /* Sign used to indicate a value < 0.  */
+  char *negative_sign;
+
+  /* For formatting local currency.  */
+  /* Currency symbol (3 characters) followed by separator (1 character).  */
+  char *currency_symbol;
+  /* Number of digits after the decimal point.  */
+  char frac_digits;
+  /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it
+     comes after the number.  */
+  char p_cs_precedes;
+  /* For values >= 0: Position of the sign.  */
+  char p_sign_posn;
+  /* For values >= 0: Placement of spaces between currency symbol, sign, and
+     number.  */
+  char p_sep_by_space;
+  /* For values < 0: 1 if the currency symbol precedes the number, 0 if it
+     comes after the number.  */
+  char n_cs_precedes;
+  /* For values < 0: Position of the sign.  */
+  char n_sign_posn;
+  /* For values < 0: Placement of spaces between currency symbol, sign, and
+     number.  */
+  char n_sep_by_space;
+
+  /* For formatting international currency.  */
+  /* Currency symbol (3 characters) followed by separator (1 character).  */
+  char *int_curr_symbol;
+  /* Number of digits after the decimal point.  */
+  char int_frac_digits;
+  /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it
+     comes after the number.  */
+  char int_p_cs_precedes;
+  /* For values >= 0: Position of the sign.  */
+  char int_p_sign_posn;
+  /* For values >= 0: Placement of spaces between currency symbol, sign, and
+     number.  */
+  char int_p_sep_by_space;
+  /* For values < 0: 1 if the currency symbol precedes the number, 0 if it
+     comes after the number.  */
+  char int_n_cs_precedes;
+  /* For values < 0: Position of the sign.  */
+  char int_n_sign_posn;
+  /* For values < 0: Placement of spaces between currency symbol, sign, and
+     number.  */
+  char int_n_sep_by_space;
+};
+#endif
+
+#if @GNULIB_LOCALECONV@
+# if @REPLACE_LOCALECONV@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef localeconv
+#   define localeconv rpl_localeconv
+#  endif
+_GL_FUNCDECL_RPL (localeconv, struct lconv *, (void));
+_GL_CXXALIAS_RPL (localeconv, struct lconv *, (void));
+# else
+_GL_CXXALIAS_SYS (localeconv, struct lconv *, (void));
+# endif
+_GL_CXXALIASWARN (localeconv);
+#elif @REPLACE_STRUCT_LCONV@
+# undef localeconv
+# define localeconv localeconv_used_without_requesting_gnulib_module_localeconv
+#elif defined GNULIB_POSIXCHECK
+# undef localeconv
+# if HAVE_RAW_DECL_LOCALECONV
+_GL_WARN_ON_USE (localeconv,
+                 "localeconv returns too few information on some platforms - "
+                 "use gnulib module localeconv for portability");
+# endif
+#endif
+
 #if @GNULIB_SETLOCALE@
 # if @REPLACE_SETLOCALE@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -92,5 +197,5 @@ _GL_WARN_ON_USE (duplocale, "duplocale is buggy on some glibc systems - "
 # endif
 #endif
 
-#endif /* _GL_LOCALE_H */
-#endif /* _GL_LOCALE_H */
+#endif /* _@GUARD_PREFIX@_LOCALE_H */
+#endif /* _@GUARD_PREFIX@_LOCALE_H */
diff --git a/gnulib/lib/localeconv.c b/gnulib/lib/localeconv.c
new file mode 100644 (file)
index 0000000..1e1640f
--- /dev/null
@@ -0,0 +1,103 @@
+/* Query locale dependent information for formatting numbers.
+   Copyright (C) 2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation; either version 2.1 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <locale.h>
+
+#if HAVE_STRUCT_LCONV_DECIMAL_POINT
+
+/* Override for platforms where 'struct lconv' lacks the int_p_*, int_n_*
+   members.  */
+
+struct lconv *
+localeconv (void)
+{
+  static struct lconv result;
+# undef lconv
+# undef localeconv
+  struct lconv *sys_result = localeconv ();
+
+  result.decimal_point = sys_result->decimal_point;
+  result.thousands_sep = sys_result->thousands_sep;
+  result.grouping = sys_result->grouping;
+  result.mon_decimal_point = sys_result->mon_decimal_point;
+  result.mon_thousands_sep = sys_result->mon_thousands_sep;
+  result.mon_grouping = sys_result->mon_grouping;
+  result.positive_sign = sys_result->positive_sign;
+  result.negative_sign = sys_result->negative_sign;
+  result.currency_symbol = sys_result->currency_symbol;
+  result.frac_digits = sys_result->frac_digits;
+  result.p_cs_precedes = sys_result->p_cs_precedes;
+  result.p_sign_posn = sys_result->p_sign_posn;
+  result.p_sep_by_space = sys_result->p_sep_by_space;
+  result.n_cs_precedes = sys_result->n_cs_precedes;
+  result.n_sign_posn = sys_result->n_sign_posn;
+  result.n_sep_by_space = sys_result->n_sep_by_space;
+  result.int_curr_symbol = sys_result->int_curr_symbol;
+  result.int_frac_digits = sys_result->int_frac_digits;
+  result.int_p_cs_precedes = sys_result->p_cs_precedes;
+  result.int_p_sign_posn = sys_result->p_sign_posn;
+  result.int_p_sep_by_space = sys_result->p_sep_by_space;
+  result.int_n_cs_precedes = sys_result->n_cs_precedes;
+  result.int_n_sign_posn = sys_result->n_sign_posn;
+  result.int_n_sep_by_space = sys_result->n_sep_by_space;
+
+  return &result;
+}
+
+#else
+
+/* Override for platforms where 'struct lconv' is a dummy.  */
+
+# include <limits.h>
+
+struct lconv *
+localeconv (void)
+{
+  static /*const*/ struct lconv result =
+    {
+      /* decimal_point */ ".",
+      /* thousands_sep */ "",
+      /* grouping */ "",
+      /* mon_decimal_point */ "",
+      /* mon_thousands_sep */ "",
+      /* mon_grouping */ "",
+      /* positive_sign */ "",
+      /* negative_sign */ "",
+      /* currency_symbol */ "",
+      /* frac_digits */ CHAR_MAX,
+      /* p_cs_precedes */ CHAR_MAX,
+      /* p_sign_posn */ CHAR_MAX,
+      /* p_sep_by_space */ CHAR_MAX,
+      /* n_cs_precedes */ CHAR_MAX,
+      /* n_sign_posn */ CHAR_MAX,
+      /* n_sep_by_space */ CHAR_MAX,
+      /* int_curr_symbol */ "",
+      /* int_frac_digits */ CHAR_MAX,
+      /* int_p_cs_precedes */ CHAR_MAX,
+      /* int_p_sign_posn */ CHAR_MAX,
+      /* int_p_sep_by_space */ CHAR_MAX,
+      /* int_n_cs_precedes */ CHAR_MAX,
+      /* int_n_sign_posn */ CHAR_MAX,
+      /* int_n_sep_by_space */ CHAR_MAX
+    };
+
+  return &result;
+}
+
+#endif
index bfb2b02..cee2649 100644 (file)
@@ -1,6 +1,6 @@
 /* Work around a bug of lstat on some systems
 
-   Copyright (C) 1997-2006, 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 1997-2006, 2008-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
 
 /* written by 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_lstat doesn't recurse to
+   rpl_lstat.  */
+#define __need_system_sys_stat_h
 #include <config.h>
 
 #if !HAVE_LSTAT
@@ -27,7 +31,6 @@ typedef int dummy;
 #else /* HAVE_LSTAT */
 
 /* Get the original definition of lstat.  It might be defined as a macro.  */
-# define __need_system_sys_stat_h
 # include <sys/types.h>
 # include <sys/stat.h>
 # undef __need_system_sys_stat_h
@@ -39,17 +42,20 @@ orig_lstat (const char *filename, struct stat *buf)
 }
 
 /* Specification.  */
-# include <sys/stat.h>
+/* 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 <string.h>
 # include <errno.h>
 
 /* lstat works differently on Linux and Solaris systems.  POSIX (see
-   `pathname resolution' in the glossary) requires that programs like
-   `ls' take into consideration the fact that FILE has a trailing slash
+   "pathname resolution" in the glossary) requires that programs like
+   'ls' take into consideration the fact that FILE has a trailing slash
    when FILE is a symbolic link.  On Linux and Solaris 10 systems, the
    lstat function already has the desired semantics (in treating
-   `lstat ("symlink/", sbuf)' just like `lstat ("symlink/.", sbuf)',
+   'lstat ("symlink/", sbuf)' just like 'lstat ("symlink/.", sbuf)',
    but on Solaris 9 and earlier it does not.
 
    If FILE has a trailing slash and specifies a symbolic link,
index bc84c41..1edf22d 100644 (file)
@@ -1,6 +1,6 @@
 /* malloc() function that is glibc compatible.
 
-   Copyright (C) 1997-1998, 2006-2007, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 1997-1998, 2006-2007, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://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
 #endif
 
-/* Specification.  */
 #include <stdlib.h>
 
 #include <errno.h>
 
-/* Call the system's malloc below.  */
-#undef malloc
-
 /* Allocate an N-byte block of memory from the heap.
    If N is zero, allocate a 1-byte block.  */
 
index 32d3a30..c80c3a2 100644 (file)
@@ -1,5 +1,5 @@
 /* Safe automatic memory allocation.
-   Copyright (C) 2003, 2006-2007, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006-2007, 2009-2012 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 Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
+#define _GL_USE_STDLIB_ALLOC 1
 #include <config.h>
 
 /* Specification.  */
 #include "malloca.h"
 
-#include "verify.h"
+#include <stdint.h>
 
-/* Use the system functions, not the gnulib overrides in this file.  */
-#undef malloc
+#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
@@ -87,7 +86,7 @@ mmalloca (size_t n)
           ((int *) p)[-1] = MAGIC_NUMBER;
 
           /* Enter p into the hash table.  */
-          slot = (unsigned long) p % HASH_TABLE_SIZE;
+          slot = (uintptr_t) p % HASH_TABLE_SIZE;
           ((struct header *) (p - HEADER_SIZE))->next = mmalloca_results[slot];
           mmalloca_results[slot] = p;
 
@@ -120,7 +119,7 @@ freea (void *p)
         {
           /* Looks like a mmalloca() result.  To see whether it really is one,
              perform a lookup in the hash table.  */
-          size_t slot = (unsigned long) p % HASH_TABLE_SIZE;
+          size_t slot = (uintptr_t) p % HASH_TABLE_SIZE;
           void **chain = &mmalloca_results[slot];
           for (; *chain != NULL;)
             {
index 086e903..160f146 100644 (file)
@@ -1,5 +1,5 @@
 /* Safe automatic memory allocation.
-   Copyright (C) 2003-2007, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2003-2007, 2009-2012 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,8 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _MALLOCA_H
 #define _MALLOCA_H
index b087cf3..ad53b4c 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert multibyte character to wide character.
-   Copyright (C) 1999-2002, 2005-2011 Free Software Foundation, Inc.
+   Copyright (C) 1999-2002, 2005-2012 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
@@ -128,7 +128,7 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
       {
         const char *encoding = locale_charset ();
 
-        if (STREQ (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0))
+        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];
@@ -185,7 +185,8 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
         /* As a reference for this code, you can use the GNU libiconv
            implementation.  Look for uses of the RET_TOOFEW macro.  */
 
-        if (STREQ (encoding, "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0))
+        if (STREQ_OPT (encoding,
+                       "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0))
           {
             if (m == 1)
               {
@@ -208,9 +209,12 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
               }
             goto invalid;
           }
-        if (STREQ (encoding, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
-            || STREQ (encoding, "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0)
-            || STREQ (encoding, "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0))
+        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)
               {
@@ -221,7 +225,8 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
               }
             goto invalid;
           }
-        if (STREQ (encoding, "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0))
+        if (STREQ_OPT (encoding,
+                       "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0))
           {
             if (m == 1)
               {
@@ -239,7 +244,8 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
               }
             goto invalid;
           }
-        if (STREQ (encoding, "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 0, 0))
+        if (STREQ_OPT (encoding,
+                       "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 0, 0))
           {
             if (m == 1)
               {
@@ -272,7 +278,7 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
               }
             goto invalid;
           }
-        if (STREQ (encoding, "SJIS", 'S', 'J', 'I', 'S', 0, 0, 0, 0, 0))
+        if (STREQ_OPT (encoding, "SJIS", 'S', 'J', 'I', 'S', 0, 0, 0, 0, 0))
           {
             if (m == 1)
               {
@@ -335,7 +341,7 @@ rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
   {
     static mbstate_t internal_state;
 
-    /* Override mbrtowc's internal state.  We can not call mbsinit() on the
+    /* Override mbrtowc's internal state.  We cannot call mbsinit() on the
        hidden internal state, but we can call it on our variable.  */
     if (ps == NULL)
       ps = &internal_state;
index f48af0e..ff1b230 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for initial conversion state.
-   Copyright (C) 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
index 8c3224d..0585291 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert string to wide string.
-   Copyright (C) 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
index a75f31e..b4c67cb 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert string to wide string.
-   Copyright (C) 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
@@ -22,7 +22,7 @@
 /* Internal state used by the functions mbsrtowcs() and mbsnrtowcs().  */
 mbstate_t _gl_mbsrtowcs_state
 /* The state must initially be in the "initial state"; so, zero-initialize it.
-   On most systems, putting it into BSS is sufficient.  Not so on MacOS X 10.3,
+   On most systems, putting it into BSS is sufficient.  Not so on Mac OS X 10.3,
    see <http://lists.gnu.org/archive/html/bug-gnulib/2009-01/msg00329.html>.
    When it needs an initializer, use 0 or {0} as initializer? 0 only works
    when mbstate_t is a scalar type (such as when gnulib defines it, or on
index eeba1c2..03f5077 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert string to wide string.
-   Copyright (C) 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
index d81db18..6a859bc 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert multibyte character to wide character.
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2011.
 
    This program is free software: you can redistribute it and/or modify
index ab6c3eb..744954b 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert multibyte character to wide character.
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2011.
 
    This program is free software: you can redistribute it and/or modify
index 05cf97f..e7d5b10 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2011
+/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2012
    Free Software Foundation, Inc.
 
    Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
index d8e7ffb..c68331a 100644 (file)
@@ -1,5 +1,5 @@
 /* Copy memory area and return pointer after last written byte.
-   Copyright (C) 2003, 2007, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2007, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -12,8 +12,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
diff --git a/gnulib/lib/mkstemp.c b/gnulib/lib/mkstemp.c
new file mode 100644 (file)
index 0000000..541425f
--- /dev/null
@@ -0,0 +1,50 @@
+/* Copyright (C) 1998-1999, 2001, 2005-2007, 2009-2012 Free Software
+   Foundation, Inc.
+   This file is derived from the one in the GNU C Library.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation; either version 2.1 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#if !_LIBC
+# include <config.h>
+#endif
+
+#include <stdlib.h>
+
+#if !_LIBC
+# include "tempname.h"
+# define __gen_tempname gen_tempname
+# ifndef __GT_FILE
+#  define __GT_FILE GT_FILE
+# endif
+#endif
+
+#include <stdio.h>
+
+#ifndef __GT_FILE
+# define __GT_FILE 0
+#endif
+
+/* Generate a unique temporary file name from XTEMPLATE.
+   The last six characters of XTEMPLATE must be "XXXXXX";
+   they are replaced with a string that makes the file name unique.
+   Then open the file and return a fd.
+
+   If you are creating temporary files which will later be removed,
+   consider using the clean-temp module, which avoids several pitfalls
+   of using mkstemp directly. */
+int
+mkstemp (char *xtemplate)
+{
+  return __gen_tempname (xtemplate, 0, 0, __GT_FILE);
+}
index bb2cf90..d4e4173 100644 (file)
@@ -1,6 +1,6 @@
 /* nl_langinfo() replacement: query locale dependent information.
 
-   Copyright (C) 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -141,7 +141,8 @@ nl_langinfo (nl_item item)
       {
         static char buf[2 + 10 + 1];
 
-        /* Woe32 has a function returning the locale's codepage as a number.  */
+        /* The Windows API has a function returning the locale's codepage as
+           a number.  */
         sprintf (buf, "CP%u", GetACP ());
         return buf;
       }
index 4d8fc3b..c16bbf6 100644 (file)
@@ -1,5 +1,5 @@
 /* Define PATH_MAX somehow.  Requires sys/types.h.
-   Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2011 Free Software
+   Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2012 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://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>
+   PATH_MAX is not defined on systems which have no limit on filename length,
+   such as GNU/Hurd.
+
+   This file does *not* define PATH_MAX always.  Programs that use this file
+   can handle the GNU/Hurd case in several ways:
+     - Either with a package-wide handling, or with a per-file handling,
+     - Either through a
+         #ifdef PATH_MAX
+       or through a fallback like
+         #ifndef PATH_MAX
+         # define PATH_MAX 8192
+         #endif
+       or through a fallback like
+         #ifndef PATH_MAX
+         # define PATH_MAX pathconf ("/", _PC_PATH_MAX)
+         #endif
+ */
+
 # include <unistd.h>
 
 # include <limits.h>
 #  define _POSIX_PATH_MAX 256
 # endif
 
-# if !defined PATH_MAX && defined _PC_PATH_MAX && defined HAVE_PATHCONF
-#  define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 \
-                    : pathconf ("/", _PC_PATH_MAX))
-# endif
-
 /* Don't include sys/param.h if it already has been.  */
 # if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
 #  include <sys/param.h>
 #  define PATH_MAX MAXPATHLEN
 # endif
 
-# ifndef PATH_MAX
-#  define PATH_MAX _POSIX_PATH_MAX
+# ifdef __hpux
+/* On HP-UX, PATH_MAX designates the maximum number of bytes in a filename,
+   *not* including the terminating NUL byte, and is set to 1023.
+   Additionally, when _XOPEN_SOURCE is defined to 500 or more, PATH_MAX is
+   not defined at all any more.  */
+#  undef PATH_MAX
+#  define PATH_MAX 1024
+# endif
+
+# if (defined _WIN32 || 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>
+   explains that the maximum size of a filename, including the terminating
+   NUL byte, is 260 = 3 + 256 + 1.
+   This is the same value as
+     - FILENAME_MAX in <stdio.h>,
+     - _MAX_PATH in <stdlib.h>,
+     - MAX_PATH in <windef.h>.
+   Undefine the original value, because mingw's <limits.h> gets it wrong.  */
+#  undef PATH_MAX
+#  define PATH_MAX 260
 # endif
 
 #endif /* _PATHMAX_H */
index f913a96..d40ef25 100644 (file)
@@ -1,5 +1,5 @@
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2011 Free Software
+   Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2012 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License along
-   with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* This file can be parametrized with the following macros:
      ENABLE_UNISTDIO    Set to 1 to enable the unistdio extensions.
index 3b8d9af..3e192a1 100644 (file)
@@ -1,5 +1,5 @@
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003, 2006-2007, 2011 Free Software
+   Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2012 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License along
-   with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _PRINTF_ARGS_H
 #define _PRINTF_ARGS_H
index a147412..5bc6ef6 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999-2000, 2002-2003, 2006-2011 Free Software Foundation, Inc.
+   Copyright (C) 1999-2000, 2002-2003, 2006-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -12,8 +12,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License along
-   with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* This file can be parametrized with the following macros:
      CHAR_T             The element type of the format string.
@@ -402,7 +401,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
                       cp++;
                     }
 #if defined __APPLE__ && defined __MACH__
-                  /* On MacOS X 10.3, PRIdMAX is defined as "qd".
+                  /* On Mac OS X 10.3, PRIdMAX is defined as "qd".
                      We cannot change it to "lld" because PRIdMAX must also
                      be understood by the system's printf routines.  */
                   else if (*cp == 'q')
@@ -421,7 +420,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
                     }
 #endif
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-                  /* On native Win32, PRIdMAX is defined as "I64d".
+                  /* 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.  */
                   else if (*cp == 'I' && cp[1] == '6' && cp[2] == '4')
index b8583e3..627bb98 100644 (file)
@@ -1,5 +1,5 @@
 /* Parse printf format string.
-   Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2011 Free Software
+   Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2012 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License along
-   with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _PRINTF_PARSE_H
 #define _PRINTF_PARSE_H
diff --git a/gnulib/lib/rawmemchr.c b/gnulib/lib/rawmemchr.c
new file mode 100644 (file)
index 0000000..f7416ca
--- /dev/null
@@ -0,0 +1,136 @@
+/* Searching in a string.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation; either version 2.1 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <string.h>
+
+/* Find the first occurrence of C in S.  */
+void *
+rawmemchr (const void *s, int c_in)
+{
+  /* 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 char c;
+
+  c = (unsigned char) c_in;
+
+  /* Handle the first 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;
+       (size_t) char_ptr % sizeof (longword) != 0;
+       ++char_ptr)
+    if (*char_ptr == c)
+      return (void *) char_ptr;
+
+  longword_ptr = (const longword *) 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 NUL or
+     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.
+
+     The test whether any byte in longword1 is zero is equivalent
+     to testing whether tmp is nonzero.
+
+     This test can read beyond the end of a string, depending on where
+     C_IN is encountered.  However, this is considered safe since the
+     initialization phase ensured that the read will be aligned,
+     therefore, the read will not cross page boundaries and will not
+     cause a fault.  */
+
+  while (1)
+    {
+      longword longword1 = *longword_ptr ^ repeated_c;
+
+      if ((((longword1 - repeated_one) & ~longword1)
+           & (repeated_one << 7)) != 0)
+        break;
+      longword_ptr++;
+    }
+
+  char_ptr = (const unsigned char *) longword_ptr;
+
+  /* At this point, we know that 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.  */
+
+  char_ptr = (unsigned char *) longword_ptr;
+  while (*char_ptr != c)
+    char_ptr++;
+  return (void *) char_ptr;
+}
diff --git a/gnulib/lib/rawmemchr.valgrind b/gnulib/lib/rawmemchr.valgrind
new file mode 100644 (file)
index 0000000..6363923
--- /dev/null
@@ -0,0 +1,12 @@
+# Suppress a valgrind message about use of uninitialized memory in rawmemchr().
+# This use is OK because it provides only a speedup.
+{
+    rawmemchr-value4
+    Memcheck:Value4
+    fun:rawmemchr
+}
+{
+    rawmemchr-value8
+    Memcheck:Value8
+    fun:rawmemchr
+}
index 8470f06..1e58aa8 100644 (file)
@@ -1,5 +1,5 @@
 /* Stub for readlink().
-   Copyright (C) 2003-2007, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2003-2007, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index e0a7a16..6e9a51e 100644 (file)
@@ -1,6 +1,6 @@
 /* realloc() function that is glibc compatible.
 
-   Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2011 Free Software
+   Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2012 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -18,6 +18,7 @@
 
 /* written by Jim Meyering and Bruno Haible */
 
+#define _GL_USE_STDLIB_ALLOC 1
 #include <config.h>
 
 /* Only the AC_FUNC_REALLOC macro defines 'realloc' already in config.h.  */
 # define SYSTEM_MALLOC_GLIBC_COMPATIBLE 1
 #endif
 
-/* Below we want to call the system's malloc and realloc.
-   Undefine the symbols here so that including <stdlib.h> provides a
-   declaration of malloc(), not of rpl_malloc(), and likewise for realloc.  */
-#undef malloc
-#undef realloc
-
-/* Specification.  */
 #include <stdlib.h>
 
 #include <errno.h>
 
-/* Below we want to call the system's malloc and realloc.
-   Undefine the symbols, if they were defined by gnulib's <stdlib.h>
-   replacement.  */
-#undef malloc
-#undef realloc
-
 /* Change the size of an allocated block of memory P to N bytes,
    with error checking.  If N is zero, change it to 1.  If P is NULL,
    use malloc.  */
index 12835d0..e4e6c79 100644 (file)
@@ -1,6 +1,6 @@
 # Add this package to a list of references stored in a text file.
 #
-#   Copyright (C) 2000, 2009-2011 Free Software Foundation, Inc.
+#   Copyright (C) 2000, 2009-2012 Free Software Foundation, Inc.
 #
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU Lesser General Public License as published by
@@ -13,8 +13,7 @@
 #   GNU Lesser General Public License for more details.
 #
 #   You should have received a copy of the GNU Lesser General Public License along
-#   with this program; if not, write to the Free Software Foundation,
-#   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#   with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # Written by Bruno Haible <haible@clisp.cons.org>.
 #
index 360e4d6..73d01d5 100644 (file)
@@ -1,6 +1,6 @@
 # Remove this package from a list of references stored in a text file.
 #
-#   Copyright (C) 2000, 2009-2011 Free Software Foundation, Inc.
+#   Copyright (C) 2000, 2009-2012 Free Software Foundation, Inc.
 #
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU Lesser General Public License as published by
@@ -13,8 +13,7 @@
 #   GNU Lesser General Public License for more details.
 #
 #   You should have received a copy of the GNU Lesser General Public License along
-#   with this program; if not, write to the Free Software Foundation,
-#   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#   with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # Written by Bruno Haible <haible@clisp.cons.org>.
 #
index b6dfe4a..707b123 100644 (file)
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2011 Free Software Foundation, Inc.
+   Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
 
@@ -14,8 +14,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License along
-   with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern,
                                          size_t length, reg_syntax_t syntax);
@@ -206,7 +205,7 @@ static const size_t __re_error_msgid_idx[] =
    compiles PATTERN (of length LENGTH) and puts the result in BUFP.
    Returns 0 if the pattern was valid, otherwise an error string.
 
-   Assumes the `allocated' (and perhaps `buffer') and `translate' fields
+   Assumes the 'allocated' (and perhaps 'buffer') and 'translate' fields
    are set in BUFP on entry.  */
 
 #ifdef _LIBC
@@ -241,7 +240,7 @@ re_compile_pattern (const char *pattern, size_t length,
 weak_alias (__re_compile_pattern, re_compile_pattern)
 #endif
 
-/* Set by `re_set_syntax' to the current regexp syntax to recognize.  Can
+/* Set by 're_set_syntax' to the current regexp syntax to recognize.  Can
    also be assigned to arbitrarily: each pattern buffer stores its own
    syntax, so it can be changed between regex compilations.  */
 /* This has no initializer because initialized variables in Emacs
@@ -273,7 +272,7 @@ int
 re_compile_fastmap (bufp)
     struct re_pattern_buffer *bufp;
 {
-  re_dfa_t *dfa = (re_dfa_t *) bufp->buffer;
+  re_dfa_t *dfa = bufp->buffer;
   char *fastmap = bufp->fastmap;
 
   memset (fastmap, '\0', sizeof (char) * SBC_MAX);
@@ -307,7 +306,7 @@ static void
 re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
                         char *fastmap)
 {
-  re_dfa_t *dfa = (re_dfa_t *) bufp->buffer;
+  re_dfa_t *dfa = bufp->buffer;
   Idx node_cnt;
   bool icase = (dfa->mb_cur_max == 1 && (bufp->syntax & RE_ICASE));
   for (node_cnt = 0; node_cnt < init_state->nodes.nelem; ++node_cnt)
@@ -439,15 +438,15 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
    PREG is a regex_t *.  We do not expect any fields to be initialized,
    since POSIX says we shouldn't.  Thus, we set
 
-     `buffer' to the compiled pattern;
-     `used' to the length of the compiled pattern;
-     `syntax' to RE_SYNTAX_POSIX_EXTENDED if the
+     'buffer' to the compiled pattern;
+     'used' to the length of the compiled pattern;
+     'syntax' to RE_SYNTAX_POSIX_EXTENDED if the
        REG_EXTENDED bit in CFLAGS is set; otherwise, to
        RE_SYNTAX_POSIX_BASIC;
-     `newline_anchor' to REG_NEWLINE being set in CFLAGS;
-     `fastmap' to an allocated space for the fastmap;
-     `fastmap_accurate' to zero;
-     `re_nsub' to the number of subexpressions in PATTERN.
+     'newline_anchor' to REG_NEWLINE being set in CFLAGS;
+     'fastmap' to an allocated space for the fastmap;
+     'fastmap_accurate' to zero;
+     're_nsub' to the number of subexpressions in PATTERN.
 
    PATTERN is the address of the pattern string.
 
@@ -586,19 +585,23 @@ weak_alias (__regerror, regerror)
 static const bitset_t utf8_sb_map =
 {
   /* Set the first 128 bits.  */
-# if 4 * BITSET_WORD_BITS < ASCII_CHARS
-#  error "bitset_word_t is narrower than 32 bits"
-# elif 3 * BITSET_WORD_BITS < ASCII_CHARS
+# ifdef __GNUC__
+  [0 ... 0x80 / BITSET_WORD_BITS - 1] = BITSET_WORD_MAX
+# else
+#  if 4 * BITSET_WORD_BITS < ASCII_CHARS
+#   error "bitset_word_t is narrower than 32 bits"
+#  elif 3 * BITSET_WORD_BITS < ASCII_CHARS
   BITSET_WORD_MAX, BITSET_WORD_MAX, BITSET_WORD_MAX,
-# elif 2 * BITSET_WORD_BITS < ASCII_CHARS
+#  elif 2 * BITSET_WORD_BITS < ASCII_CHARS
   BITSET_WORD_MAX, BITSET_WORD_MAX,
-# elif 1 * BITSET_WORD_BITS < ASCII_CHARS
+#  elif 1 * BITSET_WORD_BITS < ASCII_CHARS
   BITSET_WORD_MAX,
-# endif
+#  endif
   (BITSET_WORD_MAX
    >> (SBC_MAX % BITSET_WORD_BITS == 0
        ? 0
        : BITSET_WORD_BITS - SBC_MAX % BITSET_WORD_BITS))
+# endif
 };
 #endif
 
@@ -657,7 +660,7 @@ void
 regfree (preg)
     regex_t *preg;
 {
-  re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+  re_dfa_t *dfa = preg->buffer;
   if (BE (dfa != NULL, 1))
     free_dfa_content (dfa);
   preg->buffer = NULL;
@@ -718,7 +721,7 @@ re_comp (s)
                                 + __re_error_msgid_idx[(int) REG_ESPACE]);
     }
 
-  /* Since `re_exec' always passes NULL for the `regs' argument, we
+  /* Since 're_exec' always passes NULL for the 'regs' argument, we
      don't need to initialize the pattern buffer fields which affect it.  */
 
   /* Match anchors at newlines.  */
@@ -729,7 +732,7 @@ re_comp (s)
   if (!ret)
     return NULL;
 
-  /* Yes, we're discarding `const' here if !HAVE_LIBINTL.  */
+  /* Yes, we're discarding 'const' here if !HAVE_LIBINTL.  */
   return (char *) gettext (__re_error_msgid + __re_error_msgid_idx[(int) ret]);
 }
 
@@ -764,7 +767,7 @@ re_compile_internal (regex_t *preg, const char * pattern, size_t length,
   preg->regs_allocated = REGS_UNALLOCATED;
 
   /* Initialize the dfa.  */
-  dfa = (re_dfa_t *) preg->buffer;
+  dfa = preg->buffer;
   if (BE (preg->allocated < sizeof (re_dfa_t), 0))
     {
       /* If zero allocated, but buffer is non-null, try to realloc
@@ -775,7 +778,7 @@ re_compile_internal (regex_t *preg, const char * pattern, size_t length,
       if (dfa == NULL)
        return REG_ESPACE;
       preg->allocated = sizeof (re_dfa_t);
-      preg->buffer = (unsigned char *) dfa;
+      preg->buffer = dfa;
     }
   preg->used = sizeof (re_dfa_t);
 
@@ -850,7 +853,7 @@ init_dfa (re_dfa_t *dfa, size_t pat_len)
 {
   __re_size_t table_size;
 #ifndef _LIBC
-  char *codeset_name;
+  const char *codeset_name;
 #endif
 #ifdef RE_ENABLE_I18N
   size_t max_i18n_object_size = MAX (sizeof (wchar_t), sizeof (wctype_t));
@@ -873,7 +876,7 @@ 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 (SIZE_MAX / max_object_size / 2 <= pat_len, 0))
+  if (BE (MIN (IDX_MAX, SIZE_MAX / max_object_size) / 2 <= pat_len, 0))
     return REG_ESPACE;
 
   dfa->nodes_alloc = pat_len + 1;
@@ -896,8 +899,10 @@ init_dfa (re_dfa_t *dfa, size_t pat_len)
                       != 0);
 #else
   codeset_name = nl_langinfo (CODESET);
-  if (strcasecmp (codeset_name, "UTF-8") == 0
-      || strcasecmp (codeset_name, "UTF8") == 0)
+  if ((codeset_name[0] == 'U' || codeset_name[0] == 'u')
+      && (codeset_name[1] == 'T' || codeset_name[1] == 't')
+      && (codeset_name[2] == 'F' || codeset_name[2] == 'f')
+      && strcmp (codeset_name + 3 + (codeset_name[3] == '-'), "8") == 0)
     dfa->is_utf8 = 1;
 
   /* We check exhaustively in the loop below if this charset is a
@@ -947,9 +952,43 @@ static void
 internal_function
 init_word_char (re_dfa_t *dfa)
 {
-  int i, j, ch;
   dfa->word_ops_used = 1;
-  for (i = 0, ch = 0; i < BITSET_WORDS; ++i)
+  int i = 0;
+  int j;
+  int ch = 0;
+  if (BE (dfa->map_notascii == 0, 1))
+    {
+      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)
+       {
+         dfa->word_char[0] = bits1 << 31 << 1 | bits0;
+         dfa->word_char[1] = bits3 << 31 << 1 | bits2;
+         i = 2;
+       }
+      else if (BITSET_WORD_BITS == 32)
+       {
+         dfa->word_char[0] = bits0;
+         dfa->word_char[1] = bits1;
+         dfa->word_char[2] = bits2;
+         dfa->word_char[3] = bits3;
+         i = 4;
+       }
+      else
+        goto general_case;
+      ch = 128;
+
+      if (BE (dfa->is_utf8, 1))
+       {
+         memset (&dfa->word_char[i], '\0', (SBC_MAX - ch) / 8);
+         return;
+       }
+    }
+
+ general_case:
+  for (; i < BITSET_WORDS; ++i)
     for (j = 0; j < BITSET_WORD_BITS; ++j, ++ch)
       if (isalnum (ch) || ch == '_')
        dfa->word_char[i] |= (bitset_word_t) 1 << j;
@@ -960,7 +999,7 @@ init_word_char (re_dfa_t *dfa)
 static void
 free_workarea_compile (regex_t *preg)
 {
-  re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+  re_dfa_t *dfa = preg->buffer;
   bin_tree_storage_t *storage, *next;
   for (storage = dfa->str_tree_storage; storage; storage = next)
     {
@@ -1144,7 +1183,7 @@ optimize_utf8 (re_dfa_t *dfa)
 static reg_errcode_t
 analyze (regex_t *preg)
 {
-  re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+  re_dfa_t *dfa = preg->buffer;
   reg_errcode_t ret;
 
   /* Allocate arrays.  */
@@ -1325,7 +1364,7 @@ lower_subexps (void *extra, bin_tree_t *node)
 static bin_tree_t *
 lower_subexp (reg_errcode_t *err, regex_t *preg, bin_tree_t *node)
 {
-  re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+  re_dfa_t *dfa = preg->buffer;
   bin_tree_t *body = node->left;
   bin_tree_t *op, *cls, *tree1, *tree;
 
@@ -1659,7 +1698,7 @@ calc_eclosure (re_dfa_t *dfa)
       /* If we have already calculated, skip it.  */
       if (dfa->eclosures[node_idx].nelem != 0)
        continue;
-      /* Calculate epsilon closure of `node_idx'.  */
+      /* Calculate epsilon closure of 'node_idx'.  */
       err = calc_eclosure_iter (&eclosure_elem, dfa, node_idx, true);
       if (BE (err != REG_NOERROR, 0))
        return err;
@@ -1709,14 +1748,14 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root)
       {
        re_node_set eclosure_elem;
        Idx edest = dfa->edests[node].elems[i];
-       /* If calculating the epsilon closure of `edest' is in progress,
+       /* If calculating the epsilon closure of 'edest' is in progress,
           return intermediate result.  */
        if (dfa->eclosures[edest].nelem == REG_MISSING)
          {
            incomplete = true;
            continue;
          }
-       /* If we haven't calculated the epsilon closure of `edest' yet,
+       /* If we haven't calculated the epsilon closure of 'edest' yet,
           calculate now. Otherwise use calculated epsilon closure.  */
        if (dfa->eclosures[edest].nelem == 0)
          {
@@ -1726,11 +1765,11 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root)
          }
        else
          eclosure_elem = dfa->eclosures[edest];
-       /* Merge the epsilon closure of `edest'.  */
+       /* Merge the epsilon closure of 'edest'.  */
        err = re_node_set_merge (&eclosure, &eclosure_elem);
        if (BE (err != REG_NOERROR, 0))
          return err;
-       /* If the epsilon closure of `edest' is incomplete,
+       /* If the epsilon closure of 'edest' is incomplete,
           the epsilon closure of this node is also incomplete.  */
        if (dfa->eclosures[edest].nelem == 0)
          {
@@ -2092,7 +2131,7 @@ peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
 
 /* Entry point of the parser.
    Parse the regular expression REGEXP and return the structure tree.
-   If an error is occured, ERR is set by error code, and return NULL.
+   If an error occurs, ERR is set by error code, and return NULL.
    This function build the following tree, from regular expression <reg_exp>:
           CAT
           / \
@@ -2106,7 +2145,7 @@ static bin_tree_t *
 parse (re_string_t *regexp, regex_t *preg, reg_syntax_t syntax,
        reg_errcode_t *err)
 {
-  re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+  re_dfa_t *dfa = preg->buffer;
   bin_tree_t *tree, *eor, *root;
   re_token_t current_token;
   dfa->syntax = syntax;
@@ -2134,13 +2173,13 @@ parse (re_string_t *regexp, regex_t *preg, reg_syntax_t syntax,
          /   \
    <branch1> <branch2>
 
-   ALT means alternative, which represents the operator `|'.  */
+   ALT means alternative, which represents the operator '|'.  */
 
 static bin_tree_t *
 parse_reg_exp (re_string_t *regexp, regex_t *preg, re_token_t *token,
               reg_syntax_t syntax, Idx nest, reg_errcode_t *err)
 {
-  re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+  re_dfa_t *dfa = preg->buffer;
   bin_tree_t *tree, *branch = NULL;
   tree = parse_branch (regexp, preg, token, syntax, nest, err);
   if (BE (*err != REG_NOERROR && tree == NULL, 0))
@@ -2182,7 +2221,7 @@ parse_branch (re_string_t *regexp, regex_t *preg, re_token_t *token,
              reg_syntax_t syntax, Idx nest, reg_errcode_t *err)
 {
   bin_tree_t *tree, *expr;
-  re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+  re_dfa_t *dfa = preg->buffer;
   tree = parse_expression (regexp, preg, token, syntax, nest, err);
   if (BE (*err != REG_NOERROR && tree == NULL, 0))
     return NULL;
@@ -2193,16 +2232,21 @@ parse_branch (re_string_t *regexp, regex_t *preg, re_token_t *token,
       expr = parse_expression (regexp, preg, token, syntax, nest, err);
       if (BE (*err != REG_NOERROR && expr == NULL, 0))
        {
+         if (tree != NULL)
+           postorder (tree, free_tree, NULL);
          return NULL;
        }
       if (tree != NULL && expr != NULL)
        {
-         tree = create_tree (dfa, tree, expr, CONCAT);
-         if (tree == NULL)
+         bin_tree_t *newtree = create_tree (dfa, tree, expr, CONCAT);
+         if (newtree == NULL)
            {
+             postorder (expr, free_tree, NULL);
+             postorder (tree, free_tree, NULL);
              *err = REG_ESPACE;
              return NULL;
            }
+         tree = newtree;
        }
       else if (tree == NULL)
        tree = expr;
@@ -2221,7 +2265,7 @@ static bin_tree_t *
 parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
                  reg_syntax_t syntax, Idx nest, reg_errcode_t *err)
 {
-  re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+  re_dfa_t *dfa = preg->buffer;
   bin_tree_t *tree;
   switch (token->type)
     {
@@ -2437,7 +2481,7 @@ static bin_tree_t *
 parse_sub_exp (re_string_t *regexp, regex_t *preg, re_token_t *token,
               reg_syntax_t syntax, Idx nest, reg_errcode_t *err)
 {
-  re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+  re_dfa_t *dfa = preg->buffer;
   bin_tree_t *tree;
   size_t cur_nsub;
   cur_nsub = preg->re_nsub++;
@@ -2451,7 +2495,11 @@ parse_sub_exp (re_string_t *regexp, regex_t *preg, re_token_t *token,
     {
       tree = parse_reg_exp (regexp, preg, token, syntax, nest, err);
       if (BE (*err == REG_NOERROR && token->type != OP_CLOSE_SUBEXP, 0))
-       *err = REG_EPAREN;
+       {
+         if (tree != NULL)
+           postorder (tree, free_tree, NULL);
+         *err = REG_EPAREN;
+       }
       if (BE (*err != REG_NOERROR, 0))
        return NULL;
     }
@@ -2529,6 +2577,12 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
          *err = REG_BADBR;
          return NULL;
        }
+
+      if (BE (RE_DUP_MAX < (end == REG_MISSING ? start : end), 0))
+       {
+         *err = REG_ESIZE;
+         return NULL;
+       }
     }
   else
     {
@@ -2569,7 +2623,10 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
     old_tree = NULL;
 
   if (elem->token.type == SUBEXP)
-    postorder (elem, mark_opt_subexp, (void *) (long) elem->token.opr.idx);
+    {
+      uintptr_t subidx = elem->token.opr.idx;
+      postorder (elem, mark_opt_subexp, (void *) subidx);
+    }
 
   tree = create_tree (dfa, elem, NULL,
                      (end == REG_MISSING ? OP_DUP_ASTERISK : OP_ALT));
@@ -2615,7 +2672,7 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
      Build the range expression which starts from START_ELEM, and ends
      at END_ELEM.  The result are written to MBCSET and SBCSET.
      RANGE_ALLOC is the allocated size of mbcset->range_starts, and
-     mbcset->range_ends, is a pointer argument sinse we may
+     mbcset->range_ends, is a pointer argument since we may
      update it.  */
 
 static reg_errcode_t
@@ -2749,11 +2806,12 @@ build_range_exp (const reg_syntax_t syntax,
 
 static reg_errcode_t
 internal_function
-build_collating_symbol (bitset_t sbcset,
 # ifdef RE_ENABLE_I18N
-                       re_charset_t *mbcset, Idx *coll_sym_alloc,
-# endif
-                       const unsigned char *name)
+build_collating_symbol (bitset_t sbcset, re_charset_t *mbcset,
+                       Idx *coll_sym_alloc, const unsigned char *name)
+# else /* not RE_ENABLE_I18N */
+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))
@@ -2781,8 +2839,8 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
   const int32_t *symb_table;
   const unsigned char *extra;
 
-  /* Local function for parse_bracket_exp used in _LIBC environement.
-     Seek the collating symbol entry correspondings to NAME.
+  /* Local function for parse_bracket_exp used in _LIBC environment.
+     Seek the collating symbol entry corresponding to NAME.
      Return the index of the symbol in the SYMB_TABLE.  */
 
   auto inline int32_t
@@ -2885,11 +2943,11 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
       return UINT_MAX;
     }
 
-  /* Local function for parse_bracket_exp used in _LIBC environement.
+  /* Local function for parse_bracket_exp used in _LIBC environment.
      Build the range expression which starts from START_ELEM, and ends
      at END_ELEM.  The result are written to MBCSET and SBCSET.
      RANGE_ALLOC is the allocated size of mbcset->range_starts, and
-     mbcset->range_ends, is a pointer argument sinse we may
+     mbcset->range_ends, is a pointer argument since we may
      update it.  */
 
   auto inline reg_errcode_t
@@ -2969,11 +3027,11 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
       return REG_NOERROR;
     }
 
-  /* Local function for parse_bracket_exp used in _LIBC environement.
+  /* Local function for parse_bracket_exp used in _LIBC environment.
      Build the collating element which is represented by NAME.
      The result are written to MBCSET and SBCSET.
      COLL_SYM_ALLOC is the allocated size of mbcset->coll_sym, is a
-     pointer argument sinse we may update it.  */
+     pointer argument since we may update it.  */
 
   auto inline reg_errcode_t
   __attribute ((always_inline))
@@ -3075,6 +3133,10 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
   if (BE (sbcset == NULL, 0))
 #endif /* RE_ENABLE_I18N */
     {
+      re_free (sbcset);
+#ifdef RE_ENABLE_I18N
+      re_free (mbcset);
+#endif
       *err = REG_ESPACE;
       return NULL;
     }
@@ -3413,7 +3475,7 @@ parse_bracket_symbol (bracket_elem_t *elem, re_string_t *regexp,
      Build the equivalence class which is represented by NAME.
      The result are written to MBCSET and SBCSET.
      EQUIV_CLASS_ALLOC is the allocated size of mbcset->equiv_classes,
-     is a pointer argument sinse we may update it.  */
+     is a pointer argument since we may update it.  */
 
 static reg_errcode_t
 #ifdef RE_ENABLE_I18N
@@ -3444,19 +3506,18 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name)
                                                   _NL_COLLATE_EXTRAMB);
       indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE,
                                                _NL_COLLATE_INDIRECTMB);
-      idx1 = findidx (&cp);
-      if (BE (idx1 == 0 || cp < name + strlen ((const char *) name), 0))
+      idx1 = findidx (&cp, -1);
+      if (BE (idx1 == 0 || *cp != '\0', 0))
        /* This isn't a valid character.  */
        return REG_ECOLLATE;
 
-      /* Build single byte matcing table for this equivalence class.  */
-      char_buf[1] = (unsigned char) '\0';
+      /* Build single byte matching table for this equivalence class.  */
       len = weights[idx1 & 0xffffff];
       for (ch = 0; ch < SBC_MAX; ++ch)
        {
          char_buf[0] = ch;
          cp = char_buf;
-         idx2 = findidx (&cp);
+         idx2 = findidx (&cp, 1);
 /*
          idx2 = table[ch];
 */
@@ -3509,7 +3570,7 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name)
      Build the character class which is represented by NAME.
      The result are written to MBCSET and SBCSET.
      CHAR_CLASS_ALLOC is the allocated size of mbcset->char_classes,
-     is a pointer argument sinse we may update it.  */
+     is a pointer argument since we may update it.  */
 
 static reg_errcode_t
 #ifdef RE_ENABLE_I18N
@@ -3703,8 +3764,9 @@ build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans,
 }
 
 /* This is intended for the expressions like "a{1,3}".
-   Fetch a number from `input', and return the number.
+   Fetch a number from 'input', and return the number.
    Return REG_MISSING if the number field is empty like "{,1}".
+   Return RE_DUP_MAX + 1 if the number field is too large.
    Return REG_ERROR if an error occurred.  */
 
 static Idx
@@ -3723,8 +3785,9 @@ fetch_number (re_string_t *input, re_token_t *token, reg_syntax_t syntax)
       num = ((token->type != CHARACTER || c < '0' || '9' < c
              || num == REG_ERROR)
             ? REG_ERROR
-            : ((num == REG_MISSING) ? c - '0' : num * 10 + c - '0'));
-      num = (num > RE_DUP_MAX) ? REG_ERROR : num;
+            : num == REG_MISSING
+            ? c - '0'
+            : MIN (RE_DUP_MAX + 1, num * 10 + c - '0'));
     }
   return num;
 }
@@ -3798,7 +3861,7 @@ create_token_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right,
 static reg_errcode_t
 mark_opt_subexp (void *extra, bin_tree_t *node)
 {
-  Idx idx = (Idx) (long) extra;
+  Idx idx = (uintptr_t) extra;
   if (node->token.type == SUBEXP && node->token.opr.idx == idx)
     node->token.opt_subexp = 1;
 
index b1e34ac..14362b6 100644 (file)
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2003, 2005-2006, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2005-2006, 2009-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
 
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License along
-   with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
-#include <config.h>
+#ifndef _LIBC
+# include <config.h>
 
-/* Make sure noone compiles this code with a C++ compiler.  */
+# if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__
+#  pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
+# endif
+# if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
+#  pragma GCC diagnostic ignored "-Wtype-limits"
+# endif
+#endif
+
+/* Make sure no one compiles this code with a C++ compiler.  */
 #if defined __cplusplus && defined _LIBC
 # error "This is C code, use a C compiler"
 #endif
index 0089a47..32ef4ac 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions for data structures and routines for the regular
    expression library.
-   Copyright (C) 1985, 1989-1993, 1995-1998, 2000-2003, 2005-2006, 2009-2011
+   Copyright (C) 1985, 1989-1993, 1995-1998, 2000-2003, 2005-2012
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -15,8 +15,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License along
-   with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _REGEX_H
 #define _REGEX_H 1
 extern "C" {
 #endif
 
-/* Define __USE_GNU_REGEX to declare GNU extensions that violate the
+/* Define __USE_GNU to declare GNU extensions that violate the
    POSIX name space rules.  */
-#undef __USE_GNU_REGEX
-#if (defined _GNU_SOURCE                                       \
-     || (!defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE    \
-        && !defined _XOPEN_SOURCE))
-# define __USE_GNU_REGEX 1
+#ifdef _GNU_SOURCE
+# define __USE_GNU 1
 #endif
 
 #ifdef _REGEX_LARGE_OFFSETS
@@ -45,16 +41,6 @@ extern "C" {
    supported within glibc itself, and glibc users should not define
    _REGEX_LARGE_OFFSETS.  */
 
-/* The type of the offset of a byte within a string.
-   For historical reasons POSIX 1003.1-2004 requires that regoff_t be
-   at least as wide as off_t.  However, many common POSIX platforms set
-   regoff_t to the more-sensible ssize_t and the Open Group has
-   signalled its intention to change the requirement to be that
-   regoff_t be at least as wide as ptrdiff_t and ssize_t; see XBD ERN
-   60 (2005-08-25).  We don't know of any hosts where ssize_t or
-   ptrdiff_t is wider than ssize_t, so ssize_t is safe.  */
-typedef ssize_t regoff_t;
-
 /* The type of nonnegative object indexes.  Traditionally, GNU regex
    uses 'int' for these.  Code that uses __re_idx_t should work
    regardless of whether the type is signed.  */
@@ -69,10 +55,8 @@ typedef size_t __re_long_size_t;
 
 #else
 
-/* Use types that are binary-compatible with the traditional GNU regex
-   implementation, which mishandles strings longer than INT_MAX.  */
-
-typedef int regoff_t;
+/* The traditional GNU regex implementation mishandles strings longer
+   than INT_MAX.  */
 typedef int __re_idx_t;
 typedef unsigned int __re_size_t;
 typedef unsigned long int __re_long_size_t;
@@ -93,8 +77,7 @@ typedef unsigned long int active_reg_t;
    add or remove a bit, only one other definition need change.  */
 typedef unsigned long int reg_syntax_t;
 
-#ifdef __USE_GNU_REGEX
-
+#ifdef __USE_GNU
 /* If this bit is not set, then \ inside a bracket expression is literal.
    If set, then such a \ quotes the following character.  */
 # define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1)
@@ -161,9 +144,9 @@ typedef unsigned long int reg_syntax_t;
    If not set, newline is literal.  */
 # define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
 
-/* If this bit is set, then `{...}' defines an interval, and \{ and \}
+/* If this bit is set, then '{...}' defines an interval, and \{ and \}
      are literals.
-  If not set, then `\{...\}' defines an interval.  */
+  If not set, then '\{...\}' defines an interval.  */
 # define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
 
 /* If this bit is set, (...) defines a group, and \( and \) are literals.
@@ -225,8 +208,7 @@ typedef unsigned long int reg_syntax_t;
 /* If this bit is set, then no_sub will be set to 1 during
    re_compile_pattern.  */
 # define RE_NO_SUB (RE_CONTEXT_INVALID_DUP << 1)
-
-#endif /* defined __USE_GNU_REGEX */
+#endif
 
 /* This global variable defines the particular regexp syntax to use (for
    some interfaces).  When a regexp is compiled, the syntax used is
@@ -234,7 +216,7 @@ typedef unsigned long int reg_syntax_t;
    already-compiled regexps.  */
 extern reg_syntax_t re_syntax_options;
 \f
-#ifdef __USE_GNU_REGEX
+#ifdef __USE_GNU
 /* Define combinations of the above bits for the standard possibilities.
    (The [[[ comments delimit what gets put into the Texinfo file, so
    don't delete them!)  */
@@ -246,16 +228,19 @@ extern reg_syntax_t re_syntax_options;
    | RE_NO_BK_PARENS              | RE_NO_BK_REFS                      \
    | RE_NO_BK_VBAR                | RE_NO_EMPTY_RANGES                 \
    | RE_DOT_NEWLINE              | RE_CONTEXT_INDEP_ANCHORS            \
+   | RE_CHAR_CLASSES                                                   \
    | RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)
 
 # define RE_SYNTAX_GNU_AWK                                             \
-  ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG)        \
-   & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS           \
-       | RE_CONTEXT_INVALID_OPS ))
+  ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS            \
+    | RE_INVALID_INTERVAL_ORD)                                         \
+   & ~(RE_DOT_NOT_NULL | RE_CONTEXT_INDEP_OPS                          \
+      | RE_CONTEXT_INVALID_OPS ))
 
 # define RE_SYNTAX_POSIX_AWK                                           \
   (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS             \
-   | RE_INTERVALS          | RE_NO_GNU_OPS)
+   | RE_INTERVALS          | RE_NO_GNU_OPS                             \
+   | RE_INVALID_INTERVAL_ORD)
 
 # define RE_SYNTAX_GREP                                                        \
   (RE_BK_PLUS_QM              | RE_CHAR_CLASSES                                \
@@ -306,13 +291,12 @@ extern reg_syntax_t re_syntax_options;
    | RE_NO_BK_VBAR         | RE_UNMATCHED_RIGHT_PAREN_ORD)
 /* [[[end syntaxes]]] */
 
-#endif /* defined __USE_GNU_REGEX */
-\f
-#ifdef __USE_GNU_REGEX
-
 /* Maximum number of duplicates an interval can allow.  POSIX-conforming
    systems might define this in <limits.h>, but we want our
    value, so remove any previous define.  */
+# ifdef _REGEX_INCLUDE_LIMITS_H
+#  include <limits.h>
+# endif
 # ifdef RE_DUP_MAX
 #  undef RE_DUP_MAX
 # endif
@@ -320,16 +304,15 @@ extern reg_syntax_t re_syntax_options;
 /* RE_DUP_MAX is 2**15 - 1 because an earlier implementation stored
    the counter as a 2-byte signed integer.  This is no longer true, so
    RE_DUP_MAX could be increased to (INT_MAX / 10 - 1), or to
-   ((SIZE_MAX - 2) / 10 - 1) if _REGEX_LARGE_OFFSETS is defined.
+   ((SIZE_MAX - 9) / 10) if _REGEX_LARGE_OFFSETS is defined.
    However, there would be a huge performance problem if someone
    actually used a pattern like a\{214748363\}, so RE_DUP_MAX retains
    its historical value.  */
 # define RE_DUP_MAX (0x7fff)
-
-#endif /* defined __USE_GNU_REGEX */
+#endif
 
 
-/* POSIX `cflags' bits (i.e., information for `regcomp').  */
+/* POSIX 'cflags' bits (i.e., information for 'regcomp').  */
 
 /* If this bit is set, then use extended regular expression syntax.
    If not set, then use basic regular expression syntax.  */
@@ -349,7 +332,7 @@ extern reg_syntax_t re_syntax_options;
 #define REG_NOSUB (1 << 3)
 
 
-/* POSIX `eflags' bits (i.e., information for regexec).  */
+/* POSIX 'eflags' bits (i.e., information for regexec).  */
 
 /* If this bit is set, then the beginning-of-line operator doesn't match
      the beginning of the string (presumably because it's not the
@@ -367,7 +350,7 @@ extern reg_syntax_t re_syntax_options;
 
 
 /* If any error codes are removed, changed, or added, update the
-   `__re_error_msgid' table in regcomp.c.  */
+   '__re_error_msgid' table in regcomp.c.  */
 
 typedef enum
 {
@@ -392,11 +375,11 @@ typedef enum
 
   /* Error codes we've added.  */
   _REG_EEND,           /* Premature end.  */
-  _REG_ESIZE,          /* Compiled pattern bigger than 2^16 bytes.  */
+  _REG_ESIZE,          /* Too large (e.g., repeat count too large).  */
   _REG_ERPAREN         /* Unmatched ) or \); not returned from regcomp.  */
 } reg_errcode_t;
 
-#ifdef _XOPEN_SOURCE
+#if defined _XOPEN_SOURCE || defined __USE_XOPEN2K
 # define REG_ENOSYS    _REG_ENOSYS
 #endif
 #define REG_NOERROR    _REG_NOERROR
@@ -417,126 +400,127 @@ typedef enum
 #define REG_ESIZE      _REG_ESIZE
 #define REG_ERPAREN    _REG_ERPAREN
 \f
-/* struct re_pattern_buffer normally uses member names like `buffer'
-   that POSIX does not allow.  In POSIX mode these members have names
-   with leading `re_' (e.g., `re_buffer').  */
-#ifdef __USE_GNU_REGEX
-# define _REG_RE_NAME(id) id
-# define _REG_RM_NAME(id) id
-#else
-# define _REG_RE_NAME(id) re_##id
-# define _REG_RM_NAME(id) rm_##id
+/* This data structure represents a compiled pattern.  Before calling
+   the pattern compiler, the fields 'buffer', 'allocated', 'fastmap',
+   and 'translate' can be set.  After the pattern has been compiled,
+   the fields 're_nsub', 'not_bol' and 'not_eol' are available.  All
+   other fields are private to the regex routines.  */
+
+#ifndef RE_TRANSLATE_TYPE
+# define __RE_TRANSLATE_TYPE unsigned char *
+# ifdef __USE_GNU
+#  define RE_TRANSLATE_TYPE __RE_TRANSLATE_TYPE
+# endif
 #endif
 
-/* The user can specify the type of the re_translate member by
-   defining the macro RE_TRANSLATE_TYPE, which defaults to unsigned
-   char *.  This pollutes the POSIX name space, so in POSIX mode just
-   use unsigned char *.  */
-#ifdef __USE_GNU_REGEX
-# ifndef RE_TRANSLATE_TYPE
-#  define RE_TRANSLATE_TYPE unsigned char *
-# endif
-# define REG_TRANSLATE_TYPE RE_TRANSLATE_TYPE
+#ifdef __USE_GNU
+# define __REPB_PREFIX(name) name
 #else
-# define REG_TRANSLATE_TYPE unsigned char *
+# define __REPB_PREFIX(name) __##name
 #endif
 
-/* This data structure represents a compiled pattern.  Before calling
-   the pattern compiler, the fields `buffer', `allocated', `fastmap',
-   `translate', and `no_sub' can be set.  After the pattern has been
-   compiled, the `re_nsub' field is available.  All other fields are
-   private to the regex routines.  */
-
 struct re_pattern_buffer
 {
-  /* Space that holds the compiled pattern.  It is declared as
-     `unsigned char *' because its elements are sometimes used as
-     array indexes.  */
-  unsigned char *_REG_RE_NAME (buffer);
+  /* Space that holds the compiled pattern.  The type
+     'struct re_dfa_t' is private and is not declared here.  */
+  struct re_dfa_t *__REPB_PREFIX(buffer);
 
-  /* Number of bytes to which `buffer' points.  */
-  __re_long_size_t _REG_RE_NAME (allocated);
+  /* Number of bytes to which 'buffer' points.  */
+  __re_long_size_t __REPB_PREFIX(allocated);
 
-  /* Number of bytes actually used in `buffer'.  */
-  __re_long_size_t _REG_RE_NAME (used);
+  /* Number of bytes actually used in 'buffer'.  */
+  __re_long_size_t __REPB_PREFIX(used);
 
   /* Syntax setting with which the pattern was compiled.  */
-  reg_syntax_t _REG_RE_NAME (syntax);
+  reg_syntax_t __REPB_PREFIX(syntax);
 
   /* Pointer to a fastmap, if any, otherwise zero.  re_search uses the
      fastmap, if there is one, to skip over impossible starting points
      for matches.  */
-  char *_REG_RE_NAME (fastmap);
+  char *__REPB_PREFIX(fastmap);
 
   /* Either a translate table to apply to all characters before
      comparing them, or zero for no translation.  The translation is
      applied to a pattern when it is compiled and to a string when it
      is matched.  */
-  REG_TRANSLATE_TYPE _REG_RE_NAME (translate);
+  __RE_TRANSLATE_TYPE __REPB_PREFIX(translate);
 
   /* Number of subexpressions found by the compiler.  */
   size_t re_nsub;
 
   /* Zero if this pattern cannot match the empty string, one else.
-     Well, in truth it's used only in `re_search_2', to see whether or
+     Well, in truth it's used only in 're_search_2', to see whether or
      not we should use the fastmap, so we don't set this absolutely
-     perfectly; see `re_compile_fastmap' (the `duplicate' case).  */
-  unsigned int _REG_RE_NAME (can_be_null) : 1;
+     perfectly; see 're_compile_fastmap' (the "duplicate" case).  */
+  unsigned __REPB_PREFIX(can_be_null) : 1;
 
-  /* If REGS_UNALLOCATED, allocate space in the `regs' structure
-     for `max (RE_NREGS, re_nsub + 1)' groups.
+  /* If REGS_UNALLOCATED, allocate space in the 'regs' structure
+     for 'max (RE_NREGS, re_nsub + 1)' groups.
      If REGS_REALLOCATE, reallocate space if necessary.
      If REGS_FIXED, use what's there.  */
-#ifdef __USE_GNU_REGEX
+#ifdef __USE_GNU
 # define REGS_UNALLOCATED 0
 # define REGS_REALLOCATE 1
 # define REGS_FIXED 2
 #endif
-  unsigned int _REG_RE_NAME (regs_allocated) : 2;
+  unsigned __REPB_PREFIX(regs_allocated) : 2;
 
-  /* Set to zero when `re_compile_pattern' compiles a pattern; set to
-     one by `re_compile_fastmap' if it updates the fastmap.  */
-  unsigned int _REG_RE_NAME (fastmap_accurate) : 1;
+  /* Set to zero when 're_compile_pattern' compiles a pattern; set to
+     one by 're_compile_fastmap' if it updates the fastmap.  */
+  unsigned __REPB_PREFIX(fastmap_accurate) : 1;
 
-  /* If set, `re_match_2' does not return information about
+  /* If set, 're_match_2' does not return information about
      subexpressions.  */
-  unsigned int _REG_RE_NAME (no_sub) : 1;
+  unsigned __REPB_PREFIX(no_sub) : 1;
 
   /* If set, a beginning-of-line anchor doesn't match at the beginning
      of the string.  */
-  unsigned int _REG_RE_NAME (not_bol) : 1;
+  unsigned __REPB_PREFIX(not_bol) : 1;
 
   /* Similarly for an end-of-line anchor.  */
-  unsigned int _REG_RE_NAME (not_eol) : 1;
+  unsigned __REPB_PREFIX(not_eol) : 1;
 
   /* If true, an anchor at a newline matches.  */
-  unsigned int _REG_RE_NAME (newline_anchor) : 1;
-
-/* [[[end pattern_buffer]]] */
+  unsigned __REPB_PREFIX(newline_anchor) : 1;
 };
 
 typedef struct re_pattern_buffer regex_t;
 \f
+/* Type for byte offsets within the string.  POSIX mandates this.  */
+#ifdef _REGEX_LARGE_OFFSETS
+/* POSIX 1003.1-2008 requires that regoff_t be at least as wide as
+   ptrdiff_t and ssize_t.  We don't know of any hosts where ptrdiff_t
+   is wider than ssize_t, so ssize_t is safe.  */
+typedef ssize_t regoff_t;
+#else
+/* The traditional GNU regex implementation mishandles strings longer
+   than INT_MAX.  */
+typedef int regoff_t;
+#endif
+
+
+#ifdef __USE_GNU
 /* This is the structure we store register match data in.  See
    regex.texinfo for a full description of what registers match.  */
 struct re_registers
 {
-  __re_size_t _REG_RM_NAME (num_regs);
-  regoff_t *_REG_RM_NAME (start);
-  regoff_t *_REG_RM_NAME (end);
+  __re_size_t num_regs;
+  regoff_t *start;
+  regoff_t *end;
 };
 
 
-/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
-   `re_match_2' returns information about at least this many registers
-   the first time a `regs' structure is passed.  */
-#if !defined RE_NREGS && defined __USE_GNU_REGEX
-# define RE_NREGS 30
+/* If 'regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
+   're_match_2' returns information about at least this many registers
+   the first time a 'regs' structure is passed.  */
+# ifndef RE_NREGS
+#  define RE_NREGS 30
+# endif
 #endif
 
 
 /* POSIX specification for registers.  Aside from the different names than
-   `re_registers', POSIX uses an array of structures, instead of a
+   're_registers', POSIX uses an array of structures, instead of a
    structure of arrays.  */
 typedef struct
 {
@@ -546,13 +530,19 @@ typedef struct
 \f
 /* Declarations for routines.  */
 
+#ifdef __USE_GNU
 /* Sets the current default syntax to SYNTAX, and return the old syntax.
-   You can also simply assign to the `re_syntax_options' variable.  */
+   You can also simply assign to the 're_syntax_options' variable.  */
 extern reg_syntax_t re_set_syntax (reg_syntax_t __syntax);
 
 /* Compile the regular expression PATTERN, with length LENGTH
-   and syntax given by the global `re_syntax_options', into the buffer
-   BUFFER.  Return NULL if successful, and an error string if not.  */
+   and syntax given by the global 're_syntax_options', into the buffer
+   BUFFER.  Return NULL if successful, and an error string if not.
+
+   To free the allocated storage, you must call 'regfree' on BUFFER.
+   Note that the translate table must either have been initialised by
+   'regcomp', with a malloc'ed value, or set to NULL before calling
+   'regfree'.  */
 extern const char *re_compile_pattern (const char *__pattern, size_t __length,
                                       struct re_pattern_buffer *__buffer);
 
@@ -574,7 +564,7 @@ extern regoff_t re_search (struct re_pattern_buffer *__buffer,
                           struct re_registers *__regs);
 
 
-/* Like `re_search', but search in the concatenation of STRING1 and
+/* Like 're_search', but search in the concatenation of STRING1 and
    STRING2.  Also, stop searching at index START + STOP.  */
 extern regoff_t re_search_2 (struct re_pattern_buffer *__buffer,
                             const char *__string1, __re_idx_t __length1,
@@ -584,14 +574,14 @@ extern regoff_t re_search_2 (struct re_pattern_buffer *__buffer,
                             __re_idx_t __stop);
 
 
-/* Like `re_search', but return how many characters in STRING the regexp
+/* Like 're_search', but return how many characters in STRING the regexp
    in BUFFER matched, starting at position START.  */
 extern regoff_t re_match (struct re_pattern_buffer *__buffer,
                          const char *__string, __re_idx_t __length,
                          __re_idx_t __start, struct re_registers *__regs);
 
 
-/* Relates to `re_match' as `re_search_2' relates to `re_search'.  */
+/* Relates to 're_match' as 're_search_2' relates to 're_search'.  */
 extern regoff_t re_match_2 (struct re_pattern_buffer *__buffer,
                            const char *__string1, __re_idx_t __length1,
                            const char *__string2, __re_idx_t __length2,
@@ -602,21 +592,22 @@ extern regoff_t re_match_2 (struct re_pattern_buffer *__buffer,
 /* Set REGS to hold NUM_REGS registers, storing them in STARTS and
    ENDS.  Subsequent matches using BUFFER and REGS will use this memory
    for recording register information.  STARTS and ENDS must be
-   allocated with malloc, and must each be at least `NUM_REGS * sizeof
+   allocated with malloc, and must each be at least 'NUM_REGS * sizeof
    (regoff_t)' bytes long.
 
    If NUM_REGS == 0, then subsequent matches should allocate their own
    register data.
 
    Unless this function is called, the first search or match using
-   BUFFER will allocate its own register data, without freeing the old
-   data.  */
+   BUFFER will allocate its own register data, without
+   freeing the old data.  */
 extern void re_set_registers (struct re_pattern_buffer *__buffer,
                              struct re_registers *__regs,
                              __re_size_t __num_regs,
                              regoff_t *__starts, regoff_t *__ends);
+#endif /* Use GNU */
 
-#if defined _REGEX_RE_COMP || defined _LIBC
+#if defined _REGEX_RE_COMP || (defined _LIBC && defined __USE_BSD)
 # ifndef _CRAY
 /* 4.2 bsd compatibility.  */
 extern char *re_comp (const char *);
@@ -644,7 +635,7 @@ extern int re_exec (const char *);
 #ifndef _Restrict_arr_
 # if ((199901L <= __STDC_VERSION__                                     \
        || ((3 < __GNUC__ || (3 == __GNUC__ && 1 <= __GNUC_MINOR__))    \
-          && !__STRICT_ANSI__))                                        \
+          && !defined __STRICT_ANSI__))                                        \
       && !defined __GNUG__)
 #  define _Restrict_arr_ _Restrict_
 # else
index 8147779..ca046cf 100644 (file)
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2011 Free Software Foundation, Inc.
+   Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
 
@@ -14,8 +14,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License along
-   with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 static void re_string_construct_common (const char *str, Idx len,
                                        re_string_t *pstr,
@@ -134,9 +133,9 @@ re_string_realloc_buffers (re_string_t *pstr, Idx new_buf_len)
     {
       wint_t *new_wcs;
 
-      /* Avoid overflow.  */
-      size_t max_object_size = MAX (sizeof (wint_t), sizeof (Idx));
-      if (BE (SIZE_MAX / max_object_size < new_buf_len, 0))
+      /* 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))
        return REG_ESPACE;
 
       new_wcs = re_realloc (pstr->wcs, wint_t, new_buf_len);
@@ -236,13 +235,8 @@ 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) -2, 0))
-       {
-         /* The buffer doesn't have enough space, finish to build.  */
-         pstr->cur_state = prev_st;
-         break;
-       }
-      else if (BE (mbclen == (size_t) -1 || mbclen == 0, 0))
+      if (BE (mbclen == (size_t) -1 || mbclen == 0
+             || (mbclen == (size_t) -2 && pstr->bufs_len >= pstr->len), 0))
        {
          /* We treat these cases as a singlebyte character.  */
          mbclen = 1;
@@ -251,6 +245,12 @@ build_wcs_buffer (re_string_t *pstr)
            wc = pstr->trans[wc];
          pstr->cur_state = prev_st;
        }
+      else if (BE (mbclen == (size_t) -2, 0))
+       {
+         /* The buffer doesn't have enough space, finish to build.  */
+         pstr->cur_state = prev_st;
+         break;
+       }
 
       /* Write wide character and padding.  */
       pstr->wcs[byte_idx++] = wc;
@@ -333,9 +333,11 @@ build_wcs_upper_buffer (re_string_t *pstr)
              for (remain_len = byte_idx + mbclen - 1; byte_idx < remain_len ;)
                pstr->wcs[byte_idx++] = WEOF;
            }
-         else if (mbclen == (size_t) -1 || mbclen == 0)
+         else if (mbclen == (size_t) -1 || mbclen == 0
+                  || (mbclen == (size_t) -2 && pstr->bufs_len >= pstr->len))
            {
-             /* It is an invalid character or '\0'.  Just use the byte.  */
+             /* 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.  */
@@ -448,7 +450,8 @@ build_wcs_upper_buffer (re_string_t *pstr)
            for (remain_len = byte_idx + mbclen - 1; byte_idx < remain_len ;)
              pstr->wcs[byte_idx++] = WEOF;
          }
-       else if (mbclen == (size_t) -1 || mbclen == 0)
+       else if (mbclen == (size_t) -1 || mbclen == 0
+                || (mbclen == (size_t) -2 && pstr->bufs_len >= pstr->len))
          {
            /* It is an invalid character or '\0'.  Just use the byte.  */
            int ch = pstr->raw_mbs[pstr->raw_mbs_idx + src_idx];
@@ -495,8 +498,7 @@ re_string_skip_chars (re_string_t *pstr, Idx new_raw_idx, wint_t *last_wc)
        rawbuf_idx < new_raw_idx;)
     {
       wchar_t wc2;
-      Idx remain_len;
-      remain_len = pstr->len - rawbuf_idx;
+      Idx remain_len = pstr->raw_len - rawbuf_idx;
       prev_st = pstr->cur_state;
       mbclen = __mbrtowc (&wc2, (const char *) pstr->raw_mbs + rawbuf_idx,
                          remain_len, &pstr->cur_state);
@@ -732,21 +734,21 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags)
                          mbstate_t cur_state;
                          wchar_t wc2;
                          Idx mlen = raw + pstr->len - p;
+                         unsigned char buf[6];
                          size_t mbclen;
 
-#if 0 /* dead code: buf is set but never used */
-                         unsigned char buf[6];
+                         const unsigned char *pp = p;
                          if (BE (pstr->trans != NULL, 0))
                            {
                              int i = mlen < 6 ? mlen : 6;
                              while (--i >= 0)
                                buf[i] = pstr->trans[p[i]];
+                             pp = buf;
                            }
-#endif
                          /* XXX Don't use mbrtowc, we know which conversion
                             to use (UTF-8 -> UCS4).  */
                          memset (&cur_state, 0, sizeof (cur_state));
-                         mbclen = __mbrtowc (&wc2, (const char *) p, mlen,
+                         mbclen = __mbrtowc (&wc2, (const char *) pp, mlen,
                                              &cur_state);
                          if (raw + offset - p <= mbclen
                              && mbclen < (size_t) -2)
@@ -868,7 +870,7 @@ re_string_peek_byte_case (const re_string_t *pstr, Idx idx)
 }
 
 static unsigned char
-internal_function __attribute ((pure))
+internal_function
 re_string_fetch_byte_case (re_string_t *pstr)
 {
   if (BE (!pstr->mbs_allocated, 1))
@@ -1412,13 +1414,12 @@ re_dfa_add_node (re_dfa_t *dfa, re_token_t token)
       Idx *new_nexts, *new_indices;
       re_node_set *new_edests, *new_eclosures;
       re_token_t *new_nodes;
-      size_t max_object_size =
-       MAX (sizeof (re_token_t),
-            MAX (sizeof (re_node_set),
-                 sizeof (Idx)));
 
-      /* Avoid overflows.  */
-      if (BE (SIZE_MAX / 2 / max_object_size < dfa->nodes_alloc, 0))
+      /* Avoid overflows in realloc.  */
+      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))
        return REG_MISSING;
 
       new_nodes = re_realloc (dfa->nodes, re_token_t, new_nodes_alloc);
@@ -1550,7 +1551,7 @@ re_acquire_state_context (reg_errcode_t *err, const re_dfa_t *dfa,
          && re_node_set_compare (state->entrance_nodes, nodes))
        return state;
     }
-  /* There are no appropriate state in `dfa', create the new one.  */
+  /* 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))
     *err = REG_ESPACE;
@@ -1579,7 +1580,7 @@ register_state (const re_dfa_t *dfa, re_dfastate_t *newstate,
     {
       Idx elem = newstate->nodes.elems[i];
       if (!IS_EPSILON_NODE (dfa->nodes[elem].type))
-       if (BE (! re_node_set_insert_last (&newstate->non_eps_nodes, elem), 0))
+       if (! re_node_set_insert_last (&newstate->non_eps_nodes, elem))
          return REG_ESPACE;
     }
 
@@ -1614,7 +1615,7 @@ free_state (re_dfastate_t *state)
   re_free (state);
 }
 
-/* Create the new state which is independ of contexts.
+/* Create the new state which is independent of contexts.
    Return the new state if succeeded, otherwise return NULL.  */
 
 static re_dfastate_t *
index e18e7a0..2e36fe5 100644 (file)
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2011 Free Software Foundation, Inc.
+   Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
 
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License along
-   with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _REGEX_INTERNAL_H
 #define _REGEX_INTERNAL_H 1
 
 #include <assert.h>
 #include <ctype.h>
-#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 # include "localcharset.h"
 #endif
 #include <locale.h>
-
 #include <wchar.h>
 #include <wctype.h>
+#include <stdbool.h>
 #include <stdint.h>
 #if defined _LIBC
 # include <bits/libc-lock.h>
 #else
+# define __libc_lock_define(CLASS,NAME)
 # define __libc_lock_init(NAME) do { } while (0)
 # define __libc_lock_lock(NAME) do { } while (0)
 # define __libc_lock_unlock(NAME) do { } while (0)
 # define gettext_noop(String) String
 #endif
 
-/* For loser systems without the definition.  */
-#ifndef SIZE_MAX
-# define SIZE_MAX ((size_t) -1)
-#endif
-
 #if (defined MB_CUR_MAX && HAVE_WCTYPE_H && HAVE_ISWCTYPE && HAVE_WCSCOLL) || _LIBC
 # define RE_ENABLE_I18N
 #endif
 # define __wctype wctype
 # define __iswctype iswctype
 # define __btowc btowc
-# define __wcrtomb wcrtomb
 # define __mbrtowc mbrtowc
+# define __wcrtomb wcrtomb
 # define __regfree regfree
 # define attribute_hidden
 #endif /* not _LIBC */
 #endif
 
 typedef __re_idx_t Idx;
+#ifdef _REGEX_LARGE_OFFSETS
+# define IDX_MAX (SIZE_MAX - 2)
+#else
+# define IDX_MAX INT_MAX
+#endif
 
 /* Special return value for failure to match.  */
 #define REG_MISSING ((Idx) -1)
@@ -334,7 +333,7 @@ typedef struct
     Idx idx;                   /* for BACK_REF */
     re_context_type ctx_type;  /* for ANCHOR */
   } opr;
-#if __GNUC__ >= 2 && !__STRICT_ANSI__
+#if __GNUC__ >= 2 && !defined __STRICT_ANSI__
   re_token_type_t type : 8;
 #else
   re_token_type_t type;
@@ -415,26 +414,24 @@ struct re_dfa_t;
 typedef struct re_dfa_t re_dfa_t;
 
 #ifndef _LIBC
-# if defined __i386__ && !defined __EMX__
-#  define internal_function   __attribute ((regparm (3), stdcall))
-# else
-#  define internal_function
-# endif
+# define internal_function
 #endif
 
+#ifndef NOT_IN_libc
 static reg_errcode_t re_string_realloc_buffers (re_string_t *pstr,
                                                Idx new_buf_len)
      internal_function;
-#ifdef RE_ENABLE_I18N
+# 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 */
+  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));
+#endif
 #define re_string_peek_byte(pstr, offset) \
   ((pstr)->mbs[(pstr)->cur_idx + offset])
 #define re_string_fetch_byte(pstr) \
@@ -472,6 +469,9 @@ static unsigned int re_string_context_at (const re_string_t *input, Idx idx,
 #ifndef MAX
 # define MAX(a,b) ((a) < (b) ? (b) : (a))
 #endif
+#ifndef MIN
+# define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
 
 #define re_malloc(t,n) ((t *) malloc ((n) * sizeof (t)))
 #define re_realloc(p,t,n) ((t *) realloc (p, (n) * sizeof (t)))
@@ -487,8 +487,8 @@ struct bin_tree_t
 
   re_token_t token;
 
-  /* `node_idx' is the index in dfa->nodes, if `type' == 0.
-     Otherwise `type' indicate the type of this node.  */
+  /* 'node_idx' is the index in dfa->nodes, if 'type' == 0.
+     Otherwise 'type' indicate the type of this node.  */
   Idx node_idx;
 };
 typedef struct bin_tree_t bin_tree_t;
@@ -541,9 +541,9 @@ struct re_dfastate_t
   struct re_dfastate_t **trtable, **word_trtable;
   unsigned int context : 4;
   unsigned int halt : 1;
-  /* If this state can accept `multi byte'.
+  /* If this state can accept "multi byte".
      Note that we refer to multibyte characters, and multi character
-     collating elements as `multi byte'.  */
+     collating elements as "multi byte".  */
   unsigned int accept_mb : 1;
   /* If this state has backreference node(s).  */
   unsigned int has_backref : 1;
@@ -672,7 +672,7 @@ struct re_dfa_t
   re_bitset_ptr_t sb_char;
   int str_tree_storage_idx;
 
-  /* number of subexpressions `re_nsub' is in regex_t.  */
+  /* number of subexpressions 're_nsub' is in regex_t.  */
   re_hashval_t state_hash_mask;
   Idx init_node;
   Idx nbackref; /* The number of backreference in this dfa.  */
@@ -696,9 +696,7 @@ struct re_dfa_t
 #ifdef DEBUG
   char* re_str;
 #endif
-#ifdef _LIBC
   __libc_lock_define (, lock)
-#endif
 };
 
 #define re_node_set_init_empty(set) memset (set, '\0', sizeof (re_node_set))
@@ -822,15 +820,15 @@ re_string_wchar_at (const re_string_t *pstr, Idx idx)
   return (wint_t) pstr->wcs[idx];
 }
 
+# ifndef NOT_IN_libc
 static int
 internal_function __attribute ((pure))
 re_string_elem_size_at (const re_string_t *pstr, Idx idx)
 {
-# ifdef _LIBC
+#  ifdef _LIBC
   const unsigned char *p, *extra;
   const int32_t *table, *indirect;
-  int32_t tmp;
-#  include <locale/weight.h>
+#   include <locale/weight.h>
   uint_fast32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
 
   if (nrules != 0)
@@ -841,13 +839,14 @@ re_string_elem_size_at (const re_string_t *pstr, Idx idx)
       indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE,
                                                _NL_COLLATE_INDIRECTMB);
       p = pstr->mbs + idx;
-      tmp = findidx (&p);
+      findidx (&p, pstr->len - idx);
       return p - pstr->mbs - idx;
     }
   else
-# endif /* _LIBC */
+#  endif /* _LIBC */
     return 1;
 }
+# endif
 #endif /* RE_ENABLE_I18N */
 
 #ifndef __GNUC_PREREQ
index 421a354..0b095a7 100644 (file)
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2011 Free Software Foundation, Inc.
+   Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
 
@@ -14,8 +14,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License along
-   with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags,
                                     Idx n) internal_function;
@@ -51,9 +50,8 @@ static regoff_t re_search_stub (struct re_pattern_buffer *bufp,
                                regoff_t range, Idx stop,
                                struct re_registers *regs,
                                bool ret_len) internal_function;
-static unsigned int re_copy_regs (struct re_registers *regs, regmatch_t *pmatch,
-                                 Idx nregs, int regs_allocated)
-     internal_function;
+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;
 static Idx check_matching (re_match_context_t *mctx, bool fl_longest_match,
@@ -209,11 +207,11 @@ static reg_errcode_t extend_buffers (re_match_context_t *mctx)
    string STRING.
 
    If NMATCH is zero or REG_NOSUB was set in the cflags argument to
-   `regcomp', we ignore PMATCH.  Otherwise, we assume PMATCH has at
+   'regcomp', we ignore PMATCH.  Otherwise, we assume PMATCH has at
    least NMATCH elements, and we set them to the offsets of the
    corresponding matched substrings.
 
-   EFLAGS specifies `execution flags' which affect matching: if
+   EFLAGS specifies "execution flags" which affect matching: if
    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.
 
@@ -230,7 +228,7 @@ regexec (preg, string, nmatch, pmatch, eflags)
   reg_errcode_t err;
   Idx start, length;
 #ifdef _LIBC
-  re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+  re_dfa_t *dfa = preg->buffer;
 #endif
 
   if (eflags & ~(REG_NOTBOL | REG_NOTEOL | REG_STARTEND))
@@ -365,7 +363,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,
@@ -413,7 +410,6 @@ re_search_2_stub (struct re_pattern_buffer *bufp,
    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,
@@ -425,7 +421,7 @@ re_search_stub (struct re_pattern_buffer *bufp,
   regoff_t rval;
   int eflags = 0;
 #ifdef _LIBC
-  re_dfa_t *dfa = (re_dfa_t *) bufp->buffer;
+  re_dfa_t *dfa = bufp->buffer;
 #endif
   Idx last_start = start + range;
 
@@ -477,9 +473,9 @@ re_search_stub (struct re_pattern_buffer *bufp,
 
   rval = 0;
 
-  /* I hope we needn't fill ther regs with -1's when no match was found.  */
+  /* I hope we needn't fill their regs with -1's when no match was found.  */
   if (result != REG_NOERROR)
-    rval = -1;
+    rval = result == REG_NOMATCH ? -1 : -2;
   else if (regs != NULL)
     {
       /* If caller wants register contents data back, copy them.  */
@@ -505,15 +501,14 @@ re_search_stub (struct re_pattern_buffer *bufp,
   return rval;
 }
 
-static unsigned int
-internal_function
+static unsigned
 re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, Idx nregs,
              int regs_allocated)
 {
   int rval = REGS_REALLOCATE;
   Idx i;
   Idx need_regs = nregs + 1;
-  /* We need one extra element beyond `num_regs' for the `-1' marker GNU code
+  /* We need one extra element beyond 'num_regs' for the '-1' marker GNU code
      uses.  */
 
   /* Have the register data arrays been allocated?  */
@@ -636,7 +631,7 @@ re_exec (s)
    (0 <= LAST_START && LAST_START <= LENGTH)  */
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 re_search_internal (const regex_t *preg,
                    const char *string, Idx length,
                    Idx start, Idx last_start, Idx stop,
@@ -644,7 +639,7 @@ re_search_internal (const regex_t *preg,
                    int eflags)
 {
   reg_errcode_t err;
-  const re_dfa_t *dfa = (const re_dfa_t *) preg->buffer;
+  const re_dfa_t *dfa = preg->buffer;
   Idx left_lim, right_lim;
   int incr;
   bool fl_longest_match;
@@ -719,7 +714,8 @@ re_search_internal (const regex_t *preg,
   if (nmatch > 1 || dfa->has_mb_node)
     {
       /* Avoid overflow.  */
-      if (BE (SIZE_MAX / sizeof (re_dfastate_t *) <= mctx.input.bufs_len, 0))
+      if (BE ((MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *))
+               <= mctx.input.bufs_len), 0))
        {
          err = REG_ESPACE;
          goto free_return;
@@ -921,7 +917,7 @@ re_search_internal (const regex_t *preg,
            goto free_return;
        }
 
-      /* At last, add the offset to the each registers, since we slided
+      /* At last, add the offset to each register, since we slid
         the buffers so that we could assume that the matching starts
         from 0.  */
       for (reg_idx = 0; reg_idx < nmatch; ++reg_idx)
@@ -971,7 +967,7 @@ re_search_internal (const regex_t *preg,
 }
 
 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;
@@ -987,7 +983,7 @@ prune_impossible_nodes (re_match_context_t *mctx)
   halt_node = mctx->last_node;
 
   /* Avoid overflow.  */
-  if (BE (SIZE_MAX / sizeof (re_dfastate_t *) <= match_last, 0))
+  if (BE (MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *)) <= match_last, 0))
     return REG_ESPACE;
 
   sifted_states = re_malloc (re_dfastate_t *, match_last + 1);
@@ -1105,7 +1101,7 @@ acquire_init_state_context (reg_errcode_t *err, const re_match_context_t *mctx,
    FL_LONGEST_MATCH means we want the POSIX longest matching.
    If P_MATCH_FIRST is not NULL, and the match fails, it is set to the
    next place where we may want to try matching.
-   Note that the matcher assume that the maching starts from the current
+   Note that the matcher assumes that the matching starts from the current
    index of the buffer.  */
 
 static Idx
@@ -1174,7 +1170,8 @@ 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 ((BE (next_char_idx >= mctx->input.bufs_len, 0)
+          && mctx->input.bufs_len < mctx->input.len)
          || (BE (next_char_idx >= mctx->input.valid_len, 0)
              && mctx->input.valid_len < mctx->input.len))
        {
@@ -1435,7 +1432,7 @@ internal_function __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)
 {
-  const re_dfa_t *dfa = (const re_dfa_t *) preg->buffer;
+  const re_dfa_t *dfa = preg->buffer;
   Idx idx, cur_node;
   re_node_set eps_via_nodes;
   struct re_fail_stack_t *fs;
@@ -1607,21 +1604,21 @@ update_regs (const re_dfa_t *dfa, regmatch_t *pmatch,
    and sift the nodes in each states according to the following rules.
    Updated state_log will be wrote to STATE_LOG.
 
-   Rules: We throw away the Node `a' in the STATE_LOG[STR_IDX] if...
+   Rules: We throw away the Node 'a' in the STATE_LOG[STR_IDX] if...
      1. When STR_IDX == MATCH_LAST(the last index in the state_log):
-       If `a' isn't the LAST_NODE and `a' can't epsilon transit to
-       the LAST_NODE, we throw away the node `a'.
-     2. When 0 <= STR_IDX < MATCH_LAST and `a' accepts
-       string `s' and transit to `b':
+       If 'a' isn't the LAST_NODE and 'a' can't epsilon transit to
+       the LAST_NODE, we throw away the node 'a'.
+     2. When 0 <= STR_IDX < MATCH_LAST and 'a' accepts
+       string 's' and transit to 'b':
        i. If 'b' isn't in the STATE_LOG[STR_IDX+strlen('s')], we throw
-          away the node `a'.
+          away the node 'a'.
        ii. If 'b' is in the STATE_LOG[STR_IDX+strlen('s')] but 'b' is
-           thrown away, we throw away the node `a'.
+           thrown away, we throw away the node 'a'.
      3. When 0 <= STR_IDX < MATCH_LAST and 'a' epsilon transit to 'b':
        i. If 'b' isn't in the STATE_LOG[STR_IDX], we throw away the
-          node `a'.
+          node 'a'.
        ii. If 'b' is in the STATE_LOG[STR_IDX] but 'b' is thrown away,
-           we throw away the node `a'.  */
+           we throw away the node 'a'.  */
 
 #define STATE_NODE_CONTAINS(state,node) \
   ((state) != NULL && re_node_set_contains (&(state)->nodes, node))
@@ -1694,11 +1691,11 @@ build_sifted_states (const re_match_context_t *mctx, re_sift_context_t *sctx,
   Idx i;
 
   /* Then build the next sifted state.
-     We build the next sifted state on `cur_dest', and update
-     `sifted_states[str_idx]' with `cur_dest'.
+     We build the next sifted state on 'cur_dest', and update
+     'sifted_states[str_idx]' with 'cur_dest'.
      Note:
-     `cur_dest' is the sifted state from `state_log[str_idx + 1]'.
-     `cur_src' points the node_set of the old `state_log[str_idx]'
+     'cur_dest' is the sifted state from 'state_log[str_idx + 1]'.
+     'cur_src' points the node_set of the old 'state_log[str_idx]'
      (with the epsilon nodes pre-filtered out).  */
   for (i = 0; i < cur_src->nelem; i++)
     {
@@ -1711,7 +1708,7 @@ build_sifted_states (const re_match_context_t *mctx, re_sift_context_t *sctx,
       assert (!IS_EPSILON_NODE (type));
 #endif
 #ifdef RE_ENABLE_I18N
-      /* If the node may accept `multi byte'.  */
+      /* If the node may accept "multi byte".  */
       if (dfa->nodes[prev_node].accept_mb)
        naccepted = sift_states_iter_mb (mctx, sctx, prev_node,
                                         str_idx, sctx->last_str_idx);
@@ -1752,7 +1749,8 @@ clean_state_log_if_needed (re_match_context_t *mctx, Idx next_state_log_idx)
 {
   Idx top = mctx->state_log_top;
 
-  if (next_state_log_idx >= mctx->input.bufs_len
+  if ((next_state_log_idx >= mctx->input.bufs_len
+       && mctx->input.bufs_len < mctx->input.len)
       || (next_state_log_idx >= mctx->input.valid_len
          && mctx->input.valid_len < mctx->input.len))
     {
@@ -2267,17 +2265,17 @@ sift_states_iter_mb (const re_match_context_t *mctx, re_sift_context_t *sctx,
 {
   const re_dfa_t *const dfa = mctx->dfa;
   int naccepted;
-  /* Check the node can accept `multi byte'.  */
+  /* 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]))
-    /* The node can't accept the `multi byte', or the
+    /* 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'.   */
+       could't accept the current input "multi byte".   */
     naccepted = 0;
   /* Otherwise, it is sure that the node could accept
-     `naccepted' bytes input.  */
+     'naccepted' bytes input.  */
   return naccepted;
 }
 #endif /* RE_ENABLE_I18N */
@@ -2456,7 +2454,7 @@ find_recover_state (reg_errcode_t *err, re_match_context_t *mctx)
 /* From the node set CUR_NODES, pick up the nodes whose types are
    OP_OPEN_SUBEXP and which have corresponding back references in the regular
    expression. And register them to use them later for evaluating the
-   correspoding back references.  */
+   corresponding back references.  */
 
 static reg_errcode_t
 internal_function
@@ -2567,7 +2565,7 @@ transit_state_mb (re_match_context_t *mctx, re_dfastate_t *pstate)
       if (naccepted == 0)
        continue;
 
-      /* The node can accepts `naccepted' bytes.  */
+      /* The node can accepts 'naccepted' bytes.  */
       dest_idx = re_string_cur_idx (&mctx->input) + naccepted;
       mctx->max_mb_elem_len = ((mctx->max_mb_elem_len < naccepted) ? naccepted
                               : mctx->max_mb_elem_len);
@@ -2619,7 +2617,7 @@ transit_state_bkref (re_match_context_t *mctx, const re_node_set *nodes)
       const re_token_t *node = dfa->nodes + node_idx;
       re_node_set *new_dest_nodes;
 
-      /* Check whether `node' is a backreference or not.  */
+      /* Check whether 'node' is a backreference or not.  */
       if (node->type != OP_BACK_REF)
        continue;
 
@@ -2631,14 +2629,14 @@ transit_state_bkref (re_match_context_t *mctx, const re_node_set *nodes)
            continue;
        }
 
-      /* `node' is a backreference.
+      /* 'node' is a backreference.
         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))
        goto free_return;
 
-      /* And add the epsilon closures (which is `new_dest_nodes') of
+      /* And add the epsilon closures (which is 'new_dest_nodes') of
         the backreference to appropriate state_log.  */
 #ifdef DEBUG
       assert (dfa->nexts[node_idx] != REG_MISSING);
@@ -2662,7 +2660,7 @@ transit_state_bkref (re_match_context_t *mctx, const re_node_set *nodes)
          dest_state = mctx->state_log[dest_str_idx];
          prev_nelem = ((mctx->state_log[cur_str_idx] == NULL) ? 0
                        : mctx->state_log[cur_str_idx]->nodes.nelem);
-         /* Add `new_dest_node' to state_log.  */
+         /* Add 'new_dest_node' to state_log.  */
          if (dest_state == NULL)
            {
              mctx->state_log[dest_str_idx]
@@ -2936,9 +2934,12 @@ check_arrival (re_match_context_t *mctx, state_array_t *path, Idx top_node,
     {
       re_dfastate_t **new_array;
       Idx old_alloc = path->alloc;
-      Idx new_alloc = old_alloc + last_str + mctx->max_mb_elem_len + 1;
-      if (BE (new_alloc < old_alloc, 0)
-         || BE (SIZE_MAX / sizeof (re_dfastate_t *) < new_alloc, 0))
+      Idx incr_alloc = last_str + mctx->max_mb_elem_len + 1;
+      Idx new_alloc;
+      if (BE (IDX_MAX - old_alloc < incr_alloc, 0))
+       return REG_ESPACE;
+      new_alloc = old_alloc + incr_alloc;
+      if (BE (SIZE_MAX / sizeof (re_dfastate_t *) < new_alloc, 0))
        return REG_ESPACE;
       new_array = re_realloc (path->array, re_dfastate_t *, new_alloc);
       if (BE (new_array == NULL, 0))
@@ -3101,7 +3102,7 @@ check_arrival_add_next_nodes (re_match_context_t *mctx, Idx str_idx,
       assert (!IS_EPSILON_NODE (type));
 #endif
 #ifdef RE_ENABLE_I18N
-      /* If the node may accept `multi byte'.  */
+      /* If the node may accept "multi byte".  */
       if (dfa->nodes[cur_node].accept_mb)
        {
          naccepted = check_node_accept_bytes (dfa, cur_node, &mctx->input,
@@ -3358,7 +3359,7 @@ build_trtable (const re_dfa_t *dfa, re_dfastate_t *state)
   bitset_word_t elem, mask;
   bool dests_node_malloced = false;
   bool dest_states_malloced = false;
-  Idx ndests; /* Number of the destination states from `state'.  */
+  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;
@@ -3372,8 +3373,8 @@ build_trtable (const re_dfa_t *dfa, re_dfastate_t *state)
   } *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
+     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));
@@ -3387,16 +3388,17 @@ build_trtable (const re_dfa_t *dfa, re_dfastate_t *state)
   dests_node = dests_alloc->dests_node;
   dests_ch = dests_alloc->dests_ch;
 
-  /* Initialize transiton table.  */
+  /* Initialize transition table.  */
   state->word_trtable = state->trtable = NULL;
 
-  /* At first, group all nodes belonging to `state' into several
+  /* At first, group all nodes belonging to 'state' into several
      destinations.  */
   ndests = group_nodes_into_DFAstates (dfa, state, dests_node, dests_ch);
   if (BE (! REG_VALID_NONZERO_INDEX (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 **)
@@ -3592,13 +3594,13 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
   reg_errcode_t err;
   bool ok;
   Idx i, j, k;
-  Idx ndests; /* Number of the destinations from `state'.  */
+  Idx ndests; /* Number of the destinations from 'state'.  */
   bitset_t accepts; /* Characters a node can accept.  */
   const re_node_set *cur_nodes = &state->nodes;
   bitset_empty (accepts);
   ndests = 0;
 
-  /* For all the nodes belonging to `state',  */
+  /* For all the nodes belonging to 'state',  */
   for (i = 0; i < cur_nodes->nelem; ++i)
     {
       re_token_t *node = &dfa->nodes[cur_nodes->elems[i]];
@@ -3641,7 +3643,7 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
       else
        continue;
 
-      /* Check the `accepts' and sift the characters which are not
+      /* Check the 'accepts' and sift the characters which are not
         match it the context.  */
       if (constraint)
        {
@@ -3700,7 +3702,7 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
            }
        }
 
-      /* Then divide `accepts' into DFA states, or create a new
+      /* Then divide 'accepts' into DFA states, or create a new
         state.  Above, we make sure that accepts is not empty.  */
       for (j = 0; j < ndests; ++j)
        {
@@ -3713,7 +3715,7 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
          if (type == CHARACTER && !bitset_contain (dests_ch[j], node->opr.c))
            continue;
 
-         /* Enumerate the intersection set of this state and `accepts'.  */
+         /* Enumerate the intersection set of this state and 'accepts'.  */
          has_intersec = 0;
          for (k = 0; k < BITSET_WORDS; ++k)
            has_intersec |= intersec[k] = accepts[k] & dests_ch[j][k];
@@ -3721,7 +3723,7 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
          if (!has_intersec)
            continue;
 
-         /* Then check if this state is a subset of `accepts'.  */
+         /* Then check if this state is a subset of 'accepts'.  */
          not_subset = not_consumed = 0;
          for (k = 0; k < BITSET_WORDS; ++k)
            {
@@ -3729,8 +3731,8 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
              not_consumed |= accepts[k] = accepts[k] & ~dests_ch[j][k];
            }
 
-         /* If this state isn't a subset of `accepts', create a
-            new group state, which has the `remains'. */
+         /* If this state isn't a subset of 'accepts', create a
+            new group state, which has the 'remains'. */
          if (not_subset)
            {
              bitset_copy (dests_ch[ndests], remains);
@@ -3769,7 +3771,7 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
 }
 
 #ifdef RE_ENABLE_I18N
-/* Check how many bytes the node `dfa->nodes[node_idx]' accepts.
+/* Check how many bytes the node 'dfa->nodes[node_idx]' accepts.
    Return the number of the bytes the node accepts.
    STR_IDX is the current index of the input string.
 
@@ -3896,7 +3898,6 @@ check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx,
          const int32_t *table, *indirect;
          const unsigned char *weights, *extra;
          const char *collseqwc;
-         int32_t idx;
          /* This #include defines a local function!  */
 #  include <locale/weight.h>
 
@@ -3954,7 +3955,7 @@ check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx,
                _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB);
              indirect = (const int32_t *)
                _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB);
-             int32_t idx = findidx (&cp);
+             int32_t idx = findidx (&cp, elem_len);
              if (idx > 0)
                for (i = 0; i < cset->nequiv_classes; ++i)
                  {
@@ -3985,7 +3986,7 @@ check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx,
 # endif /* _LIBC */
        {
          /* match with range expression?  */
-#if __GNUC__ >= 2 && ! (__STDC_VERSION__ < 199901L && __STRICT_ANSI__)
+#if __GNUC__ >= 2 && ! (__STDC_VERSION__ < 199901L && defined __STRICT_ANSI__)
          wchar_t cmp_buf[] = {L'\0', L'\0', wc, L'\0', L'\0', L'\0'};
 #else
          wchar_t cmp_buf[] = {L'\0', L'\0', L'\0', L'\0', L'\0', L'\0'};
@@ -4066,7 +4067,7 @@ find_collation_sequence_value (const unsigned char *mbs, size_t mbs_len)
          /* Skip the collation sequence value.  */
          idx += sizeof (uint32_t);
          /* Skip the wide char sequence of the collating element.  */
-         idx = idx + sizeof (uint32_t) * (extra[idx] + 1);
+         idx = idx + sizeof (uint32_t) * (*(int32_t *) (extra + idx) + 1);
          /* If we found the entry, return the sequence value.  */
          if (found)
            return *(uint32_t *) (extra + idx);
@@ -4140,11 +4141,12 @@ extend_buffers (re_match_context_t *mctx)
   re_string_t *pstr = &mctx->input;
 
   /* Avoid overflow.  */
-  if (BE (SIZE_MAX / 2 / sizeof (re_dfastate_t *) <= pstr->bufs_len, 0))
+  if (BE (MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *)) / 2
+          <= pstr->bufs_len, 0))
     return REG_ESPACE;
 
-  /* Double the lengthes of the buffers.  */
-  ret = re_string_realloc_buffers (pstr, pstr->bufs_len * 2);
+  /* Double the lengths of the buffers.  */
+  ret = re_string_realloc_buffers (pstr, MIN (pstr->len, pstr->bufs_len * 2));
   if (BE (ret != REG_NOERROR, 0))
     return ret;
 
@@ -4207,7 +4209,7 @@ 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 (SIZE_MAX / max_object_size < n, 0))
+      if (BE (MIN (IDX_MAX, SIZE_MAX / max_object_size) < n, 0))
        return REG_ESPACE;
 
       mctx->bkref_ents = re_malloc (struct re_backref_cache_entry, n);
index eaf7b5e..e08b6c2 100644 (file)
@@ -1,6 +1,6 @@
 /* safe-alloc.c: safer memory allocation
 
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License as published by the
index 7044380..b0377a6 100644 (file)
@@ -1,6 +1,6 @@
 /* safe-alloc.h: safer memory allocation
 
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License as published by the
index 4b2a9a2..1081e90 100644 (file)
@@ -1,5 +1,5 @@
 /* Replacement <selinux/selinux.h> for platforms that lack it.
-   Copyright (C) 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -14,8 +14,8 @@
    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef _GL_SELINUX_SELINUX_H
-# define _GL_SELINUX_SELINUX_H
+#ifndef _@GUARD_PREFIX@_SELINUX_SELINUX_H
+# define _@GUARD_PREFIX@_SELINUX_SELINUX_H
 
 # if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
@@ -94,4 +94,4 @@ static inline int matchpathcon_init_prefix
 #  endif
 
 # endif
-#endif /* _GL_SELINUX_SELINUX_H */
+#endif /* _@GUARD_PREFIX@_SELINUX_SELINUX_H */
index 7ea0c2e..7187be7 100644 (file)
@@ -1,5 +1,5 @@
 /* size_max.h -- declare SIZE_MAX through system headers
-   Copyright (C) 2005-2006, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2012 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef GNULIB_SIZE_MAX_H
 #define GNULIB_SIZE_MAX_H
index 2ddb5d1..0a0b05c 100644 (file)
@@ -1,5 +1,5 @@
 /* Work around platform bugs in stat.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
 
 /* written by Eric Blake */
 
+/* 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
+   rpl_stat.  */
+#define __need_system_sys_stat_h
 #include <config.h>
 
 /* Get the original definition of stat.  It might be defined as a macro.  */
-#define __need_system_sys_stat_h
 #include <sys/types.h>
 #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
+#endif
+
 static inline int
 orig_stat (const char *filename, struct stat *buf)
 {
@@ -31,13 +49,26 @@ orig_stat (const char *filename, struct stat *buf)
 }
 
 /* Specification.  */
-#include <sys/stat.h>
+/* 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 <limits.h>
 #include <stdbool.h>
 #include <string.h>
 #include "dosname.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
+#endif
 
 /* Store information about NAME into ST.  Work around bugs with
    trailing slashes.  Mingw has other bugs (such as st_ino always
@@ -63,6 +94,7 @@ rpl_stat (char const *name, struct stat *st)
     }
 #endif /* REPLACE_FUNC_STAT_FILE */
 #if REPLACE_FUNC_STAT_DIR
+
   if (result == -1 && errno == ENOENT)
     {
       /* Due to mingw's oddities, there are some directories (like
@@ -77,6 +109,7 @@ rpl_stat (char const *name, struct stat *st)
       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)
index 12efde3..a329c70 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2003, 2006-2011 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2003, 2006-2012 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,8 +12,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _GL_STDBOOL_H
 #define _GL_STDBOOL_H
index b3fc2b5..9384cf6 100644 (file)
@@ -1,6 +1,6 @@
 /* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
 
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -13,8 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake.  */
 
@@ -38,9 +37,9 @@
    remember if special invocation has ever been used to obtain wint_t,
    in which case we need to clean up NULL yet again.  */
 
-# if !(defined _GL_STDDEF_H && defined _GL_STDDEF_WINT_T)
+# if !(defined _@GUARD_PREFIX@_STDDEF_H && defined _GL_STDDEF_WINT_T)
 #  ifdef __need_wint_t
-#   undef _GL_STDDEF_H
+#   undef _@GUARD_PREFIX@_STDDEF_H
 #   define _GL_STDDEF_WINT_T
 #  endif
 #  @INCLUDE_NEXT@ @NEXT_STDDEF_H@
 #else
 /* Normal invocation convention.  */
 
-# ifndef _GL_STDDEF_H
+# ifndef _@GUARD_PREFIX@_STDDEF_H
 
 /* The include_next requires a split double-inclusion guard.  */
 
 #  @INCLUDE_NEXT@ @NEXT_STDDEF_H@
 
-#  ifndef _GL_STDDEF_H
-#   define _GL_STDDEF_H
+#  ifndef _@GUARD_PREFIX@_STDDEF_H
+#   define _@GUARD_PREFIX@_STDDEF_H
 
 /* On NetBSD 5.0, the definition of NULL lacks proper parentheses.  */
 #if @REPLACE_NULL@
@@ -82,6 +81,6 @@
 # define wchar_t int
 #endif
 
-#  endif /* _GL_STDDEF_H */
-# endif /* _GL_STDDEF_H */
+#  endif /* _@GUARD_PREFIX@_STDDEF_H */
+# endif /* _@GUARD_PREFIX@_STDDEF_H */
 #endif /* __need_XXX */
index 1140c12..4f61f95 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2002, 2004-2011 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2002, 2004-2012 Free Software Foundation, Inc.
    Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
    This file is part of gnulib.
 
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /*
  * ISO C 99 <stdint.h> for platforms that lack it.
  * <http://www.opengroup.org/susv3xbd/stdint.h.html>
  */
 
-#ifndef _GL_STDINT_H
+#ifndef _@GUARD_PREFIX@_STDINT_H
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
    <inttypes.h>.  */
 #define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
 
+/* On Android (Bionic libc), <sys/types.h> includes this file before
+   having defined 'time_t'.  Therefore in this case avoid including
+   other system header files; just include the system's <stdint.h>.
+   Ideally we should test __BIONIC__ here, but it is only defined after
+   <sys/cdefs.h> has been included; hence test __ANDROID__ instead.  */
+#if defined __ANDROID__ \
+    && defined _SYS_TYPES_H_ && !defined _SSIZE_T_DEFINED_
+# @INCLUDE_NEXT@ @NEXT_STDINT_H@
+#else
+
 /* Get those types that are already defined in other system include
    files, so that we can "#define int8_t signed char" below without
    worrying about a later system include file containing a "typedef
       diagnostics.  */
 #  define __STDINT_H__
 # endif
+
+  /* Some pre-C++11 <stdint.h> implementations need this.  */
+# ifdef __cplusplus
+#  ifndef __STDC_CONSTANT_MACROS
+#   define __STDC_CONSTANT_MACROS 1
+#  endif
+#  ifndef __STDC_LIMIT_MACROS
+#   define __STDC_LIMIT_MACROS 1
+#  endif
+# endif
+
   /* Other systems may have an incomplete or buggy <stdint.h>.
      Include it before <inttypes.h>, since any "#include <stdint.h>"
      in <inttypes.h> would reinclude us, skipping our contents because
-     _GL_STDINT_H is defined.
+     _@GUARD_PREFIX@_STDINT_H is defined.
      The include_next requires a split double-inclusion guard.  */
 # @INCLUDE_NEXT@ @NEXT_STDINT_H@
 #endif
 
-#if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
-#define _GL_STDINT_H
+#if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
+#define _@GUARD_PREFIX@_STDINT_H
 
 /* <sys/types.h> defines some of the stdint.h types as well, on glibc,
    IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
    AIX 5.2 <sys/types.h> isn't needed and causes troubles.
-   MacOS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
+   Mac OS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
    relies on the system <stdint.h> definitions, so include
    <sys/types.h> after @NEXT_STDINT_H@.  */
 #if @HAVE_SYS_TYPES_H@ && ! defined _AIX
 # include <sys/types.h>
 #endif
 
-/* Get LONG_MIN, LONG_MAX, ULONG_MAX.  */
+/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX,
+   LONG_MIN, LONG_MAX, ULONG_MAX.  */
 #include <limits.h>
 
 #if @HAVE_INTTYPES_H@
 
 #undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
 
-/* Minimum and maximum values for a integer type under the usual assumption.
+/* Minimum and maximum values for an integer type under the usual assumption.
    Return an unspecified value if BITS == 0, adding a check to pacify
    picky compilers.  */
 
@@ -226,8 +247,9 @@ typedef unsigned long long int gl_uint64_t;
 
 /* Here we assume a standard architecture where the hardware integer
    types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
-   are taken from the same list of types.  Assume that 'long int'
-   is fast enough for all narrower integers.  */
+   are taken from the same list of types.  The following code normally
+   uses types consistent with glibc, as that lessens the chance of
+   incompatibility with older GNU hosts.  */
 
 #undef int_fast8_t
 #undef uint_fast8_t
@@ -237,12 +259,21 @@ typedef unsigned long long int gl_uint64_t;
 #undef uint_fast32_t
 #undef int_fast64_t
 #undef uint_fast64_t
-typedef long int gl_int_fast8_t;
-typedef unsigned long int gl_uint_fast8_t;
-typedef long int gl_int_fast16_t;
-typedef unsigned long int gl_uint_fast16_t;
+typedef signed char gl_int_fast8_t;
+typedef unsigned char gl_uint_fast8_t;
+
+#ifdef __sun
+/* Define types compatible with SunOS 5.10, so that code compiled under
+   earlier SunOS versions works with code compiled under SunOS 5.10.  */
+typedef int gl_int_fast32_t;
+typedef unsigned int gl_uint_fast32_t;
+#else
 typedef long int gl_int_fast32_t;
 typedef unsigned long int gl_uint_fast32_t;
+#endif
+typedef gl_int_fast32_t gl_int_fast16_t;
+typedef gl_uint_fast32_t gl_uint_fast16_t;
+
 #define int_fast8_t gl_int_fast8_t
 #define uint_fast8_t gl_uint_fast8_t
 #define int_fast16_t gl_int_fast16_t
@@ -270,26 +301,36 @@ typedef unsigned long int gl_uintptr_t;
 /* Note: These types are compiler dependent. It may be unwise to use them in
    public header files. */
 
-#undef intmax_t
-#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+/* If the system defines INTMAX_MAX, assume that intmax_t works, and
+   similarly for UINTMAX_MAX and uintmax_t.  This avoids problems with
+   assuming one type where another is used by the system.  */
+
+#ifndef INTMAX_MAX
+# undef INTMAX_C
+# undef intmax_t
+# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
 typedef long long int gl_intmax_t;
-# define intmax_t gl_intmax_t
-#elif defined GL_INT64_T
-# define intmax_t int64_t
-#else
+#  define intmax_t gl_intmax_t
+# elif defined GL_INT64_T
+#  define intmax_t int64_t
+# else
 typedef long int gl_intmax_t;
-# define intmax_t gl_intmax_t
+#  define intmax_t gl_intmax_t
+# endif
 #endif
 
-#undef uintmax_t
-#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+#ifndef UINTMAX_MAX
+# undef UINTMAX_C
+# undef uintmax_t
+# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
 typedef unsigned long long int gl_uintmax_t;
-# define uintmax_t gl_uintmax_t
-#elif defined GL_UINT64_T
-# define uintmax_t uint64_t
-#else
+#  define uintmax_t gl_uintmax_t
+# elif defined GL_UINT64_T
+#  define uintmax_t uint64_t
+# else
 typedef unsigned long int gl_uintmax_t;
-# define uintmax_t gl_uintmax_t
+#  define uintmax_t gl_uintmax_t
+# endif
 #endif
 
 /* Verify that intmax_t and uintmax_t have the same size.  Too much code
@@ -303,8 +344,6 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
 
 /* 7.18.2. Limits of specified-width integer types */
 
-#if ! defined __cplusplus || defined __STDC_LIMIT_MACROS
-
 /* 7.18.2.1. Limits of exact-width integer types */
 
 /* Here we assume a standard architecture where the hardware integer
@@ -390,23 +429,29 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
 #undef INT_FAST8_MIN
 #undef INT_FAST8_MAX
 #undef UINT_FAST8_MAX
-#define INT_FAST8_MIN  LONG_MIN
-#define INT_FAST8_MAX  LONG_MAX
-#define UINT_FAST8_MAX  ULONG_MAX
+#define INT_FAST8_MIN  SCHAR_MIN
+#define INT_FAST8_MAX  SCHAR_MAX
+#define UINT_FAST8_MAX  UCHAR_MAX
 
 #undef INT_FAST16_MIN
 #undef INT_FAST16_MAX
 #undef UINT_FAST16_MAX
-#define INT_FAST16_MIN  LONG_MIN
-#define INT_FAST16_MAX  LONG_MAX
-#define UINT_FAST16_MAX  ULONG_MAX
+#define INT_FAST16_MIN  INT_FAST32_MIN
+#define INT_FAST16_MAX  INT_FAST32_MAX
+#define UINT_FAST16_MAX  UINT_FAST32_MAX
 
 #undef INT_FAST32_MIN
 #undef INT_FAST32_MAX
 #undef UINT_FAST32_MAX
-#define INT_FAST32_MIN  LONG_MIN
-#define INT_FAST32_MAX  LONG_MAX
-#define UINT_FAST32_MAX  ULONG_MAX
+#ifdef __sun
+# define INT_FAST32_MIN  INT_MIN
+# define INT_FAST32_MAX  INT_MAX
+# define UINT_FAST32_MAX  UINT_MAX
+#else
+# define INT_FAST32_MIN  LONG_MIN
+# define INT_FAST32_MAX  LONG_MAX
+# define UINT_FAST32_MAX  ULONG_MAX
+#endif
 
 #undef INT_FAST64_MIN
 #undef INT_FAST64_MAX
@@ -431,21 +476,23 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
 
 /* 7.18.2.5. Limits of greatest-width integer types */
 
-#undef INTMAX_MIN
-#undef INTMAX_MAX
-#ifdef INT64_MAX
-# define INTMAX_MIN  INT64_MIN
-# define INTMAX_MAX  INT64_MAX
-#else
-# define INTMAX_MIN  INT32_MIN
-# define INTMAX_MAX  INT32_MAX
+#ifndef INTMAX_MAX
+# undef INTMAX_MIN
+# ifdef INT64_MAX
+#  define INTMAX_MIN  INT64_MIN
+#  define INTMAX_MAX  INT64_MAX
+# else
+#  define INTMAX_MIN  INT32_MIN
+#  define INTMAX_MAX  INT32_MAX
+# endif
 #endif
 
-#undef UINTMAX_MAX
-#ifdef UINT64_MAX
-# define UINTMAX_MAX  UINT64_MAX
-#else
-# define UINTMAX_MAX  UINT32_MAX
+#ifndef UINTMAX_MAX
+# ifdef UINT64_MAX
+#  define UINTMAX_MAX  UINT64_MAX
+# else
+#  define UINTMAX_MAX  UINT32_MAX
+# endif
 #endif
 
 /* 7.18.3. Limits of other integer types */
@@ -522,12 +569,8 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
 #define WINT_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
 
-#endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */
-
 /* 7.18.4. Macros for integer constants */
 
-#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS
-
 /* 7.18.4.1. Macros for minimum-width integer constants */
 /* According to ISO C 99 Technical Corrigendum 1 */
 
@@ -568,25 +611,26 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
 
 /* 7.18.4.2. Macros for greatest-width integer constants */
 
-#undef INTMAX_C
-#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
-# define INTMAX_C(x)   x##LL
-#elif defined GL_INT64_T
-# define INTMAX_C(x)   INT64_C(x)
-#else
-# define INTMAX_C(x)   x##L
+#ifndef INTMAX_C
+# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+#  define INTMAX_C(x)   x##LL
+# elif defined GL_INT64_T
+#  define INTMAX_C(x)   INT64_C(x)
+# else
+#  define INTMAX_C(x)   x##L
+# endif
 #endif
 
-#undef UINTMAX_C
-#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
-# define UINTMAX_C(x)  x##ULL
-#elif defined GL_UINT64_T
-# define UINTMAX_C(x)  UINT64_C(x)
-#else
-# define UINTMAX_C(x)  x##UL
+#ifndef UINTMAX_C
+# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+#  define UINTMAX_C(x)  x##ULL
+# elif defined GL_UINT64_T
+#  define UINTMAX_C(x)  UINT64_C(x)
+# else
+#  define UINTMAX_C(x)  x##UL
+# endif
 #endif
 
-#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */
-
-#endif /* _GL_STDINT_H */
-#endif /* !defined _GL_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */
+#endif /* _@GUARD_PREFIX@_STDINT_H */
+#endif /* !(defined __ANDROID__ && ...) */
+#endif /* !defined _@GUARD_PREFIX@_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */
index 9091497..44b5d87 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <stdio.h>.
 
-   Copyright (C) 2004, 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2007-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -13,8 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
@@ -35,7 +34,7 @@
 #else
 /* Normal invocation convention.  */
 
-#ifndef _GL_STDIO_H
+#ifndef _@GUARD_PREFIX@_STDIO_H
 
 #define _GL_ALREADY_INCLUDING_STDIO_H
 
@@ -44,8 +43,8 @@
 
 #undef _GL_ALREADY_INCLUDING_STDIO_H
 
-#ifndef _GL_STDIO_H
-#define _GL_STDIO_H
+#ifndef _@GUARD_PREFIX@_STDIO_H
+#define _@GUARD_PREFIX@_STDIO_H
 
 /* Get va_list.  Needed on many systems, including glibc 2.8.  */
 #include <stdarg.h>
@@ -53,7 +52,8 @@
 #include <stddef.h>
 
 /* Get off_t and ssize_t.  Needed on many systems, including glibc 2.8
-   and eglibc 2.11.2.  */
+   and eglibc 2.11.2.
+   May also define off_t to a 64-bit type on native Windows.  */
 #include <sys/types.h>
 
 /* The __attribute__ feature is available in gcc versions 2.5 and later.
 #else
 # define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
 #endif
-#define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
+
+/* _GL_ATTRIBUTE_FORMAT_PRINTF
+   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
+
+/* _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_PRINTF,
+   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.  */
+#define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
   _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
 
+/* _GL_ATTRIBUTE_FORMAT_SCANF
+   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_SCANF(formatstring_parameter, first_argument) \
+   _GL_ATTRIBUTE_FORMAT ((__gnu_scanf__, formatstring_parameter, first_argument))
+#else
+# define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
+   _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
+#endif
+
+/* _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_SCANF,
+   except that it indicates to GCC that the supported format string directives
+   are the ones of the system scanf(), rather than the ones standardized by
+   ISO C99 and POSIX.  */
+#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>.  */
 /* But in any case avoid namespace pollution on glibc systems.  */
 #if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __sun \
@@ -134,6 +170,26 @@ _GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - "
                  "use gnulib module fclose for portable POSIX compliance");
 #endif
 
+#if @GNULIB_FDOPEN@
+# if @REPLACE_FDOPEN@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fdopen
+#   define fdopen rpl_fdopen
+#  endif
+_GL_FUNCDECL_RPL (fdopen, FILE *, (int fd, const char *mode)
+                                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode));
+# else
+_GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
+# endif
+_GL_CXXALIASWARN (fdopen);
+#elif defined GNULIB_POSIXCHECK
+# undef 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");
+#endif
+
 #if @GNULIB_FFLUSH@
 /* Flush all pending data on STREAM according to POSIX rules.  Both
    output and seekable input streams are supported.
@@ -158,11 +214,34 @@ _GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - "
                  "use gnulib module fflush for portable POSIX compliance");
 #endif
 
-/* It is very rare that the developer ever has full control of stdin,
-   so any use of gets warrants an unconditional warning.  Assume it is
-   always declared, since it is required by C89.  */
-#undef gets
-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+#if @GNULIB_FGETC@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fgetc
+#   define fgetc rpl_fgetc
+#  endif
+_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fgetc, int, (FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fgetc, int, (FILE *stream));
+# endif
+_GL_CXXALIASWARN (fgetc);
+#endif
+
+#if @GNULIB_FGETS@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   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));
+# else
+_GL_CXXALIAS_SYS (fgets, char *, (char *s, int n, FILE *stream));
+# endif
+_GL_CXXALIASWARN (fgets);
+#endif
 
 #if @GNULIB_FOPEN@
 # if @REPLACE_FOPEN@
@@ -180,20 +259,26 @@ _GL_CXXALIASWARN (fopen);
 #elif defined GNULIB_POSIXCHECK
 # undef fopen
 /* Assume fopen is always declared.  */
-_GL_WARN_ON_USE (fopen, "fopen on Win32 platforms is not POSIX compatible - "
+_GL_WARN_ON_USE (fopen, "fopen on native Windows platforms is not POSIX compliant - "
                  "use gnulib module fopen for portability");
 #endif
 
 #if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@
 # if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \
-     || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@)
+     || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define fprintf rpl_fprintf
 #  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)));
+#  else
+_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
+                                _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3)
+                                _GL_ARG_NONNULL ((1, 2)));
+#  endif
 _GL_CXXALIAS_RPL (fprintf, int, (FILE *fp, const char *format, ...));
 # else
 _GL_CXXALIAS_SYS (fprintf, int, (FILE *fp, const char *format, ...));
@@ -239,7 +324,7 @@ _GL_WARN_ON_USE (fpurge, "fpurge is not always present - "
 #endif
 
 #if @GNULIB_FPUTC@
-# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef fputc
 #   define fputc rpl_fputc
@@ -253,7 +338,7 @@ _GL_CXXALIASWARN (fputc);
 #endif
 
 #if @GNULIB_FPUTS@
-# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef fputs
 #   define fputs rpl_fputs
@@ -267,6 +352,21 @@ _GL_CXXALIAS_SYS (fputs, int, (const char *string, FILE *stream));
 _GL_CXXALIASWARN (fputs);
 #endif
 
+#if @GNULIB_FREAD@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   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));
+# else
+_GL_CXXALIAS_SYS (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
+# endif
+_GL_CXXALIASWARN (fread);
+#endif
+
 #if @GNULIB_FREOPEN@
 # if @REPLACE_FREOPEN@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -287,10 +387,26 @@ _GL_CXXALIASWARN (freopen);
 # undef freopen
 /* Assume freopen is always declared.  */
 _GL_WARN_ON_USE (freopen,
-                 "freopen on Win32 platforms is not POSIX compatible - "
+                 "freopen on native Windows platforms is not POSIX compliant - "
                  "use gnulib module freopen for portability");
 #endif
 
+#if @GNULIB_FSCANF@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   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, ...));
+# else
+_GL_CXXALIAS_SYS (fscanf, int, (FILE *stream, const char *format, ...));
+# endif
+_GL_CXXALIASWARN (fscanf);
+#endif
+
 
 /* Set up the following warnings, based on which modules are in use.
    GNU Coding Standards discourage the use of fseek, since it imposes
@@ -365,25 +481,6 @@ _GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)
 _GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
 # endif
 _GL_CXXALIASWARN (fseeko);
-# if (@REPLACE_FSEEKO@ || !@HAVE_FSEEKO@) && !@GNULIB_FSEEK@
-   /* Provide an fseek function that is consistent with fseeko.  */
-   /* In order to avoid that fseek gets defined as a macro here, the
-      developer can request the 'fseek' module.  */
-#  if !GNULIB_defined_fseek_function
-#   undef fseek
-#   define fseek rpl_fseek
-static inline int _GL_ARG_NONNULL ((1))
-rpl_fseek (FILE *fp, long offset, int whence)
-{
-#   if @REPLACE_FSEEKO@
-  return rpl_fseeko (fp, offset, whence);
-#   else
-  return fseeko (fp, offset, whence);
-#   endif
-}
-#   define GNULIB_defined_fseek_function 1
-#  endif
-# endif
 #elif defined GNULIB_POSIXCHECK
 # define _GL_FSEEK_WARN /* Category 1, above.  */
 # undef fseek
@@ -443,25 +540,6 @@ _GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
 # endif
 _GL_CXXALIASWARN (ftello);
-# if (@REPLACE_FTELLO@ || !@HAVE_FTELLO@) && !@GNULIB_FTELL@
-   /* Provide an ftell function that is consistent with ftello.  */
-   /* In order to avoid that ftell gets defined as a macro here, the
-      developer can request the 'ftell' module.  */
-#  if !GNULIB_defined_ftell_function
-#   undef ftell
-#   define ftell rpl_ftell
-static inline long _GL_ARG_NONNULL ((1))
-rpl_ftell (FILE *f)
-{
-#   if @REPLACE_FTELLO@
-  return rpl_ftello (f);
-#   else
-  return ftello (f);
-#   endif
-}
-#   define GNULIB_defined_ftell_function 1
-#  endif
-# endif
 #elif defined GNULIB_POSIXCHECK
 # define _GL_FTELL_WARN /* Category 1, above.  */
 # undef ftell
@@ -483,7 +561,7 @@ _GL_WARN_ON_USE (ftell, "ftell cannot handle files larger than 4 GB "
 
 
 #if @GNULIB_FWRITE@
-# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef fwrite
 #   define fwrite rpl_fwrite
@@ -496,10 +574,55 @@ _GL_CXXALIAS_RPL (fwrite, size_t,
 # else
 _GL_CXXALIAS_SYS (fwrite, size_t,
                   (const void *ptr, size_t s, size_t n, FILE *stream));
+
+/* Work around glibc bug 11959
+   <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>,
+   which sometimes causes an unwanted diagnostic for fwrite calls.
+   This affects only function declaration attributes, so it's not
+   needed for C++.  */
+#  if !defined __cplusplus && 0 < __USE_FORTIFY_LEVEL
+static inline size_t _GL_ARG_NONNULL ((1, 4))
+rpl_fwrite (const void *ptr, size_t s, size_t n, FILE *stream)
+{
+  size_t r = fwrite (ptr, s, n, stream);
+  (void) r;
+  return r;
+}
+#   undef fwrite
+#   define fwrite rpl_fwrite
+#  endif
 # endif
 _GL_CXXALIASWARN (fwrite);
 #endif
 
+#if @GNULIB_GETC@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getc
+#   define getc rpl_fgetc
+#  endif
+_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL_1 (getc, rpl_fgetc, int, (FILE *stream));
+# else
+_GL_CXXALIAS_SYS (getc, int, (FILE *stream));
+# endif
+_GL_CXXALIASWARN (getc);
+#endif
+
+#if @GNULIB_GETCHAR@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getchar
+#   define getchar rpl_getchar
+#  endif
+_GL_FUNCDECL_RPL (getchar, int, (void));
+_GL_CXXALIAS_RPL (getchar, int, (void));
+# else
+_GL_CXXALIAS_SYS (getchar, int, (void));
+# endif
+_GL_CXXALIASWARN (getchar);
+#endif
+
 #if @GNULIB_GETDELIM@
 /* Read input, up to (and including) the next occurrence of DELIMITER, from
    STREAM, store it in *LINEPTR (and NUL-terminate it).
@@ -576,6 +699,15 @@ _GL_WARN_ON_USE (getline, "getline is unportable - "
 # endif
 #endif
 
+/* It is very rare that the developer ever has full control of stdin,
+   so any use of gets warrants an unconditional warning; besides, C11
+   removed it.  */
+#undef gets
+#if HAVE_RAW_DECL_GETS
+_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+#endif
+
+
 #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
 struct obstack;
 /* Grow an obstack with formatted output.  Return the number of
@@ -627,6 +759,20 @@ _GL_CXXALIAS_SYS (obstack_vprintf, int,
 _GL_CXXALIASWARN (obstack_vprintf);
 #endif
 
+#if @GNULIB_PCLOSE@
+# if !@HAVE_PCLOSE@
+_GL_FUNCDECL_SYS (pclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pclose, int, (FILE *stream));
+_GL_CXXALIASWARN (pclose);
+#elif defined GNULIB_POSIXCHECK
+# undef pclose
+# if HAVE_RAW_DECL_PCLOSE
+_GL_WARN_ON_USE (pclose, "pclose is unportable - "
+                 "use gnulib module pclose for more portability");
+# endif
+#endif
+
 #if @GNULIB_PERROR@
 /* Print a message to standard error, describing the value of ERRNO,
    (if STRING is not NULL and not empty) prefixed with STRING and ": ",
@@ -658,6 +804,10 @@ _GL_FUNCDECL_RPL (popen, FILE *, (const char *cmd, const char *mode)
                                  _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (popen, FILE *, (const char *cmd, const char *mode));
 # else
+#  if !@HAVE_POPEN@
+_GL_FUNCDECL_SYS (popen, FILE *, (const char *cmd, const char *mode)
+                                 _GL_ARG_NONNULL ((1, 2)));
+#  endif
 _GL_CXXALIAS_SYS (popen, FILE *, (const char *cmd, const char *mode));
 # endif
 _GL_CXXALIASWARN (popen);
@@ -671,18 +821,27 @@ _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_SIGPIPE@)
+     || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
 #  if defined __GNUC__
 #   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, ...)
                     __asm__ (@ASM_SYMBOL_PREFIX@
                              _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
                     _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
                     _GL_ARG_NONNULL ((1)));
+#   else
+_GL_FUNCDECL_RPL_1 (__printf__, int,
+                    (const char *format, ...)
+                    __asm__ (@ASM_SYMBOL_PREFIX@
+                             _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
+                    _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2)
+                    _GL_ARG_NONNULL ((1)));
+#   endif
 _GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
 #  else
 #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -711,7 +870,7 @@ _GL_WARN_ON_USE (printf, "printf is not always POSIX compliant - "
 #endif
 
 #if @GNULIB_PUTC@
-# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef putc
 #   define putc rpl_fputc
@@ -725,7 +884,7 @@ _GL_CXXALIASWARN (putc);
 #endif
 
 #if @GNULIB_PUTCHAR@
-# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef putchar
 #   define putchar rpl_putchar
@@ -739,7 +898,7 @@ _GL_CXXALIASWARN (putchar);
 #endif
 
 #if @GNULIB_PUTS@
-# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef puts
 #   define puts rpl_puts
@@ -823,6 +982,37 @@ _GL_WARN_ON_USE (renameat, "renameat is not portable - "
 # endif
 #endif
 
+#if @GNULIB_SCANF@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+#  if defined __GNUC__
+#   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, ...)
+                    __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, ...));
+#  else
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef scanf
+#    define scanf rpl_scanf
+#   endif
+_GL_FUNCDECL_RPL (scanf, int, (const char *format, ...)
+                              _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
+                              _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (scanf, int, (const char *format, ...));
+#  endif
+# else
+_GL_CXXALIAS_SYS (scanf, int, (const char *format, ...));
+# endif
+_GL_CXXALIASWARN (scanf);
+#endif
+
 #if @GNULIB_SNPRINTF@
 # if @REPLACE_SNPRINTF@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -853,9 +1043,9 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
 # endif
 #endif
 
-/* Some people would argue that sprintf should be handled like gets
-   (for example, OpenBSD issues a link warning for both functions),
-   since both can cause security holes due to buffer overruns.
+/* Some people would argue that all sprintf uses should be warned about
+   (for example, OpenBSD issues a link warning for it),
+   since it can cause security holes due to buffer overruns.
    However, we believe that sprintf can be used safely, and is more
    efficient than snprintf in those safe cases; and as proof of our
    belief, we use sprintf in several gnulib modules.  So this header
@@ -982,14 +1172,20 @@ _GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
 
 #if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@
 # if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \
-     || (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@)
+     || (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define vfprintf rpl_vfprintf
 #  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)));
+#  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)));
+#  endif
 _GL_CXXALIAS_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args));
 # else
 /* Need to cast, because on Solaris, the third parameter is
@@ -1010,16 +1206,41 @@ _GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
                       "POSIX compliance");
 #endif
 
+#if @GNULIB_VFSCANF@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef vfscanf
+#   define vfscanf rpl_vfscanf
+#  endif
+_GL_FUNCDECL_RPL (vfscanf, int,
+                  (FILE *stream, const char *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));
+# else
+_GL_CXXALIAS_SYS (vfscanf, int,
+                  (FILE *stream, const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vfscanf);
+#endif
+
 #if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@
 # if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \
-     || (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@)
+     || (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define vprintf rpl_vprintf
 #  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_ARG_NONNULL ((1)));
+#  else
+_GL_FUNCDECL_RPL (vprintf, int, (const char *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));
 # else
 /* Need to cast, because on Solaris, the second parameter is
@@ -1039,6 +1260,22 @@ _GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
                  "POSIX compliance");
 #endif
 
+#if @GNULIB_VSCANF@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef vscanf
+#   define vscanf rpl_vscanf
+#  endif
+_GL_FUNCDECL_RPL (vscanf, int, (const char *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));
+# else
+_GL_CXXALIAS_SYS (vscanf, int, (const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vscanf);
+#endif
+
 #if @GNULIB_VSNPRINTF@
 # if @REPLACE_VSNPRINTF@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1097,6 +1334,6 @@ _GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX compliant - "
 #endif
 
 
-#endif /* _GL_STDIO_H */
-#endif /* _GL_STDIO_H */
+#endif /* _@GUARD_PREFIX@_STDIO_H */
+#endif /* _@GUARD_PREFIX@_STDIO_H */
 #endif
index 0829a96..f270075 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <stdlib.h>.
 
-   Copyright (C) 1995, 2001-2004, 2006-2011 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001-2004, 2006-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
 #else
 /* Normal invocation convention.  */
 
-#ifndef _GL_STDLIB_H
+#ifndef _@GUARD_PREFIX@_STDLIB_H
 
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
 
-#ifndef _GL_STDLIB_H
-#define _GL_STDLIB_H
+#ifndef _@GUARD_PREFIX@_STDLIB_H
+#define _@GUARD_PREFIX@_STDLIB_H
 
 /* NetBSD 5.0 mis-defines NULL.  */
 #include <stddef.h>
 # include <sys/loadavg.h>
 #endif
 
+/* Native Windows platforms declare mktemp() in <io.h>.  */
+#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+# include <io.h>
+#endif
+
 #if @GNULIB_RANDOM_R@
 
 /* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
@@ -58,7 +63,7 @@
 #  include <random.h>
 # endif
 
-# if !@HAVE_STRUCT_RANDOM_DATA@ || !@HAVE_RANDOM_R@
+# if !@HAVE_STRUCT_RANDOM_DATA@ || @REPLACE_RANDOM_R@ || !@HAVE_RANDOM_R@
 #  include <stdint.h>
 # endif
 
@@ -81,19 +86,24 @@ struct random_data
 # endif
 #endif
 
-#if (@GNULIB_MKSTEMP@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
-/* On MacOS X 10.3, only <unistd.h> declares mkstemp.  */
+#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || 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 Cygwin 1.7.1, only <unistd.h> declares getsubopt.  */
 /* But avoid namespace pollution on glibc systems and native Windows.  */
 # include <unistd.h>
 #endif
 
-#if 3 <= __GNUC__ || __GNUC__ == 2 && 8 <= __GNUC_MINOR__
-# define _GL_ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
+/* 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_NORETURN
+# define _GL_ATTRIBUTE_PURE /* empty */
 #endif
 
+/* The definition of _Noreturn is copied here.  */
+
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 /* The definition of _GL_ARG_NONNULL is copied here.  */
@@ -119,7 +129,7 @@ struct random_data
 /* Terminate the current process with the given return code, without running
    the 'atexit' handlers.  */
 # if !@HAVE__EXIT@
-_GL_FUNCDECL_SYS (_Exit, void, (int status) _GL_ATTRIBUTE_NORETURN);
+_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status));
 # endif
 _GL_CXXALIAS_SYS (_Exit, void, (int status));
 _GL_CXXALIASWARN (_Exit);
@@ -136,7 +146,9 @@ _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
 /* Parse a signed decimal integer.
    Returns the value of the integer.  Errors are not detected.  */
 # if !@HAVE_ATOLL@
-_GL_FUNCDECL_SYS (atoll, long long, (const char *string) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (atoll, long long, (const char *string)
+                                    _GL_ATTRIBUTE_PURE
+                                    _GL_ARG_NONNULL ((1)));
 # endif
 _GL_CXXALIAS_SYS (atoll, long long, (const char *string));
 _GL_CXXALIASWARN (atoll);
@@ -250,14 +262,19 @@ _GL_CXXALIASWARN (grantpt);
 #elif defined GNULIB_POSIXCHECK
 # undef grantpt
 # if HAVE_RAW_DECL_GRANTPT
-_GL_WARN_ON_USE (ptsname, "grantpt is not portable - "
+_GL_WARN_ON_USE (grantpt, "grantpt is not portable - "
                  "use gnulib module grantpt for portability");
 # endif
 #endif
 
+/* If _GL_USE_STDLIB_ALLOC is nonzero, the including module does not
+   rely on GNU or POSIX semantics for malloc and realloc (for example,
+   by never specifying a zero size), so it does not need malloc or
+   realloc to be redefined.  */
 #if @GNULIB_MALLOC_POSIX@
 # if @REPLACE_MALLOC@
-#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#  if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
+        || _GL_USE_STDLIB_ALLOC)
 #   undef malloc
 #   define malloc rpl_malloc
 #  endif
@@ -267,7 +284,7 @@ _GL_CXXALIAS_RPL (malloc, void *, (size_t size));
 _GL_CXXALIAS_SYS (malloc, void *, (size_t size));
 # endif
 _GL_CXXALIASWARN (malloc);
-#elif defined GNULIB_POSIXCHECK
+#elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
 # undef malloc
 /* Assume malloc is always declared.  */
 _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
@@ -421,6 +438,22 @@ _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
 # 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.  */
+# if !@HAVE_POSIX_OPENPT@
+_GL_FUNCDECL_SYS (posix_openpt, int, (int flags));
+# endif
+_GL_CXXALIAS_SYS (posix_openpt, int, (int flags));
+_GL_CXXALIASWARN (posix_openpt);
+#elif defined GNULIB_POSIXCHECK
+# undef posix_openpt
+# if HAVE_RAW_DECL_POSIX_OPENPT
+_GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - "
+                 "use gnulib module posix_openpt for portability");
+# endif
+#endif
+
 #if @GNULIB_PTSNAME@
 /* Return the pathname of the pseudo-terminal slave associated with
    the master FD is open on, or NULL on errors.  */
@@ -437,6 +470,32 @@ _GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
 # endif
 #endif
 
+#if @GNULIB_PTSNAME_R@
+/* Set the pathname of the pseudo-terminal slave associated with
+   the master FD is open on and return 0, or set errno and return
+   non-zero on errors.  */
+# if @REPLACE_PTSNAME_R@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ptsname_r
+#   define ptsname_r rpl_ptsname_r
+#  endif
+_GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
+_GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
+# else
+#  if !@HAVE_PTSNAME_R@
+_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
+_GL_CXXALIASWARN (ptsname_r);
+#elif defined GNULIB_POSIXCHECK
+# undef ptsname_r
+# if HAVE_RAW_DECL_PTSNAME_R
+_GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - "
+                 "use gnulib module ptsname_r for portability");
+# endif
+#endif
+
 #if @GNULIB_PUTENV@
 # if @REPLACE_PUTENV@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -460,12 +519,83 @@ _GL_CXXALIASWARN (putenv);
 # endif
 #endif
 
+
+#if @GNULIB_RANDOM@
+# if !@HAVE_RANDOM@
+_GL_FUNCDECL_SYS (random, long, (void));
+# endif
+_GL_CXXALIAS_SYS (random, long, (void));
+_GL_CXXALIASWARN (random);
+#elif defined GNULIB_POSIXCHECK
+# undef random
+# if HAVE_RAW_DECL_RANDOM
+_GL_WARN_ON_USE (random, "random is unportable - "
+                 "use gnulib module random for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM@
+# if !@HAVE_RANDOM@
+_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed));
+# endif
+_GL_CXXALIAS_SYS (srandom, void, (unsigned int seed));
+_GL_CXXALIASWARN (srandom);
+#elif defined GNULIB_POSIXCHECK
+# undef srandom
+# if HAVE_RAW_DECL_SRANDOM
+_GL_WARN_ON_USE (srandom, "srandom is unportable - "
+                 "use gnulib module random for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM@
+# if !@HAVE_RANDOM@
+_GL_FUNCDECL_SYS (initstate, char *,
+                  (unsigned int seed, char *buf, size_t buf_size)
+                  _GL_ARG_NONNULL ((2)));
+# 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
+_GL_WARN_ON_USE (initstate, "initstate is unportable - "
+                 "use gnulib module random for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM@
+# if !@HAVE_RANDOM@
+_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (setstate, char *, (char *arg_state));
+_GL_CXXALIASWARN (setstate);
+#elif defined GNULIB_POSIXCHECK
+# undef setstate
+# if HAVE_RAW_DECL_SETSTATE_R
+_GL_WARN_ON_USE (setstate, "setstate is unportable - "
+                 "use gnulib module random for portability");
+# endif
+#endif
+
+
 #if @GNULIB_RANDOM_R@
-# if !@HAVE_RANDOM_R@
+# if @REPLACE_RANDOM_R@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef random_r
+#   define random_r rpl_random_r
+#  endif
+_GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result)
+                                 _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result));
+# else
+#  if !@HAVE_RANDOM_R@
 _GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result)
                                  _GL_ARG_NONNULL ((1, 2)));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
+# endif
 _GL_CXXALIASWARN (random_r);
 #elif defined GNULIB_POSIXCHECK
 # undef random_r
@@ -476,13 +606,25 @@ _GL_WARN_ON_USE (random_r, "random_r is unportable - "
 #endif
 
 #if @GNULIB_RANDOM_R@
-# if !@HAVE_RANDOM_R@
+# if @REPLACE_RANDOM_R@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef srandom_r
+#   define srandom_r rpl_srandom_r
+#  endif
+_GL_FUNCDECL_RPL (srandom_r, int,
+                  (unsigned int seed, struct random_data *rand_state)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (srandom_r, int,
+                  (unsigned int seed, struct random_data *rand_state));
+# else
+#  if !@HAVE_RANDOM_R@
 _GL_FUNCDECL_SYS (srandom_r, int,
                   (unsigned int seed, struct random_data *rand_state)
                   _GL_ARG_NONNULL ((2)));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (srandom_r, int,
                   (unsigned int seed, struct random_data *rand_state));
+# endif
 _GL_CXXALIASWARN (srandom_r);
 #elif defined GNULIB_POSIXCHECK
 # undef srandom_r
@@ -493,15 +635,29 @@ _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
 #endif
 
 #if @GNULIB_RANDOM_R@
-# if !@HAVE_RANDOM_R@
+# if @REPLACE_RANDOM_R@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef initstate_r
+#   define initstate_r rpl_initstate_r
+#  endif
+_GL_FUNCDECL_RPL (initstate_r, int,
+                  (unsigned int seed, char *buf, size_t buf_size,
+                   struct random_data *rand_state)
+                  _GL_ARG_NONNULL ((2, 4)));
+_GL_CXXALIAS_RPL (initstate_r, int,
+                  (unsigned int seed, char *buf, size_t buf_size,
+                   struct random_data *rand_state));
+# else
+#  if !@HAVE_RANDOM_R@
 _GL_FUNCDECL_SYS (initstate_r, int,
                   (unsigned int seed, char *buf, size_t buf_size,
                    struct random_data *rand_state)
                   _GL_ARG_NONNULL ((2, 4)));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (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
 # undef initstate_r
@@ -512,13 +668,25 @@ _GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
 #endif
 
 #if @GNULIB_RANDOM_R@
-# if !@HAVE_RANDOM_R@
+# if @REPLACE_RANDOM_R@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef setstate_r
+#   define setstate_r rpl_setstate_r
+#  endif
+_GL_FUNCDECL_RPL (setstate_r, int,
+                  (char *arg_state, struct random_data *rand_state)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (setstate_r, int,
+                  (char *arg_state, struct random_data *rand_state));
+# else
+#  if !@HAVE_RANDOM_R@
 _GL_FUNCDECL_SYS (setstate_r, int,
                   (char *arg_state, struct random_data *rand_state)
                   _GL_ARG_NONNULL ((1, 2)));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (setstate_r, int,
                   (char *arg_state, struct random_data *rand_state));
+# endif
 _GL_CXXALIASWARN (setstate_r);
 #elif defined GNULIB_POSIXCHECK
 # undef setstate_r
@@ -531,7 +699,8 @@ _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
 
 #if @GNULIB_REALLOC_POSIX@
 # if @REPLACE_REALLOC@
-#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#  if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
+        || _GL_USE_STDLIB_ALLOC)
 #   undef realloc
 #   define realloc rpl_realloc
 #  endif
@@ -541,7 +710,7 @@ _GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
 _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
 # endif
 _GL_CXXALIASWARN (realloc);
-#elif defined GNULIB_POSIXCHECK
+#elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
 # undef realloc
 /* Assume realloc is always declared.  */
 _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
@@ -754,6 +923,6 @@ _GL_CXXALIASWARN (wctomb);
 #endif
 
 
-#endif /* _GL_STDLIB_H */
-#endif /* _GL_STDLIB_H */
+#endif /* _@GUARD_PREFIX@_STDLIB_H */
+#endif /* _@GUARD_PREFIX@_STDLIB_H */
 #endif
index f465d07..5f10a54 100644 (file)
@@ -1,5 +1,5 @@
 /* stpcpy.c -- copy a string and return pointer to end of new string
-   Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2011 Free Software
+   Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2012 Free Software
    Foundation, Inc.
 
    NOTE: The canonical source of this file is maintained with the GNU C Library.
index 1c42891..5fdfe36 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995-1997, 2002-2003, 2005-2007, 2009-2011 Free Software
+/* Copyright (C) 1993, 1995-1997, 2002-2003, 2005-2007, 2009-2012 Free Software
  * Foundation, Inc.
 
    NOTE: The canonical source of this file is maintained with the GNU C Library.
index a8b31c3..dcb0854 100644 (file)
@@ -1,5 +1,5 @@
 /* Byte-wise substring search, using the Two-Way algorithm.
-   Copyright (C) 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Eric Blake <ebb9@byu.net>, 2008.
 
@@ -14,8 +14,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License along
-   with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* Before including this file, you need to include <config.h> and
    <string.h>, and define:
diff --git a/gnulib/lib/strchrnul.c b/gnulib/lib/strchrnul.c
new file mode 100644 (file)
index 0000000..2ced7f2
--- /dev/null
@@ -0,0 +1,142 @@
+/* Searching in a string.
+   Copyright (C) 2003, 2007-2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation; either version 2.1 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <string.h>
+
+/* Find the first occurrence of C in S or the final NUL byte.  */
+char *
+strchrnul (const char *s, int c_in)
+{
+  /* 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 char c;
+
+  c = (unsigned char) c_in;
+  if (!c)
+    return rawmemchr (s, 0);
+
+  /* Handle the first 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;
+       (size_t) char_ptr % sizeof (longword) != 0;
+       ++char_ptr)
+    if (!*char_ptr || *char_ptr == c)
+      return (char *) char_ptr;
+
+  longword_ptr = (const longword *) 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 NUL or
+     c.  We first use an xor with repeated_c.  This reduces the task
+     to testing whether *any of the four* bytes in longword1 or
+     longword2 is zero.
+
+     Let's consider longword1.  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.
+
+     The test whether any byte in longword1 or longword2 is zero is equivalent
+     to testing whether tmp1 is nonzero or tmp2 is nonzero.  We can combine
+     this into a single test, whether (tmp1 | tmp2) is nonzero.
+
+     This test can read more than one byte beyond the end of a string,
+     depending on where the terminating NUL is encountered.  However,
+     this is considered safe since the initialization phase ensured
+     that the read will be aligned, therefore, the read will not cross
+     page boundaries and will not cause a fault.  */
+
+  while (1)
+    {
+      longword longword1 = *longword_ptr ^ repeated_c;
+      longword longword2 = *longword_ptr;
+
+      if (((((longword1 - repeated_one) & ~longword1)
+            | ((longword2 - repeated_one) & ~longword2))
+           & (repeated_one << 7)) != 0)
+        break;
+      longword_ptr++;
+    }
+
+  char_ptr = (const unsigned char *) longword_ptr;
+
+  /* At this point, we know that one of the sizeof (longword) bytes
+     starting at char_ptr is == 0 or == 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.  */
+
+  char_ptr = (unsigned char *) longword_ptr;
+  while (*char_ptr && (*char_ptr != c))
+    char_ptr++;
+  return (char *) char_ptr;
+}
diff --git a/gnulib/lib/strchrnul.valgrind b/gnulib/lib/strchrnul.valgrind
new file mode 100644 (file)
index 0000000..b14fa13
--- /dev/null
@@ -0,0 +1,12 @@
+# Suppress a valgrind message about use of uninitialized memory in strchrnul().
+# This use is OK because it provides only a speedup.
+{
+    strchrnul-value4
+    Memcheck:Value4
+    fun:strchrnul
+}
+{
+    strchrnul-value8
+    Memcheck:Value8
+    fun:strchrnul
+}
index 73cfa29..6101168 100644 (file)
@@ -1,5 +1,5 @@
 /* Optimized string comparison.
-   Copyright (C) 2001-2002, 2007, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002, 2007, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License as published
@@ -21,8 +21,8 @@
 
 #include <string.h>
 
-/* STREQ allows to optimize string comparison with a small literal string.
-     STREQ (s, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
+/* STREQ_OPT allows to optimize string comparison with a small literal string.
+     STREQ_OPT (s, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
    is semantically equivalent to
      strcmp (s, "EUC-KR") == 0
    just faster.  */
@@ -163,12 +163,12 @@ streq0 (const char *s1, const char *s2, char s20, char s21, char s22, char s23,
     return 0;
 }
 
-#define STREQ(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \
+#define STREQ_OPT(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \
   streq0 (s1, s2, s20, s21, s22, s23, s24, s25, s26, s27, s28)
 
 #else
 
-#define STREQ(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \
+#define STREQ_OPT(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \
   (strcmp (s1, s2) == 0)
 
 #endif
index d86d283..ed187c9 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <string.h>.
 
-   Copyright (C) 1995-1996, 2001-2011 Free Software Foundation, Inc.
+   Copyright (C) 1995-1996, 2001-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef _GL_STRING_H
+#ifndef _@GUARD_PREFIX@_STRING_H
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
@@ -26,8 +25,8 @@
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_STRING_H@
 
-#ifndef _GL_STRING_H
-#define _GL_STRING_H
+#ifndef _@GUARD_PREFIX@_STRING_H
+#define _@GUARD_PREFIX@_STRING_H
 
 /* NetBSD 5.0 mis-defines NULL.  */
 #include <stddef.h>
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
 
+/* Find the index of the least-significant set bit.  */
+#if @GNULIB_FFSL@
+# if !@HAVE_FFSL@
+_GL_FUNCDECL_SYS (ffsl, int, (long int i));
+# endif
+_GL_CXXALIAS_SYS (ffsl, int, (long int i));
+_GL_CXXALIASWARN (ffsl);
+#elif defined GNULIB_POSIXCHECK
+# undef ffsl
+# if HAVE_RAW_DECL_FFSL
+_GL_WARN_ON_USE (ffsl, "ffsl is not portable - use the ffsl module");
+# endif
+#endif
+
+
+/* Find the index of the least-significant set bit.  */
+#if @GNULIB_FFSLL@
+# if !@HAVE_FFSLL@
+_GL_FUNCDECL_SYS (ffsll, int, (long long int i));
+# endif
+_GL_CXXALIAS_SYS (ffsll, int, (long long int i));
+_GL_CXXALIASWARN (ffsll);
+#elif defined GNULIB_POSIXCHECK
+# undef ffsll
+# if HAVE_RAW_DECL_FFSLL
+_GL_WARN_ON_USE (ffsll, "ffsll is not portable - use the ffsll module");
+# endif
+#endif
+
+
 /* Return the first instance of C within N bytes of S, or NULL.  */
 #if @GNULIB_MEMCHR@
 # if @REPLACE_MEMCHR@
@@ -277,17 +306,28 @@ _GL_WARN_ON_USE (strchr, "strchr cannot work correctly on character strings "
 
 /* Find the first occurrence of C in S or the final NUL byte.  */
 #if @GNULIB_STRCHRNUL@
-# if ! @HAVE_STRCHRNUL@
+# if @REPLACE_STRCHRNUL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define strchrnul rpl_strchrnul
+#  endif
+_GL_FUNCDECL_RPL (strchrnul, char *, (const char *__s, int __c_in)
+                                     _GL_ATTRIBUTE_PURE
+                                     _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strchrnul, char *,
+                  (const char *str, int ch));
+# else
+#  if ! @HAVE_STRCHRNUL@
 _GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in)
                                      _GL_ATTRIBUTE_PURE
                                      _GL_ARG_NONNULL ((1)));
-# endif
+#  endif
   /* On some systems, this function is defined as an overloaded function:
        extern "C++" { const char * std::strchrnul (const char *, int); }
        extern "C++" { char * std::strchrnul (char *, int); }  */
 _GL_CXXALIAS_SYS_CAST2 (strchrnul,
                         char *, (char const *__s, int __c_in),
                         char const *, (char const *__s, int __c_in));
+# endif
 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in));
@@ -684,10 +724,14 @@ _GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - "
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define mbslen rpl_mbslen
 #  endif
-_GL_FUNCDECL_RPL (mbslen, size_t, (const char *string) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_RPL (mbslen, size_t, (const char *string)
+                                  _GL_ATTRIBUTE_PURE
+                                  _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (mbslen, size_t, (const char *string));
 # else
-_GL_FUNCDECL_SYS (mbslen, size_t, (const char *string) _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (mbslen, size_t, (const char *string)
+                                  _GL_ATTRIBUTE_PURE
+                                  _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_SYS (mbslen, size_t, (const char *string));
 # endif
 _GL_CXXALIASWARN (mbslen);
@@ -697,6 +741,7 @@ _GL_CXXALIASWARN (mbslen);
 /* Return the number of multibyte characters in the character string starting
    at STRING and ending at STRING + LEN.  */
 _GL_EXTERN_C size_t mbsnlen (const char *string, size_t len)
+     _GL_ATTRIBUTE_PURE
      _GL_ARG_NONNULL ((1));
 #endif
 
@@ -710,10 +755,12 @@ _GL_EXTERN_C size_t mbsnlen (const char *string, size_t len)
 #   define mbschr rpl_mbschr /* avoid collision with HP-UX function */
 #  endif
 _GL_FUNCDECL_RPL (mbschr, char *, (const char *string, int c)
+                                  _GL_ATTRIBUTE_PURE
                                   _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (mbschr, char *, (const char *string, int c));
 # else
 _GL_FUNCDECL_SYS (mbschr, char *, (const char *string, int c)
+                                  _GL_ATTRIBUTE_PURE
                                   _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_SYS (mbschr, char *, (const char *string, int c));
 # endif
@@ -725,15 +772,17 @@ _GL_CXXALIASWARN (mbschr);
    and return a pointer to it.  Return NULL if C is not found in STRING.
    Unlike strrchr(), this function works correctly in multibyte locales with
    encodings such as GB18030.  */
-# if defined __hpux
+# if defined __hpux || defined __INTERIX
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-#   define mbsrchr rpl_mbsrchr /* avoid collision with HP-UX function */
+#   define mbsrchr rpl_mbsrchr /* avoid collision with system function */
 #  endif
 _GL_FUNCDECL_RPL (mbsrchr, char *, (const char *string, int c)
+                                   _GL_ATTRIBUTE_PURE
                                    _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (mbsrchr, char *, (const char *string, int c));
 # else
 _GL_FUNCDECL_SYS (mbsrchr, char *, (const char *string, int c)
+                                   _GL_ATTRIBUTE_PURE
                                    _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_SYS (mbsrchr, char *, (const char *string, int c));
 # endif
@@ -746,6 +795,7 @@ _GL_CXXALIASWARN (mbsrchr);
    Unlike strstr(), this function works correctly in multibyte locales with
    encodings different from UTF-8.  */
 _GL_EXTERN_C char * mbsstr (const char *haystack, const char *needle)
+     _GL_ATTRIBUTE_PURE
      _GL_ARG_NONNULL ((1, 2));
 #endif
 
@@ -757,6 +807,7 @@ _GL_EXTERN_C char * mbsstr (const char *haystack, const char *needle)
    different lengths!
    Unlike strcasecmp(), this function works correctly in multibyte locales.  */
 _GL_EXTERN_C int mbscasecmp (const char *s1, const char *s2)
+     _GL_ATTRIBUTE_PURE
      _GL_ARG_NONNULL ((1, 2));
 #endif
 
@@ -771,6 +822,7 @@ _GL_EXTERN_C int mbscasecmp (const char *s1, const char *s2)
    Unlike strncasecmp(), this function works correctly in multibyte locales.
    But beware that N is not a byte count but a character count!  */
 _GL_EXTERN_C int mbsncasecmp (const char *s1, const char *s2, size_t n)
+     _GL_ATTRIBUTE_PURE
      _GL_ARG_NONNULL ((1, 2));
 #endif
 
@@ -784,6 +836,7 @@ _GL_EXTERN_C int mbsncasecmp (const char *s1, const char *s2, size_t n)
    Unlike strncasecmp(), this function works correctly in multibyte
    locales.  */
 _GL_EXTERN_C char * mbspcasecmp (const char *string, const char *prefix)
+     _GL_ATTRIBUTE_PURE
      _GL_ARG_NONNULL ((1, 2));
 #endif
 
@@ -794,6 +847,7 @@ _GL_EXTERN_C char * mbspcasecmp (const char *string, const char *prefix)
    strlen (haystack) < strlen (needle) !
    Unlike strcasestr(), this function works correctly in multibyte locales.  */
 _GL_EXTERN_C char * mbscasestr (const char *haystack, const char *needle)
+     _GL_ATTRIBUTE_PURE
      _GL_ARG_NONNULL ((1, 2));
 #endif
 
@@ -804,6 +858,7 @@ _GL_EXTERN_C char * mbscasestr (const char *haystack, const char *needle)
    if none exists.
    Unlike strcspn(), this function works correctly in multibyte locales.  */
 _GL_EXTERN_C size_t mbscspn (const char *string, const char *accept)
+     _GL_ATTRIBUTE_PURE
      _GL_ARG_NONNULL ((1, 2));
 #endif
 
@@ -817,10 +872,12 @@ _GL_EXTERN_C size_t mbscspn (const char *string, const char *accept)
 #   define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */
 #  endif
 _GL_FUNCDECL_RPL (mbspbrk, char *, (const char *string, const char *accept)
+                                   _GL_ATTRIBUTE_PURE
                                    _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (mbspbrk, char *, (const char *string, const char *accept));
 # else
 _GL_FUNCDECL_SYS (mbspbrk, char *, (const char *string, const char *accept)
+                                   _GL_ATTRIBUTE_PURE
                                    _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_SYS (mbspbrk, char *, (const char *string, const char *accept));
 # endif
@@ -834,6 +891,7 @@ _GL_CXXALIASWARN (mbspbrk);
    if none exists.
    Unlike strspn(), this function works correctly in multibyte locales.  */
 _GL_EXTERN_C size_t mbsspn (const char *string, const char *reject)
+     _GL_ATTRIBUTE_PURE
      _GL_ARG_NONNULL ((1, 2));
 #endif
 
@@ -953,6 +1011,7 @@ _GL_WARN_ON_USE (strsignal, "strsignal is unportable - "
 #if @GNULIB_STRVERSCMP@
 # if !@HAVE_STRVERSCMP@
 _GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *)
+                                   _GL_ATTRIBUTE_PURE
                                    _GL_ARG_NONNULL ((1, 2)));
 # endif
 _GL_CXXALIAS_SYS (strverscmp, int, (const char *, const char *));
@@ -966,5 +1025,5 @@ _GL_WARN_ON_USE (strverscmp, "strverscmp is unportable - "
 #endif
 
 
-#endif /* _GL_STRING_H */
-#endif /* _GL_STRING_H */
+#endif /* _@GUARD_PREFIX@_STRING_H */
+#endif /* _@GUARD_PREFIX@_STRING_H */
index 06c6b84..b6313b2 100644 (file)
@@ -1,6 +1,6 @@
 /* A replacement function, for systems that lack strndup.
 
-   Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2011 Free Software
+   Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2012 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
@@ -14,8 +14,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 44f7b45..ec6c674 100644 (file)
@@ -1,5 +1,5 @@
 /* Find the length of STRING, but scan at most MAXLEN characters.
-   Copyright (C) 2005-2007, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2005-2007, 2009-2012 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 299bd65..bdfcc37 100644 (file)
@@ -1,5 +1,5 @@
 /* Find the length of STRING + 1, but scan at most MAXLEN bytes.
-   Copyright (C) 2005-2006, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index cb0f756..9af1d38 100644 (file)
@@ -1,5 +1,5 @@
 /* Find the length of STRING + 1, but scan at most MAXLEN bytes.
-   Copyright (C) 2005, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -28,7 +28,8 @@ extern "C" {
 /* 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);
+extern size_t strnlen1 (const char *string, size_t maxlen)
+  _GL_ATTRIBUTE_PURE;
 
 
 #ifdef __cplusplus
index 65d69e0..8e50d62 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2011 Free Software
+/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2012 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -13,8 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License along
-   with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* This particular implementation was written by Eric Blake, 2008.  */
 
index 0ce19ed..8b6372f 100644 (file)
@@ -1,5 +1,5 @@
 /* Provide a more complete sys/stat header file.
-   Copyright (C) 2005-2011 Free Software Foundation, Inc.
+   Copyright (C) 2005-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -12,8 +12,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake, Paul Eggert, and Jim Meyering.  */
 
 #else
 /* Normal invocation convention.  */
 
-#ifndef _GL_SYS_STAT_H
+#ifndef _@GUARD_PREFIX@_SYS_STAT_H
 
-/* Get nlink_t.  */
+/* Get nlink_t.
+   May also define off_t to a 64-bit type on native Windows.  */
 #include <sys/types.h>
 
 /* Get struct timespec.  */
@@ -45,8 +45,8 @@
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@
 
-#ifndef _GL_SYS_STAT_H
-#define _GL_SYS_STAT_H
+#ifndef _@GUARD_PREFIX@_SYS_STAT_H
+#define _@GUARD_PREFIX@_SYS_STAT_H
 
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
 /* Before doing "#define mkdir rpl_mkdir" below, we need to include all
-   headers that may declare mkdir().  */
+   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__
 # include <io.h>     /* mingw32, mingw64 */
-# include <direct.h> /* mingw64 */
+# include <direct.h> /* mingw64, MSVC 9 */
+#endif
+
+/* Native Windows platforms declare umask() in <io.h>.  */
+#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+# include <io.h>
+#endif
+
+/* Large File Support on native Windows.  */
+#if @WINDOWS_64_BIT_ST_SIZE@
+# define stat _stati64
+#endif
+
+#ifndef S_IFIFO
+# ifdef _S_IFIFO
+#  define S_IFIFO _S_IFIFO
+# endif
 #endif
 
 #ifndef S_IFMT
@@ -312,16 +329,28 @@ _GL_WARN_ON_USE (fchmodat, "fchmodat is not portable - "
 #endif
 
 
-#if @REPLACE_FSTAT@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-#  define fstat rpl_fstat
-# endif
+#if @GNULIB_FSTAT@
+# if @REPLACE_FSTAT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fstat
+#   define fstat rpl_fstat
+#  endif
 _GL_FUNCDECL_RPL (fstat, int, (int fd, struct stat *buf) _GL_ARG_NONNULL ((2)));
 _GL_CXXALIAS_RPL (fstat, int, (int fd, struct stat *buf));
-#else
+# else
 _GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf));
-#endif
+# endif
 _GL_CXXALIASWARN (fstat);
+#elif @WINDOWS_64_BIT_ST_SIZE@
+/* Above, we define stat to _stati64.  */
+# define fstat _fstati64
+#elif defined GNULIB_POSIXCHECK
+# undef fstat
+# if HAVE_RAW_DECL_FSTAT
+_GL_WARN_ON_USE (fstat, "fstat has portability problems - "
+                 "use gnulib module fstat for portability");
+# endif
+#endif
 
 
 #if @GNULIB_FSTATAT@
@@ -355,7 +384,11 @@ _GL_WARN_ON_USE (fstatat, "fstatat is not portable - "
 
 
 #if @GNULIB_FUTIMENS@
-# if @REPLACE_FUTIMENS@
+/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our futimens
+   implementation relies on futimesat, which on Solaris 10 makes an invocation
+   to futimens that is meant to invoke the libc's futimens(), not gnulib's
+   futimens().  */
+# if @REPLACE_FUTIMENS@ || (!@HAVE_FUTIMENS@ && defined __sun)
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef futimens
 #   define futimens rpl_futimens
@@ -368,7 +401,9 @@ _GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2]));
 #  endif
 _GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2]));
 # endif
+# if @HAVE_FUTIMENS@
 _GL_CXXALIASWARN (futimens);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef futimens
 # if HAVE_RAW_DECL_FUTIMENS
@@ -589,14 +624,55 @@ _GL_WARN_ON_USE (mknodat, "mknodat is not portable - "
 /* 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.  */
-#  undef stat
-#  ifdef _LARGE_FILES
+#  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(). */
-#   define stat stat64
 #   undef stat64
 #   define stat64(name, st) rpl_stat (name, st)
-#  else /* !_LARGE_FILES */
+#  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 __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)
@@ -612,7 +688,11 @@ _GL_WARN_ON_USE (stat, "stat is unportable - "
 
 
 #if @GNULIB_UTIMENSAT@
-# if @REPLACE_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
+   to utimensat that is meant to invoke the libc's utimensat(), not gnulib's
+   utimensat().  */
+# if @REPLACE_UTIMENSAT@ || (!@HAVE_UTIMENSAT@ && defined __sun)
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef utimensat
 #   define utimensat rpl_utimensat
@@ -631,7 +711,9 @@ _GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name,
 _GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name,
                                    struct timespec const times[2], int flag));
 # endif
+# if @HAVE_UTIMENSAT@
 _GL_CXXALIASWARN (utimensat);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef utimensat
 # if HAVE_RAW_DECL_UTIMENSAT
@@ -641,6 +723,6 @@ _GL_WARN_ON_USE (utimensat, "utimensat is not portable - "
 #endif
 
 
-#endif /* _GL_SYS_STAT_H */
-#endif /* _GL_SYS_STAT_H */
+#endif /* _@GUARD_PREFIX@_SYS_STAT_H */
+#endif /* _@GUARD_PREFIX@_SYS_STAT_H */
 #endif
diff --git a/gnulib/lib/sys_time.in.h b/gnulib/lib/sys_time.in.h
new file mode 100644 (file)
index 0000000..b4d6d2a
--- /dev/null
@@ -0,0 +1,205 @@
+/* Provide a more complete sys/time.h.
+
+   Copyright (C) 2007-2012 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation; either version 2.1, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined _@GUARD_PREFIX@_SYS_TIME_H
+
+/* Simply delegate to the system's header, without adding anything.  */
+# if @HAVE_SYS_TIME_H@
+#  @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
+# endif
+
+#else
+
+# define _@GUARD_PREFIX@_SYS_TIME_H
+
+# if @HAVE_SYS_TIME_H@
+#  @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
+# else
+#  include <time.h>
+# endif
+
+/* On native Windows with MSVC, get the 'struct timeval' type.
+   Also, on native Windows with a 64-bit time_t, where we are overriding the
+   'struct timeval' type, get all declarations of system functions whose
+   signature contains 'struct timeval'.  */
+# if (defined _MSC_VER || @REPLACE_STRUCT_TIMEVAL@) && @HAVE_WINSOCK2_H@ && !defined _GL_INCLUDING_WINSOCK2_H
+#  define _GL_INCLUDING_WINSOCK2_H
+#  include <winsock2.h>
+#  undef _GL_INCLUDING_WINSOCK2_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.  */
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# if !@HAVE_STRUCT_TIMEVAL@ || @REPLACE_STRUCT_TIMEVAL@
+
+#  if @REPLACE_STRUCT_TIMEVAL@
+#   define timeval rpl_timeval
+#  endif
+
+#  if !GNULIB_defined_struct_timeval
+struct timeval
+{
+  time_t tv_sec;
+  long int tv_usec;
+};
+#   define GNULIB_defined_struct_timeval 1
+#  endif
+
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+
+# if @GNULIB_GETTIMEOFDAY@
+#  if @REPLACE_GETTIMEOFDAY@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef gettimeofday
+#    define gettimeofday rpl_gettimeofday
+#   endif
+_GL_FUNCDECL_RPL (gettimeofday, int,
+                  (struct timeval *restrict, void *restrict)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (gettimeofday, int,
+                  (struct timeval *restrict, void *restrict));
+#  else
+#   if !@HAVE_GETTIMEOFDAY@
+_GL_FUNCDECL_SYS (gettimeofday, int,
+                  (struct timeval *restrict, void *restrict)
+                  _GL_ARG_NONNULL ((1)));
+#   endif
+/* Need to cast, because on glibc systems, by default, the second argument is
+                                                  struct timezone *.  */
+_GL_CXXALIAS_SYS_CAST (gettimeofday, int,
+                       (struct timeval *restrict, void *restrict));
+#  endif
+_GL_CXXALIASWARN (gettimeofday);
+# elif defined GNULIB_POSIXCHECK
+#  undef gettimeofday
+#  if HAVE_RAW_DECL_GETTIMEOFDAY
+_GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - "
+                 "use gnulib module gettimeofday for portability");
+#  endif
+# endif
+
+/* Hide some function declarations from <winsock2.h>.  */
+
+# if defined _MSC_VER && @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
+#   else
+     _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_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
+#   else
+     _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
+#  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
+
+#endif /* _@GUARD_PREFIX@_SYS_TIME_H */
diff --git a/gnulib/lib/sys_types.in.h b/gnulib/lib/sys_types.in.h
new file mode 100644 (file)
index 0000000..b503870
--- /dev/null
@@ -0,0 +1,51 @@
+/* Provide a more complete sys/types.h.
+
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation; either version 2.1, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#ifndef _@GUARD_PREFIX@_SYS_TYPES_H
+
+/* The include_next requires a split double-inclusion guard.  */
+#@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@
+
+#ifndef _@GUARD_PREFIX@_SYS_TYPES_H
+#define _@GUARD_PREFIX@_SYS_TYPES_H
+
+/* Override off_t if Large File Support is requested on native Windows.  */
+#if @WINDOWS_64_BIT_OFF_T@
+/* Same as int64_t in <stdint.h>.  */
+# if defined _MSC_VER
+#  define off_t __int64
+# else
+#  define off_t long long int
+# endif
+/* Indicator, for gnulib internal purposes.  */
+# define _GL_WINDOWS_64_BIT_OFF_T 1
+#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__
+# include <stddef.h>
+#endif
+
+#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
+#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
index 91d5bfa..ed3a694 100644 (file)
@@ -1,5 +1,5 @@
 /* A POSIX-like <sys/wait.h>.
-   Copyright (C) 2001-2003, 2005-2011 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 
-#ifndef _GL_SYS_WAIT_H
+#ifndef _@GUARD_PREFIX@_SYS_WAIT_H
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
@@ -28,8 +27,8 @@
 # @INCLUDE_NEXT@ @NEXT_SYS_WAIT_H@
 #endif
 
-#ifndef _GL_SYS_WAIT_H
-#define _GL_SYS_WAIT_H
+#ifndef _@GUARD_PREFIX@_SYS_WAIT_H
+#define _@GUARD_PREFIX@_SYS_WAIT_H
 
 /* Get pid_t.  */
 #include <sys/types.h>
@@ -126,5 +125,5 @@ _GL_WARN_ON_USE (waitpid, "waitpid is unportable - "
 #endif
 
 
-#endif /* _GL_SYS_WAIT_H */
-#endif /* _GL_SYS_WAIT_H */
+#endif /* _@GUARD_PREFIX@_SYS_WAIT_H */
+#endif /* _@GUARD_PREFIX@_SYS_WAIT_H */
diff --git a/gnulib/lib/tempname.c b/gnulib/lib/tempname.c
new file mode 100644 (file)
index 0000000..4639f80
--- /dev/null
@@ -0,0 +1,309 @@
+/* tempname.c - generate the name of a temporary file.
+
+   Copyright (C) 1991-2003, 2005-2007, 2009-2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation; either version 2.1 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Extracted from glibc sysdeps/posix/tempname.c.  See also tmpdir.c.  */
+
+#if !_LIBC
+# include <config.h>
+# include "tempname.h"
+#endif
+
+#include <sys/types.h>
+#include <assert.h>
+
+#include <errno.h>
+#ifndef __set_errno
+# define __set_errno(Val) errno = (Val)
+#endif
+
+#include <stdio.h>
+#ifndef P_tmpdir
+# define P_tmpdir "/tmp"
+#endif
+#ifndef TMP_MAX
+# define TMP_MAX 238328
+#endif
+#ifndef __GT_FILE
+# define __GT_FILE      0
+# define __GT_DIR       1
+# define __GT_NOCREATE  2
+#endif
+#if !_LIBC && (GT_FILE != __GT_FILE || GT_DIR != __GT_DIR       \
+               || GT_NOCREATE != __GT_NOCREATE)
+# error report this to bug-gnulib@gnu.org
+#endif
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <fcntl.h>
+#include <sys/time.h>
+#include <stdint.h>
+#include <unistd.h>
+
+#include <sys/stat.h>
+
+#if _LIBC
+# define struct_stat64 struct stat64
+#else
+# define struct_stat64 struct stat
+# 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)
+#endif
+
+#if ! (HAVE___SECURE_GETENV || _LIBC)
+# define __secure_getenv getenv
+#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 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
+#endif
+
+#if _LIBC
+/* Return nonzero if DIR is an existent directory.  */
+static int
+direxists (const char *dir)
+{
+  struct_stat64 buf;
+  return __xstat64 (_STAT_VER, dir, &buf) == 0 && S_ISDIR (buf.st_mode);
+}
+
+/* Path search algorithm, for tmpnam, tmpfile, etc.  If DIR is
+   non-null and exists, uses it; otherwise uses the first of $TMPDIR,
+   P_tmpdir, /tmp that exists.  Copies into TMPL a template suitable
+   for use with mk[s]temp.  Will fail (-1) if DIR is non-null and
+   doesn't exist, none of the searched dirs exists, or there's not
+   enough space in TMPL. */
+int
+__path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
+               int try_tmpdir)
+{
+  const char *d;
+  size_t dlen, plen;
+
+  if (!pfx || !pfx[0])
+    {
+      pfx = "file";
+      plen = 4;
+    }
+  else
+    {
+      plen = strlen (pfx);
+      if (plen > 5)
+        plen = 5;
+    }
+
+  if (try_tmpdir)
+    {
+      d = __secure_getenv ("TMPDIR");
+      if (d != NULL && direxists (d))
+        dir = d;
+      else if (dir != NULL && direxists (dir))
+        /* nothing */ ;
+      else
+        dir = NULL;
+    }
+  if (dir == NULL)
+    {
+      if (direxists (P_tmpdir))
+        dir = P_tmpdir;
+      else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
+        dir = "/tmp";
+      else
+        {
+          __set_errno (ENOENT);
+          return -1;
+        }
+    }
+
+  dlen = strlen (dir);
+  while (dlen > 1 && dir[dlen - 1] == '/')
+    dlen--;                     /* remove trailing slashes */
+
+  /* check we have room for "${dir}/${pfx}XXXXXX\0" */
+  if (tmpl_len < dlen + 1 + plen + 6 + 1)
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  sprintf (tmpl, "%.*s/%.*sXXXXXX", (int) dlen, dir, (int) plen, pfx);
+  return 0;
+}
+#endif /* _LIBC */
+
+/* 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 "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. */
+int
+__gen_tempname (char *tmpl, int suffixlen, int flags, int kind)
+{
+  int len;
+  char *XXXXXX;
+  static uint64_t value;
+  uint64_t random_time_bits;
+  unsigned int count;
+  int fd = -1;
+  int save_errno = errno;
+  struct_stat64 st;
+
+  /* A lower bound on the number of temporary files to attempt to
+     generate.  The maximum total number of temporary file names that
+     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.  */
+#define ATTEMPTS_MIN (62 * 62 * 62)
+
+  /* The number of times to attempt to generate a temporary file.  To
+     conform to POSIX, this must be no smaller than TMP_MAX.  */
+#if ATTEMPTS_MIN < TMP_MAX
+  unsigned int attempts = TMP_MAX;
+#else
+  unsigned int attempts = ATTEMPTS_MIN;
+#endif
+
+  len = strlen (tmpl);
+  if (len < 6 + suffixlen || memcmp (&tmpl[len - 6 - suffixlen], "XXXXXX", 6))
+    {
+      __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 ();
+
+  for (count = 0; count < attempts; value += 7777, ++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];
+
+      switch (kind)
+        {
+        case __GT_FILE:
+          fd = __open (tmpl,
+                       (flags & ~O_ACCMODE)
+                       | O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+          break;
+
+        case __GT_DIR:
+          fd = __mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR);
+          break;
+
+        case __GT_NOCREATE:
+          /* This case is backward from the other three.  __gen_tempname
+             succeeds if __xstat fails because the name does not exist.
+             Note the continue to bypass the common logic at the bottom
+             of the loop.  */
+          if (__lxstat64 (_STAT_VER, tmpl, &st) < 0)
+            {
+              if (errno == ENOENT)
+                {
+                  __set_errno (save_errno);
+                  return 0;
+                }
+              else
+                /* Give up now. */
+                return -1;
+            }
+          continue;
+
+        default:
+          assert (! "invalid KIND in __gen_tempname");
+          abort ();
+        }
+
+      if (fd >= 0)
+        {
+          __set_errno (save_errno);
+          return fd;
+        }
+      else if (errno != EEXIST)
+        return -1;
+    }
+
+  /* We got out of the loop because we ran out of combinations to try.  */
+  __set_errno (EEXIST);
+  return -1;
+}
diff --git a/gnulib/lib/tempname.h b/gnulib/lib/tempname.h
new file mode 100644 (file)
index 0000000..bcb8d27
--- /dev/null
@@ -0,0 +1,50 @@
+/* Create a temporary file or directory.
+
+   Copyright (C) 2006, 2009-2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation; either version 2.1 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* header written by Eric Blake */
+
+#ifndef GL_TEMPNAME_H
+# define GL_TEMPNAME_H
+
+# include <stdio.h>
+
+# ifdef __GT_FILE
+#  define GT_FILE     __GT_FILE
+#  define GT_DIR      __GT_DIR
+#  define GT_NOCREATE __GT_NOCREATE
+# else
+#  define GT_FILE     0
+#  define GT_DIR      1
+#  define GT_NOCREATE 2
+# endif
+
+/* 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 a large 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. */
+extern int gen_tempname (char *tmpl, int suffixlen, int flags, int kind);
+
+#endif /* GL_TEMPNAME_H */
index 8c17915..1c61df8 100644 (file)
@@ -1,6 +1,6 @@
 /* A more-standard <time.h>.
 
-   Copyright (C) 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -13,8 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
    without adding our own declarations.  */
 #if (defined __need_time_t || defined __need_clock_t \
      || defined __need_timespec \
-     || defined _GL_TIME_H)
+     || defined _@GUARD_PREFIX@_TIME_H)
 
 # @INCLUDE_NEXT@ @NEXT_TIME_H@
 
 #else
 
-# define _GL_TIME_H
+# define _@GUARD_PREFIX@_TIME_H
 
 # @INCLUDE_NEXT@ @NEXT_TIME_H@
 
index 1713c33..28d1477 100644 (file)
@@ -1,5 +1,5 @@
 /* Substitute for and wrapper around <unistd.h>.
-   Copyright (C) 2003-2011 Free Software Foundation, Inc.
+   Copyright (C) 2003-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -12,8 +12,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
@@ -36,7 +35,7 @@
 # define _GL_WINSOCK2_H_WITNESS
 
 /* Normal invocation.  */
-#elif !defined _GL_UNISTD_H
+#elif !defined _@GUARD_PREFIX@_UNISTD_H
 
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_UNISTD_H@
@@ -51,8 +50,8 @@
 # undef _GL_INCLUDING_WINSOCK2_H
 #endif
 
-#if !defined _GL_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
-#define _GL_UNISTD_H
+#if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
+#define _@GUARD_PREFIX@_UNISTD_H
 
 /* NetBSD 5.0 mis-defines NULL.  Also get size_t.  */
 #include <stddef.h>
 #endif
 
 /* mingw fails to declare _exit in <unistd.h>.  */
-/* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>.  */
+/* mingw, MSVC, BeOS, Haiku declare environ in <stdlib.h>, not in
+   <unistd.h>.  */
 /* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>.  */
 /* But avoid namespace pollution on glibc systems.  */
 #ifndef __GLIBC__
 # include <stdlib.h>
 #endif
 
-/* mingw declares getcwd in <io.h>, not in <unistd.h>.  */
-#if ((@GNULIB_GETCWD@ || defined GNULIB_POSIXCHECK) \
+/* 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__)
 # include <io.h>
 #endif
 
 # include <netdb.h>
 #endif
 
-#if (@GNULIB_WRITE@ || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
+/* 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>
+#endif
+
+#if (@GNULIB_READ@ || @GNULIB_WRITE@ \
+     || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
      || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK)
 /* Get ssize_t.  */
 # include <sys/types.h>
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
 
-#if @GNULIB_GETHOSTNAME@
-/* Get all possible declarations of gethostname().  */
-# if @UNISTD_H_HAVE_WINSOCK2_H@
-#  if !defined _GL_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
-#   else
-     _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
+/* Hide some function declarations from <winsock2.h>.  */
+
+#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@
+# 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
+#  else
+    _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
-#  if !defined _GL_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
+# 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
@@ -223,12 +240,24 @@ _GL_WARN_ON_USE (access, "the access function is a security risk - "
 #endif
 
 
+#if @GNULIB_CHDIR@
+_GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIASWARN (chdir);
+#elif defined GNULIB_POSIXCHECK
+# undef chdir
+# if HAVE_RAW_DECL_CHDIR
+_GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - "
+                 "use gnulib module chdir for portability");
+# endif
+#endif
+
+
 #if @GNULIB_CHOWN@
 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
    to GID (if GID is not -1).  Follow symbolic links.
    Return 0 if successful, otherwise -1 and errno set.
-   See the POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/chown.html>.  */
+   See the POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html.  */
 # if @REPLACE_CHOWN@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef chown
@@ -279,24 +308,32 @@ _GL_WARN_ON_USE (close, "close does not portably work on sockets - "
 #endif
 
 
-#if @REPLACE_DUP@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-#  define dup rpl_dup
-# endif
+#if @GNULIB_DUP@
+# if @REPLACE_DUP@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define dup rpl_dup
+#  endif
 _GL_FUNCDECL_RPL (dup, int, (int oldfd));
 _GL_CXXALIAS_RPL (dup, int, (int oldfd));
-#else
+# else
 _GL_CXXALIAS_SYS (dup, int, (int oldfd));
-#endif
+# endif
 _GL_CXXALIASWARN (dup);
+#elif defined GNULIB_POSIXCHECK
+# undef dup
+# if HAVE_RAW_DECL_DUP
+_GL_WARN_ON_USE (dup, "dup is unportable - "
+                 "use gnulib module dup for portability");
+# endif
+#endif
 
 
 #if @GNULIB_DUP2@
 /* Copy the file descriptor OLDFD into file descriptor NEWFD.  Do nothing if
    NEWFD = OLDFD, otherwise close NEWFD first if it is open.
    Return newfd if successful, otherwise -1 and errno set.
-   See the POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/dup2.html>.  */
+   See the POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html>.  */
 # if @REPLACE_DUP2@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define dup2 rpl_dup2
@@ -425,8 +462,8 @@ _GL_WARN_ON_USE (faccessat, "faccessat is not portable - "
 /* Change the process' current working directory to the directory on which
    the given file descriptor is open.
    Return 0 if successful, otherwise -1 and errno set.
-   See the POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/fchdir.html>.  */
+   See the POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html>.  */
 # if ! @HAVE_FCHDIR@
 _GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
 
@@ -483,11 +520,30 @@ _GL_WARN_ON_USE (fchownat, "fchownat is not portable - "
 #endif
 
 
-#if @GNULIB_FSYNC@
+#if @GNULIB_FDATASYNC@
 /* Synchronize changes to a file.
    Return 0 if successful, otherwise -1 and errno set.
-   See POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/fsync.html>.  */
+   See POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html>.  */
+# if !@HAVE_FDATASYNC@ || !@HAVE_DECL_FDATASYNC@
+_GL_FUNCDECL_SYS (fdatasync, int, (int fd));
+# endif
+_GL_CXXALIAS_SYS (fdatasync, int, (int fd));
+_GL_CXXALIASWARN (fdatasync);
+#elif defined GNULIB_POSIXCHECK
+# undef fdatasync
+# if HAVE_RAW_DECL_FDATASYNC
+_GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - "
+                 "use gnulib module fdatasync for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FSYNC@
+/* 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>.  */
 # if !@HAVE_FSYNC@
 _GL_FUNCDECL_SYS (fsync, int, (int fd));
 # endif
@@ -505,12 +561,21 @@ _GL_WARN_ON_USE (fsync, "fsync is unportable - "
 #if @GNULIB_FTRUNCATE@
 /* 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:2001 specification
-   <http://www.opengroup.org/susv3xsh/ftruncate.html>.  */
-# if !@HAVE_FTRUNCATE@
+   See the POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html>.  */
+# if @REPLACE_FTRUNCATE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ftruncate
+#   define ftruncate rpl_ftruncate
+#  endif
+_GL_FUNCDECL_RPL (ftruncate, int, (int fd, off_t length));
+_GL_CXXALIAS_RPL (ftruncate, int, (int fd, off_t length));
+# else
+#  if !@HAVE_FTRUNCATE@
 _GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length));
+# endif
 _GL_CXXALIASWARN (ftruncate);
 #elif defined GNULIB_POSIXCHECK
 # undef ftruncate
@@ -526,8 +591,8 @@ _GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - "
    of BUF.
    Return BUF if successful, or NULL if the directory couldn't be determined
    or SIZE was too small.
-   See the POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/getcwd.html>.
+   See the POSIX:2008 specification
+   <http://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
@@ -870,12 +935,49 @@ _GL_WARN_ON_USE (endusershell, "endusershell is unportable - "
 #endif
 
 
+#if @GNULIB_GROUP_MEMBER@
+/* Determine whether group id is in calling user's group list.  */
+# if !@HAVE_GROUP_MEMBER@
+_GL_FUNCDECL_SYS (group_member, int, (gid_t gid));
+# endif
+_GL_CXXALIAS_SYS (group_member, int, (gid_t gid));
+_GL_CXXALIASWARN (group_member);
+#elif defined GNULIB_POSIXCHECK
+# undef group_member
+# if HAVE_RAW_DECL_GROUP_MEMBER
+_GL_WARN_ON_USE (group_member, "group_member is unportable - "
+                 "use gnulib module group-member for portability");
+# endif
+#endif
+
+
+#if @GNULIB_ISATTY@
+# if @REPLACE_ISATTY@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef isatty
+#   define isatty rpl_isatty
+#  endif
+_GL_FUNCDECL_RPL (isatty, int, (int fd));
+_GL_CXXALIAS_RPL (isatty, int, (int fd));
+# else
+_GL_CXXALIAS_SYS (isatty, int, (int fd));
+# endif
+_GL_CXXALIASWARN (isatty);
+#elif defined GNULIB_POSIXCHECK
+# undef isatty
+# if HAVE_RAW_DECL_ISATTY
+_GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - "
+                 "use gnulib module isatty for portability");
+# endif
+#endif
+
+
 #if @GNULIB_LCHOWN@
 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
    to GID (if GID is not -1).  Do not follow symbolic links.
    Return 0 if successful, otherwise -1 and errno set.
-   See the POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/lchown.html>.  */
+   See the POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/lchown.html>.  */
 # if @REPLACE_LCHOWN@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef lchown
@@ -904,8 +1006,8 @@ _GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - "
 #if @GNULIB_LINK@
 /* Create a new hard link for an existing file.
    Return 0 if successful, otherwise -1 and errno set.
-   See POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/link.html>.  */
+   See POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html>.  */
 # if @REPLACE_LINK@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define link rpl_link
@@ -970,8 +1072,8 @@ _GL_WARN_ON_USE (linkat, "linkat is unportable - "
 #if @GNULIB_LSEEK@
 /* 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:2001 specification
-   <http://www.opengroup.org/susv3xsh/lseek.html>.  */
+   See the POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html>.  */
 # if @REPLACE_LSEEK@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define lseek rpl_lseek
@@ -1041,10 +1143,12 @@ _GL_WARN_ON_USE (pipe2, "pipe2 is unportable - "
 #if @GNULIB_PREAD@
 /* Read at most BUFSIZE bytes from FD into BUF, starting at OFFSET.
    Return the number of bytes placed into BUF if successful, otherwise
-   set errno and return -1.  0 indicates EOF.  See the POSIX:2001
-   specification <http://www.opengroup.org/susv3xsh/pread.html>.  */
+   set errno and return -1.  0 indicates EOF.
+   See the POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html>.  */
 # if @REPLACE_PREAD@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pread
 #   define pread rpl_pread
 #  endif
 _GL_FUNCDECL_RPL (pread, ssize_t,
@@ -1075,10 +1179,11 @@ _GL_WARN_ON_USE (pread, "pread is unportable - "
 /* Write at most BUFSIZE bytes from BUF into FD, starting at OFFSET.
    Return the number of bytes written if successful, otherwise
    set errno and return -1.  0 indicates nothing written.  See the
-   POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/pwrite.html>.  */
+   POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html>.  */
 # if @REPLACE_PWRITE@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pwrite
 #   define pwrite rpl_pwrite
 #  endif
 _GL_FUNCDECL_RPL (pwrite, ssize_t,
@@ -1105,12 +1210,34 @@ _GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
 #endif
 
 
+#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>.  */
+# if @REPLACE_READ@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef read
+#   define read rpl_read
+#  endif
+_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));
+# 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));
+# endif
+_GL_CXXALIASWARN (read);
+#endif
+
+
 #if @GNULIB_READLINK@
 /* Read the contents of the symbolic link FILE and place the first BUFSIZE
    bytes of it into BUF.  Return the number of bytes placed into BUF if
    successful, otherwise -1 and errno set.
-   See the POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/readlink.html>.  */
+   See the POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html>.  */
 # if @REPLACE_READLINK@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define readlink rpl_readlink
@@ -1178,11 +1305,38 @@ _GL_WARN_ON_USE (rmdir, "rmdir is unportable - "
 #endif
 
 
+#if @GNULIB_SETHOSTNAME@
+/* Set the host name of the machine.
+   The host name may or may not be fully qualified.
+
+   Put LEN bytes of NAME into the host name.
+   Return 0 if successful, otherwise, set errno and return -1.
+
+   Platforms with no ability to set the hostname return -1 and set
+   errno = ENOSYS.  */
+# if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@
+_GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len)
+                                    _GL_ARG_NONNULL ((1)));
+# endif
+/* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5
+   and FreeBSD 6.4 the second parameter is int.  On Solaris 11
+   2011-10, the first parameter is not const.  */
+_GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len));
+_GL_CXXALIASWARN (sethostname);
+#elif defined GNULIB_POSIXCHECK
+# undef sethostname
+# if HAVE_RAW_DECL_SETHOSTNAME
+_GL_WARN_ON_USE (sethostname, "sethostname is unportable - "
+                 "use gnulib module sethostname for portability");
+# endif
+#endif
+
+
 #if @GNULIB_SLEEP@
 /* Pause the execution of the current thread for N seconds.
    Returns the number of seconds left to sleep.
-   See the POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/sleep.html>.  */
+   See the POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/sleep.html>.  */
 # if @REPLACE_SLEEP@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef sleep
@@ -1331,7 +1485,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/sleep.html>.  */
+   <http://www.opengroup.org/susv3xsh/usleep.html>.  */
 # if @REPLACE_USLEEP@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef usleep
@@ -1357,9 +1511,9 @@ _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:2001 specification
-   <http://www.opengroup.org/susv3xsh/write.html>.  */
-# if @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@
+   See the POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html>.  */
+# if @REPLACE_WRITE@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef write
 #   define write rpl_write
@@ -1377,5 +1531,5 @@ _GL_CXXALIASWARN (write);
 #endif
 
 
-#endif /* _GL_UNISTD_H */
-#endif /* _GL_UNISTD_H */
+#endif /* _@GUARD_PREFIX@_UNISTD_H */
+#endif /* _@GUARD_PREFIX@_UNISTD_H */
index 6d426a9..d875f7a 100644 (file)
@@ -1,5 +1,5 @@
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 1999, 2002-2011 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -12,8 +12,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License along
-   with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* This file can be parametrized with the following macros:
      VASNPRINTF         The name of the function being defined.
@@ -276,7 +275,7 @@ 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 MacOS X systems, but is not required
+     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__))
@@ -553,32 +552,61 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
       size_t s;
       {
         mp_limb_t msd = b_ptr[b_len - 1]; /* = b[n-1], > 0 */
-        s = 31;
-        if (msd >= 0x10000)
-          {
-            msd = msd >> 16;
-            s -= 16;
-          }
-        if (msd >= 0x100)
-          {
-            msd = msd >> 8;
-            s -= 8;
-          }
-        if (msd >= 0x10)
-          {
-            msd = msd >> 4;
-            s -= 4;
-          }
-        if (msd >= 0x4)
+        /* Determine s = GMP_LIMB_BITS - integer_length (msd).
+           Code copied from gnulib's integer_length.c.  */
+# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+        s = __builtin_clz (msd);
+# else
+#  if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT
+        if (GMP_LIMB_BITS <= DBL_MANT_BIT)
           {
-            msd = msd >> 2;
-            s -= 2;
+            /* Use 'double' operations.
+               Assumes an IEEE 754 'double' implementation.  */
+#   define DBL_EXP_MASK ((DBL_MAX_EXP - DBL_MIN_EXP) | 7)
+#   define DBL_EXP_BIAS (DBL_EXP_MASK / 2 - 1)
+#   define NWORDS \
+     ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+            union { double value; unsigned int word[NWORDS]; } m;
+
+            /* Use a single integer to floating-point conversion.  */
+            m.value = msd;
+
+            s = GMP_LIMB_BITS
+                - (((m.word[DBL_EXPBIT0_WORD] >> DBL_EXPBIT0_BIT) & DBL_EXP_MASK)
+                   - DBL_EXP_BIAS);
           }
-        if (msd >= 0x2)
+        else
+#   undef NWORDS
+#  endif
           {
-            msd = msd >> 1;
-            s -= 1;
+            s = 31;
+            if (msd >= 0x10000)
+              {
+                msd = msd >> 16;
+                s -= 16;
+              }
+            if (msd >= 0x100)
+              {
+                msd = msd >> 8;
+                s -= 8;
+              }
+            if (msd >= 0x10)
+              {
+                msd = msd >> 4;
+                s -= 4;
+              }
+            if (msd >= 0x4)
+              {
+                msd = msd >> 2;
+                s -= 2;
+              }
+            if (msd >= 0x2)
+              {
+                msd = msd >> 1;
+                s -= 1;
+              }
           }
+# endif
       }
       /* 0 <= s < GMP_LIMB_BITS.
          Copy b, shifting it left by s bits.  */
@@ -885,9 +913,9 @@ decode_long_double (long double x, int *ep, mpn_t *mp)
   y = frexpl (x, &exp);
   if (!(y >= 0.0L && y < 1.0L))
     abort ();
-  /* x = 2^exp * y = 2^(exp - LDBL_MANT_BIT) * (y * LDBL_MANT_BIT), and the
+  /* x = 2^exp * y = 2^(exp - LDBL_MANT_BIT) * (y * 2^LDBL_MANT_BIT), and the
      latter is an integer.  */
-  /* Convert the mantissa (y * LDBL_MANT_BIT) to a sequence of limbs.
+  /* Convert the mantissa (y * 2^LDBL_MANT_BIT) to a sequence of limbs.
      I'm not sure whether it's safe to cast a 'long double' value between
      2^31 and 2^32 to 'unsigned int', therefore play safe and cast only
      'long double' values between 0 and 2^16 (to 'unsigned int' or 'int',
@@ -973,9 +1001,9 @@ decode_double (double x, int *ep, mpn_t *mp)
   y = frexp (x, &exp);
   if (!(y >= 0.0 && y < 1.0))
     abort ();
-  /* x = 2^exp * y = 2^(exp - DBL_MANT_BIT) * (y * DBL_MANT_BIT), and the
+  /* x = 2^exp * y = 2^(exp - DBL_MANT_BIT) * (y * 2^DBL_MANT_BIT), and the
      latter is an integer.  */
-  /* Convert the mantissa (y * DBL_MANT_BIT) to a sequence of limbs.
+  /* Convert the mantissa (y * 2^DBL_MANT_BIT) to a sequence of limbs.
      I'm not sure whether it's safe to cast a 'double' value between
      2^31 and 2^32 to 'unsigned int', therefore play safe and cast only
      'double' values between 0 and 2^16 (to 'unsigned int' or 'int',
@@ -2785,7 +2813,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                   if (has_width)
                     {
 #  if ENABLE_UNISTDIO
-                      /* Outside POSIX, it's preferrable to compare the width
+                      /* Outside POSIX, it's preferable to compare the width
                          against the number of _characters_ of the converted
                          value.  */
                       w = DCHAR_MBSNLEN (result + length, characters);
@@ -4856,7 +4884,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                    in format strings in writable memory may crash the program
                    (if compiled with _FORTIFY_SOURCE=2), so we should avoid it
                    in this situation.  */
-                /* On native Win32 systems (such as mingw), we can avoid using
+                /* On native Windows systems (such as mingw), we can avoid using
                    %n because:
                      - Although the gl_SNPRINTF_TRUNCATION_C99 test fails,
                        snprintf does not write more than the specified number
@@ -4865,7 +4893,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                      - Although the gl_SNPRINTF_RETVAL_C99 test fails, snprintf
                        allows us to recognize the case of an insufficient
                        buffer size: it returns -1 in this case.
-                   On native Win32 systems (such as mingw) where the OS is
+                   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
@@ -5388,7 +5416,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                       {
                         size_t w;
 # if ENABLE_UNISTDIO
-                        /* Outside POSIX, it's preferrable to compare the width
+                        /* Outside POSIX, it's preferable to compare the width
                            against the number of _characters_ of the converted
                            value.  */
                         w = DCHAR_MBSNLEN (result + length, count);
index 740f7e9..f6cb1e4 100644 (file)
@@ -1,5 +1,5 @@
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 2002-2004, 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2002-2004, 2007-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -12,8 +12,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License along
-   with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _VASNPRINTF_H
 #define _VASNPRINTF_H
index 86d0328..0ac17a6 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006-2011 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -12,8 +12,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License along
-   with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index d51ba68..f87a08c 100644 (file)
@@ -1,6 +1,6 @@
 /* Compile-time assert-like macros.
 
-   Copyright (C) 2005-2006, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
 
 /* Written by Paul Eggert, Bruno Haible, and Jim Meyering.  */
 
-#ifndef VERIFY_H
-# define VERIFY_H 1
+#ifndef _GL_VERIFY_H
+# 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 works as per C++11.
+   This will likely be supported by future GCC versions, in C++ mode.
+
+   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__ || (__GNUC__ == 4 && 6 <= __GNUC_MINOR__)) && !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
+# 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
-   integer constant expression contexts.  verify (R) is for declaration
-   contexts, e.g., the top level.
-
-   Symbols ending in "__" are private to this header.
+   If _Static_assert works, verify (R) uses it directly.  Similarly,
+   _GL_VERIFY_TRUE works by packaging a _Static_assert inside a struct
+   that is an operand of sizeof.
 
-   The code below uses several ideas.
+   The code below uses several ideas for C++ compilers, and for C
+   compilers that do not support _Static_assert:
 
    * The first step is ((R) ? 1 : -1).  Given an expression R, of
      integral or boolean or floating-point type, this yields an
@@ -39,7 +57,9 @@
      constant and nonnegative.
 
    * Next this expression W is wrapped in a type
-     struct verify_type__ { unsigned int verify_error_if_negative_size__: W; }.
+     struct _gl_verify_type {
+       unsigned int _gl_verify_error_if_negative: W;
+     }.
      If W is negative, this yields a compile-time error.  No compiler can
      deal with a bit-field of negative size.
 
@@ -53,7 +73,7 @@
 
        void function (int n) { verify (n < 0); }
 
-   * For the verify macro, the struct verify_type__ will need to
+   * For the verify macro, the struct _gl_verify_type will need to
      somehow be embedded into a declaration.  To be portable, this
      declaration must declare an object, a constant, a function, or a
      typedef name.  If the declared entity uses the type directly,
      Which of the following alternatives can be used?
 
        extern int dummy [sizeof (struct {...})];
-       extern int dummy [sizeof (struct verify_type__ {...})];
+       extern int dummy [sizeof (struct _gl_verify_type {...})];
        extern void dummy (int [sizeof (struct {...})]);
-       extern void dummy (int [sizeof (struct verify_type__ {...})]);
+       extern void dummy (int [sizeof (struct _gl_verify_type {...})]);
        extern int (*dummy (void)) [sizeof (struct {...})];
-       extern int (*dummy (void)) [sizeof (struct verify_type__ {...})];
+       extern int (*dummy (void)) [sizeof (struct _gl_verify_type {...})];
 
      In the second and sixth case, the struct type is exported to the
      outer scope; two such declarations therefore collide.  GCC warns
      __COUNTER__ macro that can let us generate unique identifiers for
      each dummy function, to suppress this warning.
 
-   * This implementation exploits the fact that GCC does not warn about
-     the last declaration mentioned above.  If a future version of GCC
-     introduces a warning for this, the problem could be worked around
-     by using code specialized to GCC, just as __COUNTER__ is already
-     being used if available.
-
-       #if 4 <= __GNUC__
-       # define verify(R) [another version to keep GCC happy]
-       #endif
+   * This implementation exploits the fact that older versions of GCC,
+     which do not support _Static_assert, also do not warn about the
+     last declaration mentioned above.
 
    * In C++, any struct definition inside sizeof is invalid.
      Use a template type to work around the problem.  */
    possible.  */
 # define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER)
 
-/* Verify requirement R at compile-time, as an integer constant expression.
-   Return 1.  */
+/* Verify requirement R at compile-time, as an integer constant expression
+   that returns 1.  If R is false, fail at compile-time, preferably
+   with a diagnostic that includes the string-literal DIAGNOSTIC.  */
+
+# define _GL_VERIFY_TRUE(R, DIAGNOSTIC) \
+    (!!sizeof (_GL_VERIFY_TYPE (R, DIAGNOSTIC)))
 
 # ifdef __cplusplus
+#  if !GNULIB_defined_struct__gl_verify_type
 template <int w>
-  struct verify_type__ { unsigned int verify_error_if_negative_size__: w; };
-#  define verify_true(R) \
-     (!!sizeof (verify_type__<(R) ? 1 : -1>))
+  struct _gl_verify_type {
+    unsigned int _gl_verify_error_if_negative: w;
+  };
+#   define GNULIB_defined_struct__gl_verify_type 1
+#  endif
+#  define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
+    _gl_verify_type<(R) ? 1 : -1>
+# elif defined _GL_HAVE__STATIC_ASSERT
+#  define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
+     struct {                                   \
+       _Static_assert (R, DIAGNOSTIC);          \
+       int _gl_dummy;                          \
+     }
 # else
-#  define verify_true(R) \
-     (!!sizeof \
-      (struct { unsigned int verify_error_if_negative_size__: (R) ? 1 : -1; }))
+#  define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
+     struct { unsigned int _gl_verify_error_if_negative: (R) ? 1 : -1; }
 # 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.
+
+   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
+# else
+#  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)
+#  endif
+#  if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert
+#   define static_assert _Static_assert /* C11 requires this #define.  */
+#  endif
+# endif
+
+/* @assert.h omit start@  */
+
+/* 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
+   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.  */
+
+# define verify_expr(R, E) \
+    (_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) \
-    extern int (* _GL_GENSYM (verify_function) (void)) [verify_true (R)]
+# define verify(R) _GL_VERIFY (R, "verify (" #R ")")
+
+/* @assert.h omit end@  */
 
 #endif
index 5bc137c..fa37325 100644 (file)
@@ -1,6 +1,6 @@
 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
 
-   Copyright (C) 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -13,8 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake.  */
 
@@ -49,7 +48,7 @@
 #else
 /* Normal invocation convention.  */
 
-#ifndef _GL_WCHAR_H
+#ifndef _@GUARD_PREFIX@_WCHAR_H
 
 #define _GL_ALREADY_INCLUDING_WCHAR_H
 
    <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
+   by <stddef.h>.
    But avoid namespace pollution on glibc systems.  */
-#ifndef __GLIBC__
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
 # include <stddef.h>
+#endif
+#ifndef __GLIBC__
 # include <stdio.h>
 # include <time.h>
 #endif
 
 #undef _GL_ALREADY_INCLUDING_WCHAR_H
 
-#ifndef _GL_WCHAR_H
-#define _GL_WCHAR_H
+#ifndef _@GUARD_PREFIX@_WCHAR_H
+#define _@GUARD_PREFIX@_WCHAR_H
+
+/* 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 */
+#endif
 
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 #  define WEOF -1
 # endif
 #else
+/* MSVC defines 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 defined _MSC_VER
+#  if !GNULIB_defined_wint_t
+#   include <crtdefs.h>
+typedef unsigned int rpl_wint_t;
+#   undef wint_t
+#   define wint_t rpl_wint_t
+#   define GNULIB_defined_wint_t 1
+#  endif
+# endif
 # ifndef WEOF
 #  define WEOF ((wint_t) -1)
 # endif
@@ -120,11 +143,11 @@ typedef int rpl_mbstate_t;
 #   undef btowc
 #   define btowc rpl_btowc
 #  endif
-_GL_FUNCDECL_RPL (btowc, wint_t, (int c));
+_GL_FUNCDECL_RPL (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
 _GL_CXXALIAS_RPL (btowc, wint_t, (int c));
 # else
 #  if !@HAVE_BTOWC@
-_GL_FUNCDECL_SYS (btowc, wint_t, (int c));
+_GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
 #  endif
 _GL_CXXALIAS_SYS (btowc, wint_t, (int c));
 # endif
@@ -145,12 +168,12 @@ _GL_WARN_ON_USE (btowc, "btowc is unportable - "
 #   undef wctob
 #   define wctob rpl_wctob
 #  endif
-_GL_FUNCDECL_RPL (wctob, int, (wint_t wc));
+_GL_FUNCDECL_RPL (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
 _GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
 # else
 #  if !defined wctob && !@HAVE_DECL_WCTOB@
 /* wctob is provided by gnulib, or wctob exists but is not declared.  */
-_GL_FUNCDECL_SYS (wctob, int, (wint_t wc));
+_GL_FUNCDECL_SYS (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
 #  endif
 _GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
 # endif
@@ -411,12 +434,12 @@ _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
 #   undef wcwidth
 #   define wcwidth rpl_wcwidth
 #  endif
-_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t));
+_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
 _GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
 # else
 #  if !@HAVE_DECL_WCWIDTH@
 /* wcwidth exists but is not declared.  */
-_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t));
+_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
 #  endif
 _GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
 # endif
@@ -433,10 +456,25 @@ _GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
 /* Search N wide characters of S for C.  */
 #if @GNULIB_WMEMCHR@
 # if !@HAVE_WMEMCHR@
-_GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n));
-# endif
-_GL_CXXALIAS_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n));
+_GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n)
+                                      _GL_ATTRIBUTE_PURE);
+# endif
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C++" {
+         const wchar_t * std::wmemchr (const wchar_t *, wchar_t, size_t);
+         wchar_t * std::wmemchr (wchar_t *, wchar_t, size_t);
+       }  */
+_GL_CXXALIAS_SYS_CAST2 (wmemchr,
+                        wchar_t *, (const wchar_t *, wchar_t, size_t),
+                        const wchar_t *, (const wchar_t *, wchar_t, size_t));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_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
 _GL_CXXALIASWARN (wmemchr);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wmemchr
 # if HAVE_RAW_DECL_WMEMCHR
@@ -450,7 +488,8 @@ _GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
 #if @GNULIB_WMEMCMP@
 # if !@HAVE_WMEMCMP@
 _GL_FUNCDECL_SYS (wmemcmp, int,
-                  (const wchar_t *s1, const wchar_t *s2, size_t n));
+                  (const wchar_t *s1, const wchar_t *s2, size_t n)
+                  _GL_ATTRIBUTE_PURE);
 # endif
 _GL_CXXALIAS_SYS (wmemcmp, int,
                   (const wchar_t *s1, const wchar_t *s2, size_t n));
@@ -520,7 +559,7 @@ _GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
 /* Return the number of wide characters in S.  */
 #if @GNULIB_WCSLEN@
 # if !@HAVE_WCSLEN@
-_GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s));
+_GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE);
 # endif
 _GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
 _GL_CXXALIASWARN (wcslen);
@@ -536,7 +575,8 @@ _GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
 /* Return the number of wide characters in S, but at most MAXLEN.  */
 #if @GNULIB_WCSNLEN@
 # if !@HAVE_WCSNLEN@
-_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
+_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)
+                                   _GL_ATTRIBUTE_PURE);
 # endif
 _GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
 _GL_CXXALIASWARN (wcsnlen);
@@ -655,7 +695,8 @@ _GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
 /* Compare S1 and S2.  */
 #if @GNULIB_WCSCMP@
 # if !@HAVE_WCSCMP@
-_GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
+_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));
 _GL_CXXALIASWARN (wcscmp);
@@ -672,7 +713,8 @@ _GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
 #if @GNULIB_WCSNCMP@
 # if !@HAVE_WCSNCMP@
 _GL_FUNCDECL_SYS (wcsncmp, int,
-                  (const wchar_t *s1, const wchar_t *s2, size_t n));
+                  (const wchar_t *s1, const wchar_t *s2, size_t n)
+                  _GL_ATTRIBUTE_PURE);
 # endif
 _GL_CXXALIAS_SYS (wcsncmp, int,
                   (const wchar_t *s1, const wchar_t *s2, size_t n));
@@ -689,7 +731,8 @@ _GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
 /* Compare S1 and S2, ignoring case.  */
 #if @GNULIB_WCSCASECMP@
 # if !@HAVE_WCSCASECMP@
-_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
+_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)
+                                   _GL_ATTRIBUTE_PURE);
 # endif
 _GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
 _GL_CXXALIASWARN (wcscasecmp);
@@ -706,7 +749,8 @@ _GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
 #if @GNULIB_WCSNCASECMP@
 # if !@HAVE_WCSNCASECMP@
 _GL_FUNCDECL_SYS (wcsncasecmp, int,
-                  (const wchar_t *s1, const wchar_t *s2, size_t n));
+                  (const wchar_t *s1, const wchar_t *s2, size_t n)
+                  _GL_ATTRIBUTE_PURE);
 # endif
 _GL_CXXALIAS_SYS (wcsncasecmp, int,
                   (const wchar_t *s1, const wchar_t *s2, size_t n));
@@ -774,10 +818,24 @@ _GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
 /* Find the first occurrence of WC in WCS.  */
 #if @GNULIB_WCSCHR@
 # if !@HAVE_WCSCHR@
-_GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc));
-# endif
-_GL_CXXALIAS_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc));
+_GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
+                                     _GL_ATTRIBUTE_PURE);
+# endif
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C++" {
+         const wchar_t * std::wcschr (const wchar_t *, wchar_t);
+         wchar_t * std::wcschr (wchar_t *, wchar_t);
+       }  */
+_GL_CXXALIAS_SYS_CAST2 (wcschr,
+                        wchar_t *, (const wchar_t *, wchar_t),
+                        const wchar_t *, (const wchar_t *, wchar_t));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+     && (__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
 _GL_CXXALIASWARN (wcschr);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcschr
 # if HAVE_RAW_DECL_WCSCHR
@@ -790,10 +848,24 @@ _GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
 /* Find the last occurrence of WC in WCS.  */
 #if @GNULIB_WCSRCHR@
 # if !@HAVE_WCSRCHR@
-_GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc));
-# endif
-_GL_CXXALIAS_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc));
+_GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
+                                      _GL_ATTRIBUTE_PURE);
+# endif
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C++" {
+         const wchar_t * std::wcsrchr (const wchar_t *, wchar_t);
+         wchar_t * std::wcsrchr (wchar_t *, wchar_t);
+       }  */
+_GL_CXXALIAS_SYS_CAST2 (wcsrchr,
+                        wchar_t *, (const wchar_t *, wchar_t),
+                        const wchar_t *, (const wchar_t *, wchar_t));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+     && (__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
 _GL_CXXALIASWARN (wcsrchr);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcsrchr
 # if HAVE_RAW_DECL_WCSRCHR
@@ -807,7 +879,8 @@ _GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
    of wide characters not in REJECT.  */
 #if @GNULIB_WCSCSPN@
 # if !@HAVE_WCSCSPN@
-_GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
+_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));
 _GL_CXXALIASWARN (wcscspn);
@@ -824,7 +897,8 @@ _GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
    of wide characters in ACCEPT.  */
 #if @GNULIB_WCSSPN@
 # if !@HAVE_WCSSPN@
-_GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
+_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));
 _GL_CXXALIASWARN (wcsspn);
@@ -841,11 +915,26 @@ _GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
 #if @GNULIB_WCSPBRK@
 # if !@HAVE_WCSPBRK@
 _GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
-                  (const wchar_t *wcs, const wchar_t *accept));
-# endif
-_GL_CXXALIAS_SYS (wcspbrk, wchar_t *,
-                  (const wchar_t *wcs, const wchar_t *accept));
+                  (const wchar_t *wcs, const wchar_t *accept)
+                  _GL_ATTRIBUTE_PURE);
+# endif
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C++" {
+         const wchar_t * std::wcspbrk (const wchar_t *, const wchar_t *);
+         wchar_t * std::wcspbrk (wchar_t *, const wchar_t *);
+       }  */
+_GL_CXXALIAS_SYS_CAST2 (wcspbrk,
+                        wchar_t *, (const wchar_t *, const wchar_t *),
+                        const wchar_t *, (const wchar_t *, const wchar_t *));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_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
 _GL_CXXALIASWARN (wcspbrk);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcspbrk
 # if HAVE_RAW_DECL_WCSPBRK
@@ -859,11 +948,26 @@ _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));
-# endif
-_GL_CXXALIAS_SYS (wcsstr, wchar_t *,
-                  (const wchar_t *haystack, const wchar_t *needle));
+                  (const wchar_t *haystack, const wchar_t *needle)
+                  _GL_ATTRIBUTE_PURE);
+# endif
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C++" {
+         const wchar_t * std::wcsstr (const wchar_t *, const 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 *));
+# 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));
+_GL_CXXALIASWARN1 (wcsstr, const wchar_t *,
+                   (const wchar_t *haystack, const wchar_t *needle));
+# else
 _GL_CXXALIASWARN (wcsstr);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcsstr
 # if HAVE_RAW_DECL_WCSSTR
@@ -899,11 +1003,13 @@ _GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
 #   undef wcswidth
 #   define wcswidth rpl_wcswidth
 #  endif
-_GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n));
+_GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n)
+                                 _GL_ATTRIBUTE_PURE);
 _GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n));
 # else
 #  if !@HAVE_WCSWIDTH@
-_GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n));
+_GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n)
+                                 _GL_ATTRIBUTE_PURE);
 #  endif
 _GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
 # endif
@@ -917,6 +1023,6 @@ _GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
 #endif
 
 
-#endif /* _GL_WCHAR_H */
-#endif /* _GL_WCHAR_H */
+#endif /* _@GUARD_PREFIX@_WCHAR_H */
+#endif /* _@GUARD_PREFIX@_WCHAR_H */
 #endif
index 00e7b85..f15b545 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert wide character to multibyte character.
-   Copyright (C) 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
index 18a5dd7..373adc5 100644 (file)
@@ -1,6 +1,6 @@
 /* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
 
-   Copyright (C) 2006-2011 Free Software Foundation, Inc.
+   Copyright (C) 2006-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -13,8 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible and Paul Eggert.  */
 
@@ -26,7 +25,7 @@
  * wctrans_t, and wctype_t are not yet implemented.
  */
 
-#ifndef _GL_WCTYPE_H
+#ifndef _@GUARD_PREFIX@_WCTYPE_H
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 # @INCLUDE_NEXT@ @NEXT_WCTYPE_H@
 #endif
 
-#ifndef _GL_WCTYPE_H
-#define _GL_WCTYPE_H
+#ifndef _@GUARD_PREFIX@_WCTYPE_H
+#define _@GUARD_PREFIX@_WCTYPE_H
 
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
+/* Solaris 2.6 <wctype.h> includes <widec.h> which includes <euc.h> which
+   #defines a number of identifiers in the application namespace.  Revert
+   these #defines.  */
+#ifdef __sun
+# undef multibyte
+# undef eucw1
+# undef eucw2
+# undef eucw3
+# undef scrw1
+# undef scrw2
+# undef scrw3
+#endif
+
 /* Define wint_t and WEOF.  (Also done in wchar.in.h.)  */
 #if !@HAVE_WINT_T@ && !defined wint_t
 # define wint_t int
 #  define WEOF -1
 # endif
 #else
+/* MSVC defines 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 defined _MSC_VER
+#  if !GNULIB_defined_wint_t
+#   include <crtdefs.h>
+typedef unsigned int rpl_wint_t;
+#   undef wint_t
+#   define wint_t rpl_wint_t
+#   define GNULIB_defined_wint_t 1
+#  endif
+# endif
 # ifndef WEOF
 #  define WEOF ((wint_t) -1)
 # endif
 #    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
@@ -258,7 +286,7 @@ iswxdigit
 }
 
 static inline wint_t
-#  if @REPLACE_ISWCNTRL@
+#  if @REPLACE_TOWLOWER@
 rpl_towlower
 #  else
 towlower
@@ -269,7 +297,7 @@ towlower
 }
 
 static inline wint_t
-#  if @REPLACE_ISWCNTRL@
+#  if @REPLACE_TOWLOWER@
 rpl_towupper
 #  else
 towupper
@@ -416,7 +444,7 @@ _GL_WARN_ON_USE (iswctype, "iswctype is unportable - "
 # endif
 #endif
 
-#if @REPLACE_ISWCNTRL@ || defined __MINGW32__
+#if @REPLACE_TOWLOWER@ || defined __MINGW32__
 _GL_CXXALIAS_RPL (towlower, wint_t, (wint_t wc));
 _GL_CXXALIAS_RPL (towupper, wint_t, (wint_t wc));
 #else
@@ -466,5 +494,5 @@ _GL_WARN_ON_USE (towctrans, "towctrans is unportable - "
 #endif
 
 
-#endif /* _GL_WCTYPE_H */
-#endif /* _GL_WCTYPE_H */
+#endif /* _@GUARD_PREFIX@_WCTYPE_H */
+#endif /* _@GUARD_PREFIX@_WCTYPE_H */
index 5816dcf..92985ae 100644 (file)
@@ -1,6 +1,6 @@
 /* xsize.h -- Checked size_t computations.
 
-   Copyright (C) 2003, 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2008-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -13,8 +13,7 @@
    GNU Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _XSIZE_H
 #define _XSIZE_H
index 7feed46..d978cb8 100644 (file)
@@ -1,5 +1,5 @@
 # 00gnulib.m4 serial 2
-dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2012 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 e2e8a05..656924b 100644 (file)
@@ -1,5 +1,5 @@
-# alloca.m4 serial 10
-dnl Copyright (C) 2002-2004, 2006-2007, 2009-2011 Free Software Foundation,
+# alloca.m4 serial 14
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2012 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,
@@ -36,8 +36,86 @@ AC_DEFUN([gl_FUNC_ALLOCA],
     ALLOCA_H=alloca.h
   fi
   AC_SUBST([ALLOCA_H])
+  AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$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.69], [] ,[
+
+# This is taken from the following Autoconf patch:
+# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497
+
+# _AC_LIBOBJ_ALLOCA
+# -----------------
+# Set up the LIBOBJ replacement of 'alloca'.  Well, not exactly
+# AC_LIBOBJ since we actually set the output variable 'ALLOCA'.
+# Nevertheless, for Automake, AC_LIBSOURCES it.
+m4_define([_AC_LIBOBJ_ALLOCA],
+[# The SVR3 libPW and SVR4 libucb both contain incompatible functions
+# that cause trouble.  Some versions do not even contain alloca or
+# contain a buggy version.  If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
+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(
+[AC_INCLUDES_DEFAULT
+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)
+{
+  return find_stack_direction (0, argc + !argv + 20) < 0;
+}])],
+               [ac_cv_c_stack_direction=1],
+               [ac_cv_c_stack_direction=-1],
+               [ac_cv_c_stack_direction=0])])
+AH_VERBATIM([STACK_DIRECTION],
+[/* 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 */
+@%:@undef STACK_DIRECTION])dnl
+AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
+])# _AC_LIBOBJ_ALLOCA
+])
index f4fa3a0..38f1e61 100644 (file)
@@ -1,13 +1,13 @@
 # Portability macros for glibc argz.                    -*- Autoconf -*-
 #
-#   Copyright (C) 2004-2011 Free Software Foundation, Inc.
+#   Copyright (C) 2004-2012 Free Software Foundation, Inc.
 #   Written by Gary V. Vaughan <gary@gnu.org>
 #
 # 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 8 argz.m4
+# serial 11 argz.m4
 
 AC_DEFUN([gl_FUNC_ARGZ],
 [gl_PREREQ_ARGZ
@@ -19,7 +19,7 @@ AC_CHECK_HEADERS([argz.h], [], [], [AC_INCLUDES_DEFAULT])
 AC_CHECK_TYPES([error_t],
   [],
   [AC_DEFINE([error_t], [int],
-   [Define to a type to use for `error_t' if it is not otherwise available.])
+   [Define to a type to use for 'error_t' if it is not otherwise available.])
    AC_DEFINE([__error_t_defined], [1], [Define so that glibc/gnulib argp.h
     does not typedef error_t.])],
   [#if defined(HAVE_ARGZ_H)
@@ -27,7 +27,7 @@ AC_CHECK_TYPES([error_t],
 #endif])
 
 ARGZ_H=
-AC_CHECK_FUNC([argz_replace], [], [ARGZ_H=argz.h; AC_LIBOBJ([argz])])
+AC_CHECK_FUNC([argz_replace], [], [ARGZ_H=argz.h])
 
 dnl if have system argz functions, allow forced use of
 dnl libltdl-supplied implementation (and default to do so
@@ -70,10 +70,10 @@ AS_IF([test -z "$ARGZ_H"],
      AS_IF([test "$lt_cv_sys_argz_works" = yes],
         [AC_DEFINE([HAVE_WORKING_ARGZ], [1],
                    [This value is set to 1 to indicate that the system argz facility works])],
-        [ARGZ_H=argz.h
-        AC_LIBOBJ([argz])])])
+        [ARGZ_H=argz.h])])
 
 AC_SUBST([ARGZ_H])
+AM_CONDITIONAL([GL_GENERATE_ARGZ_H], [test -n "$ARGZ_H"])
 ])
 
 # Prerequisites of lib/argz.c.
index 603298f..e565321 100644 (file)
@@ -1,5 +1,5 @@
-# btowc.m4 serial 8
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# btowc.m4 serial 10
+dnl Copyright (C) 2008-2012 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.
@@ -108,11 +108,6 @@ int main ()
       *) REPLACE_BTOWC=1 ;;
     esac
   fi
-  if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
-    gl_REPLACE_WCHAR_H
-    AC_LIBOBJ([btowc])
-    gl_PREREQ_BTOWC
-  fi
 ])
 
 # Prerequisites of lib/btowc.c.
index dcc6039..ea51ac4 100644 (file)
@@ -1,6 +1,6 @@
-# canonicalize.m4 serial 17
+# canonicalize.m4 serial 26
 
-dnl Copyright (C) 2003-2007, 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2007, 2009-2012 Free Software Foundation, Inc.
 
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -10,40 +10,49 @@ dnl with or without modifications, as long as this notice is preserved.
 # not provide or fix realpath.
 AC_DEFUN([gl_FUNC_CANONICALIZE_FILENAME_MODE],
 [
-  AC_LIBOBJ([canonicalize])
-
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
   AC_CHECK_FUNCS_ONCE([canonicalize_file_name])
   AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
   AC_REQUIRE([gl_FUNC_REALPATH_WORKS])
   if test $ac_cv_func_canonicalize_file_name = no; then
     HAVE_CANONICALIZE_FILE_NAME=0
-  elif test "$gl_cv_func_realpath_works" != yes; then
-    REPLACE_CANONICALIZE_FILE_NAME=1
+  else
+    case "$gl_cv_func_realpath_works" in
+      *yes) ;;
+      *)    REPLACE_CANONICALIZE_FILE_NAME=1 ;;
+    esac
   fi
 ])
 
 # Provides canonicalize_file_name and realpath.
 AC_DEFUN([gl_CANONICALIZE_LGPL],
 [
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
   AC_REQUIRE([gl_CANONICALIZE_LGPL_SEPARATE])
   if test $ac_cv_func_canonicalize_file_name = no; then
     HAVE_CANONICALIZE_FILE_NAME=0
-    AC_LIBOBJ([canonicalize-lgpl])
     if test $ac_cv_func_realpath = no; then
       HAVE_REALPATH=0
-    elif test "$gl_cv_func_realpath_works" != yes; then
-      REPLACE_REALPATH=1
+    else
+      case "$gl_cv_func_realpath_works" in
+       *yes) ;;
+       *)    REPLACE_REALPATH=1 ;;
+      esac
     fi
-  elif test "$gl_cv_func_realpath_works" != yes; then
-    AC_LIBOBJ([canonicalize-lgpl])
-    REPLACE_REALPATH=1
-    REPLACE_CANONICALIZE_FILE_NAME=1
+  else
+    case "$gl_cv_func_realpath_works" in
+      *yes)
+        ;;
+      *)
+        REPLACE_CANONICALIZE_FILE_NAME=1
+        REPLACE_REALPATH=1
+        ;;
+    esac
   fi
 ])
 
 # Like gl_CANONICALIZE_LGPL, except prepare for separate compilation
-# (no AC_LIBOBJ).
+# (no REPLACE_CANONICALIZE_FILE_NAME, no REPLACE_REALPATH, no AC_LIBOBJ).
 AC_DEFUN([gl_CANONICALIZE_LGPL_SEPARATE],
 [
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
@@ -59,11 +68,15 @@ AC_DEFUN([gl_CANONICALIZE_LGPL_SEPARATE],
 AC_DEFUN([gl_FUNC_REALPATH_WORKS],
 [
   AC_CHECK_FUNCS_ONCE([realpath])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CACHE_CHECK([whether realpath works], [gl_cv_func_realpath_works], [
     touch conftest.a
+    mkdir conftest.d
     AC_RUN_IFELSE([
       AC_LANG_PROGRAM([[
+        ]GL_NOCRASH[
         #include <stdlib.h>
+        #include <string.h>
       ]], [[
         int result = 0;
         {
@@ -81,14 +94,31 @@ AC_DEFUN([gl_FUNC_REALPATH_WORKS],
           if (name != NULL)
             result |= 4;
         }
+        {
+          char *name1 = realpath (".", NULL);
+          char *name2 = realpath ("conftest.d//./..", NULL);
+          if (strcmp (name1, name2) != 0)
+            result |= 8;
+        }
         return result;
       ]])
-    ], [gl_cv_func_realpath_works=yes], [gl_cv_func_realpath_works=no],
-       [gl_cv_func_realpath_works="guessing no"])
+     ],
+     [gl_cv_func_realpath_works=yes],
+     [gl_cv_func_realpath_works=no],
+     [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" ;;
+      esac
+     ])
+    rm -rf conftest.a conftest.d
   ])
-  if test "$gl_cv_func_realpath_works" = yes; then
-    AC_DEFINE([FUNC_REALPATH_WORKS], [1], [Define to 1 if realpath()
-      can malloc memory, always gives an absolute path, and handles
-      trailing slash correctly.])
-  fi
+  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.])
+      ;;
+  esac
 ])
diff --git a/gnulib/m4/close.m4 b/gnulib/m4/close.m4
new file mode 100644 (file)
index 0000000..379e70d
--- /dev/null
@@ -0,0 +1,33 @@
+# close.m4 serial 8
+dnl Copyright (C) 2008-2012 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_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_PREREQ_SYS_H_WINSOCK2], [
+    gl_PREREQ_SYS_H_WINSOCK2
+    if test $UNISTD_H_HAVE_WINSOCK2_H = 1; 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 close() function. So enable the support for sockets.
+      REPLACE_CLOSE=1
+    fi
+  ])
+  dnl Replace close() for supporting the gnulib-defined fchdir() function,
+  dnl to keep fchdir's bookkeeping up-to-date.
+  m4_ifdef([gl_FUNC_FCHDIR], [
+    if test $REPLACE_CLOSE = 0; then
+      gl_TEST_FCHDIR
+      if test $HAVE_FCHDIR = 0; then
+        REPLACE_CLOSE=1
+      fi
+    fi
+  ])
+])
index da73552..cf53d24 100644 (file)
@@ -1,5 +1,5 @@
 # codeset.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2000-2002, 2006, 2008-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-2002, 2006, 2008-2012 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 a029823..8c82371 100644 (file)
@@ -1,5 +1,5 @@
 # configmake.m4 serial 1
-dnl Copyright (C) 2010-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2012 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 4a86ba9..c1a4f22 100644 (file)
@@ -1,5 +1,5 @@
 # ctype_h.m4 serial 6
-dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2012 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 16a4e3e..1e03751 100644 (file)
@@ -1,5 +1,5 @@
 # double-slash-root.m4 serial 4   -*- Autoconf -*-
-dnl Copyright (C) 2006, 2008-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2008-2012 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 def263b..fc86e80 100644 (file)
@@ -1,5 +1,5 @@
-#serial 12
-dnl Copyright (C) 2002, 2005, 2007, 2009-2011 Free Software Foundation, Inc.
+#serial 18
+dnl Copyright (C) 2002, 2005, 2007, 2009-2012 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,24 +8,28 @@ AC_DEFUN([gl_FUNC_DUP2],
 [
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
   AC_REQUIRE([AC_CANONICAL_HOST])
-  AC_CHECK_FUNCS_ONCE([dup2 fcntl])
-  if test $ac_cv_func_dup2 = no; then
-    HAVE_DUP2=0
-    AC_LIBOBJ([dup2])
-  else
+  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 <unistd.h>
 #include <fcntl.h>
 #include <errno.h>]],
            [int result = 0;
-#if HAVE_FCNTL
+#ifdef FD_CLOEXEC
             if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
               result |= 1;
-#endif HAVE_FCNTL
+#endif
             if (dup2 (1, 1) == 0)
               result |= 2;
-#if HAVE_FCNTL
+#ifdef FD_CLOEXEC
             if (fcntl (1, F_GETFD) != FD_CLOEXEC)
               result |= 4;
 #endif
@@ -41,30 +45,37 @@ AC_DEFUN([gl_FUNC_DUP2],
         [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=no;;
+             gl_cv_func_dup2_works="guessing no" ;;
            cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
-             gl_cv_func_dup2_works=no;;
+             gl_cv_func_dup2_works="guessing no" ;;
            linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a
                    # closed fd may yield -EBADF instead of -1 / errno=EBADF.
-             gl_cv_func_dup2_works=no;;
+             gl_cv_func_dup2_works="guessing no" ;;
            freebsd*) # on FreeBSD 6.1, dup2(1,1000000) gives EMFILE, not EBADF.
-             gl_cv_func_dup2_works=no;;
+             gl_cv_func_dup2_works="guessing no" ;;
            haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
-             gl_cv_func_dup2_works=no;;
-           *) gl_cv_func_dup2_works=yes;;
+             gl_cv_func_dup2_works="guessing no" ;;
+           *) gl_cv_func_dup2_works="guessing yes" ;;
          esac])
       ])
-    if test "$gl_cv_func_dup2_works" = no; then
-      gl_REPLACE_DUP2
-    fi
+    case "$gl_cv_func_dup2_works" in
+      *yes) ;;
+      *)
+        REPLACE_DUP2=1
+        ;;
+    esac
   fi
+  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
+    fi
+  ])
 ])
 
-AC_DEFUN([gl_REPLACE_DUP2],
-[
-  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  if test $ac_cv_func_dup2 = yes; then
-    REPLACE_DUP2=1
-  fi
-  AC_LIBOBJ([dup2])
-])
+# Prerequisites of lib/dup2.c.
+AC_DEFUN([gl_PREREQ_DUP2], [])
index 3006c48..75f17e2 100644 (file)
@@ -1,5 +1,5 @@
 # eealloc.m4 serial 2
-dnl Copyright (C) 2003, 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2009-2012 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 7457ad1..8eb57c9 100644 (file)
@@ -1,5 +1,5 @@
-# environ.m4 serial 5
-dnl Copyright (C) 2001-2004, 2006-2011 Free Software Foundation, Inc.
+# environ.m4 serial 6
+dnl Copyright (C) 2001-2004, 2006-2012 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,16 @@ AC_DEFUN_ONCE([gl_ENVIRON],
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
   dnl Persuade glibc <unistd.h> to declare environ.
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-  gt_CHECK_VAR_DECL([#include <unistd.h>], environ)
+
+  AC_CHECK_HEADERS_ONCE([unistd.h])
+  gt_CHECK_VAR_DECL(
+    [#if HAVE_UNISTD_H
+     #include <unistd.h>
+     #endif
+     /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>.  */
+     #include <stdlib.h>
+    ],
+    [environ])
   if test $gt_cv_var_environ_declaration != yes; then
     HAVE_DECL_ENVIRON=0
   fi
index 687baff..1e76ba2 100644 (file)
@@ -1,5 +1,5 @@
-# errno_h.m4 serial 8
-dnl Copyright (C) 2004, 2006, 2008-2011 Free Software Foundation, Inc.
+# errno_h.m4 serial 11
+dnl Copyright (C) 2004, 2006, 2008-2012 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,6 +10,9 @@ AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
   AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [
     AC_EGREP_CPP([booboo],[
 #include <errno.h>
+#if !defined ETXTBSY
+booboo
+#endif
 #if !defined ENOMSG
 booboo
 #endif
@@ -34,6 +37,12 @@ booboo
 #if !defined ENOTSUP
 booboo
 #endif
+#if !defined ENETRESET
+booboo
+#endif
+#if !defined ECONNABORTED
+booboo
+#endif
 #if !defined ESTALE
 booboo
 #endif
@@ -43,6 +52,12 @@ booboo
 #if !defined ECANCELED
 booboo
 #endif
+#if !defined EOWNERDEAD
+booboo
+#endif
+#if !defined ENOTRECOVERABLE
+booboo
+#endif
       ],
       [gl_cv_header_errno_h_complete=no],
       [gl_cv_header_errno_h_complete=yes])
@@ -54,6 +69,7 @@ booboo
     ERRNO_H='errno.h'
   fi
   AC_SUBST([ERRNO_H])
+  AM_CONDITIONAL([GL_GENERATE_ERRNO_H], [test -n "$ERRNO_H"])
   gl_REPLACE_ERRNO_VALUE([EMULTIHOP])
   gl_REPLACE_ERRNO_VALUE([ENOLINK])
   gl_REPLACE_ERRNO_VALUE([EOVERFLOW])
diff --git a/gnulib/m4/exponentd.m4 b/gnulib/m4/exponentd.m4
new file mode 100644 (file)
index 0000000..0ae4ccf
--- /dev/null
@@ -0,0 +1,116 @@
+# exponentd.m4 serial 3
+dnl Copyright (C) 2007-2008, 2010-2012 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_DOUBLE_EXPONENT_LOCATION],
+[
+  AC_CACHE_CHECK([where to find the exponent in a 'double'],
+    [gl_cv_cc_double_expbit0],
+    [
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
+#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);
+}
+        ]])],
+        [gl_cv_cc_double_expbit0=`cat conftest.out`],
+        [gl_cv_cc_double_expbit0="unknown"],
+        [
+          dnl On ARM, there are two 'double' floating-point formats, used by
+          dnl different sets of instructions: The older FPA instructions assume
+          dnl that they are stored in big-endian word order, while the words
+          dnl (like integer types) are stored in little-endian byte order.
+          dnl The newer VFP instructions assume little-endian order
+          dnl consistently.
+          AC_EGREP_CPP([mixed_endianness], [
+#if defined arm || defined __arm || defined __arm__
+  mixed_endianness
+#endif
+            ],
+            [gl_cv_cc_double_expbit0="unknown"],
+            [
+              pushdef([AC_MSG_CHECKING],[:])dnl
+              pushdef([AC_MSG_RESULT],[:])dnl
+              pushdef([AC_MSG_RESULT_UNQUOTED],[:])dnl
+              AC_C_BIGENDIAN(
+                [gl_cv_cc_double_expbit0="word 0 bit 20"],
+                [gl_cv_cc_double_expbit0="word 1 bit 20"],
+                [gl_cv_cc_double_expbit0="unknown"])
+              popdef([AC_MSG_RESULT_UNQUOTED])dnl
+              popdef([AC_MSG_RESULT])dnl
+              popdef([AC_MSG_CHECKING])dnl
+            ])
+        ])
+      rm -f conftest.out
+    ])
+  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 //'`
+      AC_DEFINE_UNQUOTED([DBL_EXPBIT0_WORD], [$word],
+        [Define as the word index where to find the exponent of 'double'.])
+      AC_DEFINE_UNQUOTED([DBL_EXPBIT0_BIT], [$bit],
+        [Define as the bit index in the word where to find bit 0 of the exponent of 'double'.])
+      ;;
+  esac
+])
index 1330503..6d17d8a 100644 (file)
@@ -1,7 +1,7 @@
-# serial 9  -*- Autoconf -*-
+# serial 12  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
-# Copyright (C) 2003, 2006-2011 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2012 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.
@@ -43,7 +43,7 @@ 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
+      [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
@@ -67,6 +67,10 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
 #endif
+/* Enable general extensions on Mac OS X.  */
+#ifndef _DARWIN_C_SOURCE
+# undef _DARWIN_C_SOURCE
+#endif
 /* Enable GNU extensions on systems that have them.  */
 #ifndef _GNU_SOURCE
 # undef _GNU_SOURCE
@@ -95,6 +99,7 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
   test $ac_cv_safe_to_define___extensions__ = yes &&
     AC_DEFINE([__EXTENSIONS__])
   AC_DEFINE([_ALL_SOURCE])
+  AC_DEFINE([_DARWIN_C_SOURCE])
   AC_DEFINE([_GNU_SOURCE])
   AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
   AC_DEFINE([_TANDEM_SOURCE])
index 88db07e..9862741 100644 (file)
@@ -1,5 +1,5 @@
-# fcntl-o.m4 serial 3
-dnl Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc.
+# fcntl-o.m4 serial 4
+dnl Copyright (C) 2006, 2009-2012 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,12 +17,21 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
   m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
     [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
     [AC_REQUIRE([AC_GNU_SOURCE])])
+
+  AC_CHECK_HEADERS_ONCE([unistd.h])
+  AC_CHECK_FUNCS_ONCE([symlink])
   AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
     [AC_RUN_IFELSE(
        [AC_LANG_PROGRAM(
           [[#include <sys/types.h>
            #include <sys/stat.h>
-           #include <unistd.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
@@ -38,6 +47,7 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
           ]],
           [[
             int result = !constants;
+            #if HAVE_SYMLINK
             {
               static char const sym[] = "conftest.sym";
               if (symlink (".", sym) != 0)
@@ -53,6 +63,7 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
                 }
               unlink (sym);
             }
+            #endif
             {
               static char const file[] = "confdefs.h";
               int fd = open (file, O_RDONLY | O_NOATIME);
index 1ef4f45..cac28ae 100644 (file)
@@ -1,6 +1,6 @@
-# serial 13
+# serial 15
 # Configure fcntl.h.
-dnl Copyright (C) 2006-2007, 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2007, 2009-2012 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,6 +13,12 @@ AC_DEFUN([gl_FCNTL_H],
   AC_REQUIRE([gl_FCNTL_O_FLAGS])
   gl_NEXT_HEADERS([fcntl.h])
 
+  dnl Ensure the type pid_t gets defined.
+  AC_REQUIRE([AC_TYPE_PID_T])
+
+  dnl Ensure the type mode_t gets defined.
+  AC_REQUIRE([AC_TYPE_MODE_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.
@@ -31,13 +37,14 @@ AC_DEFUN([gl_FCNTL_MODULE_INDICATOR],
 
 AC_DEFUN([gl_FCNTL_H_DEFAULTS],
 [
-  GNULIB_FCNTL=0;   AC_SUBST([GNULIB_FCNTL])
-  GNULIB_OPEN=0;    AC_SUBST([GNULIB_OPEN])
-  GNULIB_OPENAT=0;  AC_SUBST([GNULIB_OPENAT])
+  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_FCNTL=0;  AC_SUBST([REPLACE_FCNTL])
-  REPLACE_OPEN=0;   AC_SUBST([REPLACE_OPEN])
-  REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT])
+  HAVE_FCNTL=1;          AC_SUBST([HAVE_FCNTL])
+  HAVE_OPENAT=1;         AC_SUBST([HAVE_OPENAT])
+  REPLACE_FCNTL=0;       AC_SUBST([REPLACE_FCNTL])
+  REPLACE_OPEN=0;        AC_SUBST([REPLACE_OPEN])
+  REPLACE_OPENAT=0;      AC_SUBST([REPLACE_OPENAT])
 ])
diff --git a/gnulib/m4/fdopen.m4 b/gnulib/m4/fdopen.m4
new file mode 100644 (file)
index 0000000..14f1554
--- /dev/null
@@ -0,0 +1,47 @@
+# fdopen.m4 serial 3
+dnl Copyright (C) 2011-2012 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_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
+    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],
+      [
+        AC_RUN_IFELSE(
+          [AC_LANG_SOURCE([[
+#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;
+}]])],
+          [gl_cv_func_fdopen_works=yes],
+          [gl_cv_func_fdopen_works=no],
+          [case "$host_os" in
+             mingw*) gl_cv_func_fdopen_works="guessing no" ;;
+             *)      gl_cv_func_fdopen_works="guessing yes" ;;
+           esac
+          ])
+      ])
+    case "$gl_cv_func_fdopen_works" in
+      *no) REPLACE_FDOPEN=1 ;;
+    esac
+  fi
+])
+
+dnl Prerequisites of lib/fdopen.c.
+AC_DEFUN([gl_PREREQ_FDOPEN], [])
index 265a4c1..51c9c7b 100644 (file)
@@ -1,5 +1,5 @@
-# float_h.m4 serial 5
-dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+# float_h.m4 serial 9
+dnl Copyright (C) 2007, 2009-2012 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,90 @@ AC_DEFUN([gl_FLOAT_H],
   AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([AC_CANONICAL_HOST])
   FLOAT_H=
+  REPLACE_FLOAT_LDBL=0
   case "$host_os" in
-    beos* | openbsd* | mirbsd*)
+    aix* | beos* | openbsd* | mirbsd* | irix*)
       FLOAT_H=float.h
-      gl_NEXT_HEADERS([float.h])
+      ;;
+    freebsd*)
+      case "$host_cpu" in
+changequote(,)dnl
+        i[34567]86 )
+changequote([,])dnl
+          FLOAT_H=float.h
+          ;;
+        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],
+            [],
+            [FLOAT_H=float.h])
+          ;;
+      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
+
+  dnl Test against glibc-2.7 Linux/SPARC64 bug.
+  REPLACE_ITOLD=0
+  AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works],
+    [gl_cv_func_itold_works],
+    [
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
+int i = -1;
+volatile long double ld;
+int main ()
+{
+  ld += i * 1.0L;
+  if (ld > 0)
+    return 1;
+  return 0;
+}]])],
+        [gl_cv_func_itold_works=yes],
+        [gl_cv_func_itold_works=no],
+        [case "$host" in
+           sparc*-*-linux*)
+             AC_EGREP_CPP([yes],
+               [#if defined __LP64__ || defined __arch64__
+                yes
+                #endif],
+               [gl_cv_func_itold_works="guessing no"],
+               [gl_cv_func_itold_works="guessing yes"])
+             ;;
+           *) gl_cv_func_itold_works="guessing yes" ;;
+         esac
+        ])
+    ])
+  case "$gl_cv_func_itold_works" in
+    *no)
+      REPLACE_ITOLD=1
+      dnl We add the workaround to <float.h> but also to <math.h>,
+      dnl to increase the chances that the fix function gets pulled in.
+      FLOAT_H=float.h
+      ;;
+  esac
+
+  if test -n "$FLOAT_H"; then
+    gl_NEXT_HEADERS([float.h])
+  fi
   AC_SUBST([FLOAT_H])
+  AM_CONDITIONAL([GL_GENERATE_FLOAT_H], [test -n "$FLOAT_H"])
+  AC_SUBST([REPLACE_ITOLD])
 ])
index 9b537a7..e46b6e5 100644 (file)
@@ -1,6 +1,6 @@
-# Check for fnmatch - serial 5.
+# Check for fnmatch - serial 9.
 
-# Copyright (C) 2000-2007, 2009-2011 Free Software Foundation, Inc.
+# Copyright (C) 2000-2007, 2009-2012 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.
@@ -21,7 +21,7 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX],
 
   FNMATCH_H=
   gl_fnmatch_required_lowercase=`
-    echo $gl_fnmatch_required | tr '[[A-Z]]' '[[a-z]]'
+    echo $gl_fnmatch_required | LC_ALL=C tr '[[A-Z]]' '[[a-z]]'
   `
   gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}"
   AC_CACHE_CHECK([for working $gl_fnmatch_required fnmatch],
@@ -65,6 +65,8 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX],
               return 1;
             if (!y ("a*", "abc", 0))
               return 1;
+            if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */
+              return 1;
             if (!n ("d*/*1", "d/s/1", FNM_PATHNAME))
               return 2;
             if (!y ("a\\\\bc", "abc", 0))
@@ -126,19 +128,9 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX],
     rm -f "$gl_source_base/fnmatch.h"
   else
     FNMATCH_H=fnmatch.h
-    AC_LIBOBJ([fnmatch])
-    dnl We must choose a different name for our function, since on ELF systems
-    dnl a broken fnmatch() in libc.so would override our fnmatch() if it is
-    dnl compiled into a shared library.
-    AC_DEFINE_UNQUOTED([fnmatch], [${gl_fnmatch_required_lowercase}_fnmatch],
-      [Define to a replacement function name for fnmatch().])
-    dnl Prerequisites of lib/fnmatch.c.
-    AC_REQUIRE([AC_TYPE_MBSTATE_T])
-    AC_CHECK_DECLS([isblank], [], [], [#include <ctype.h>])
-    AC_CHECK_FUNCS_ONCE([btowc isblank iswctype mbsrtowcs mempcpy wmemchr wmemcpy wmempcpy])
-    AC_CHECK_HEADERS_ONCE([wctype.h])
   fi
   AC_SUBST([FNMATCH_H])
+  AM_CONDITIONAL([GL_GENERATE_FNMATCH_H], [test -n "$FNMATCH_H"])
 ])
 
 # Request a POSIX compliant fnmatch function with GNU extensions.
@@ -148,3 +140,17 @@ AC_DEFUN([gl_FUNC_FNMATCH_GNU],
 
   AC_REQUIRE([gl_FUNC_FNMATCH_POSIX])
 ])
+
+AC_DEFUN([gl_PREREQ_FNMATCH],
+[
+  dnl We must choose a different name for our function, since on ELF systems
+  dnl a broken fnmatch() in libc.so would override our fnmatch() if it is
+  dnl compiled into a shared library.
+  AC_DEFINE_UNQUOTED([fnmatch], [${gl_fnmatch_required_lowercase}_fnmatch],
+    [Define to a replacement function name for fnmatch().])
+  dnl Prerequisites of lib/fnmatch.c.
+  AC_REQUIRE([AC_TYPE_MBSTATE_T])
+  AC_CHECK_DECLS([isblank], [], [], [[#include <ctype.h>]])
+  AC_CHECK_FUNCS_ONCE([btowc isblank iswctype mbsrtowcs mempcpy wmemchr wmemcpy wmempcpy])
+  AC_CHECK_HEADERS_ONCE([wctype.h])
+])
diff --git a/gnulib/m4/fpieee.m4 b/gnulib/m4/fpieee.m4
new file mode 100644 (file)
index 0000000..82fd778
--- /dev/null
@@ -0,0 +1,54 @@
+# fpieee.m4 serial 2
+dnl Copyright (C) 2007, 2009-2012 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 IEEE 754 standardized three items:
+dnl - The formats of single-float and double-float - nowadays commonly
+dnl   available as 'float' and 'double' in C and C++.
+dnl   No autoconf test needed.
+dnl - The overflow and division by zero behaviour: The result are values
+dnl   '±Inf' and 'NaN', rather than exceptions as it was before.
+dnl   This file provides an autoconf macro for ensuring this behaviour of
+dnl   floating-point operations.
+dnl - A set of conditions (overflow, underflow, inexact, etc.) which can
+dnl   be configured to trigger an exception.
+dnl   This cannot be done in a portable way: it depends on the compiler,
+dnl   libc, kernel, and CPU.  No autoconf macro is provided for this.
+
+dnl Ensure non-trapping behaviour of floating-point overflow and
+dnl floating-point division by zero.
+dnl (For integer overflow, see gcc's -ftrapv option; for integer division by
+dnl zero, see the autoconf macro in intdiv0.m4.)
+
+AC_DEFUN([gl_FP_IEEE],
+[
+  AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  # IEEE behaviour is the default on all CPUs except Alpha and SH
+  # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4
+  # and the GCC 4.1.2 manual).
+  case "$host_cpu" in
+    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>
+      if test -n "$GCC"; then
+        # GCC has the option -mieee.
+        # For full IEEE compliance (rarely needed), use option -mieee-with-inexact.
+        CPPFLAGS="$CPPFLAGS -mieee"
+      else
+        # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact.
+        # For full IEEE compliance (rarely needed), use option -ieee_with_inexact.
+        CPPFLAGS="$CPPFLAGS -ieee"
+      fi
+      ;;
+    sh*)
+      if test -n "$GCC"; then
+        # GCC has the option -mieee.
+        CPPFLAGS="$CPPFLAGS -mieee"
+      fi
+      ;;
+  esac
+])
diff --git a/gnulib/m4/fstat.m4 b/gnulib/m4/fstat.m4
new file mode 100644 (file)
index 0000000..3ab3297
--- /dev/null
@@ -0,0 +1,39 @@
+# fstat.m4 serial 3
+dnl Copyright (C) 2011-2012 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([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
+
+  dnl Replace fstat() for supporting the gnulib-defined open() on directories.
+  m4_ifdef([gl_FUNC_FCHDIR], [
+    gl_TEST_FCHDIR
+    if test $HAVE_FCHDIR = 0; then
+      case "$gl_cv_func_open_directory_works" in
+        *yes) ;;
+        *)
+          REPLACE_FSTAT=1
+          ;;
+      esac
+    fi
+  ])
+])
+
+# Prerequisites of lib/fstat.c.
+AC_DEFUN([gl_PREREQ_FSTAT],
+[
+  AC_REQUIRE([AC_C_INLINE])
+])
diff --git a/gnulib/m4/getcwd.m4 b/gnulib/m4/getcwd.m4
new file mode 100644 (file)
index 0000000..50b96c6
--- /dev/null
@@ -0,0 +1,155 @@
+# getcwd.m4 - check for working getcwd that is compatible with glibc
+
+# Copyright (C) 2001, 2003-2007, 2009-2012 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 12
+
+AC_DEFUN([gl_FUNC_GETCWD_NULL],
+  [
+   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+   AC_CHECK_HEADERS_ONCE([unistd.h])
+   AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result],
+     [gl_cv_func_getcwd_null],
+     [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#        if HAVE_UNISTD_H
+#         include <unistd.h>
+#        else /* on Windows with MSVC */
+#         include <direct.h>
+#        endif
+#        ifndef getcwd
+         char *getcwd ();
+#        endif
+]], [[
+#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;
+               return 0;
+             }
+#endif
+         ]])],
+        [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";;
+          esac
+        ]])])
+])
+
+AC_DEFUN([gl_FUNC_GETCWD_SIGNATURE],
+[
+  AC_CACHE_CHECK([for getcwd with POSIX signature],
+    [gl_cv_func_getcwd_posix_signature],
+    [AC_COMPILE_IFELSE(
+      [AC_LANG_PROGRAM(
+         [[#include <unistd.h>]],
+         [[extern
+           #ifdef __cplusplus
+           "C"
+           #endif
+           char *getcwd (char *, size_t);
+         ]])
+      ],
+      [gl_cv_func_getcwd_posix_signature=yes],
+      [gl_cv_func_getcwd_posix_signature=no])
+   ])
+])
+
+dnl Guarantee that getcwd will malloc with a NULL first argument.  Assumes
+dnl that either the system getcwd is robust, or that calling code is okay
+dnl with spurious failures when run from a directory with an absolute name
+dnl larger than 4k bytes.
+dnl
+dnl Assumes that getcwd exists; if you are worried about obsolete
+dnl platforms that lacked getcwd(), then you need to use the GPL module.
+AC_DEFUN([gl_FUNC_GETCWD_LGPL],
+[
+  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  AC_REQUIRE([gl_FUNC_GETCWD_NULL])
+  AC_REQUIRE([gl_FUNC_GETCWD_SIGNATURE])
+
+  case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in
+  *yes,yes) ;;
+  *)
+    dnl Minimal replacement lib/getcwd-lgpl.c.
+    REPLACE_GETCWD=1
+    ;;
+  esac
+])
+
+dnl Check for all known getcwd bugs; useful for a program likely to be
+dnl executed from an arbitrary location.
+AC_DEFUN([gl_FUNC_GETCWD],
+[
+  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  AC_REQUIRE([gl_FUNC_GETCWD_NULL])
+  AC_REQUIRE([gl_FUNC_GETCWD_SIGNATURE])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+  gl_abort_bug=no
+  case "$host_os" in
+    mingw*)
+      gl_cv_func_getcwd_path_max=yes
+      ;;
+    *)
+      gl_FUNC_GETCWD_PATH_MAX
+      case "$gl_cv_func_getcwd_null" in
+        *yes)
+          gl_FUNC_GETCWD_ABORT_BUG([gl_abort_bug=yes])
+          ;;
+      esac
+      ;;
+  esac
+  dnl Define HAVE_MINIMALLY_WORKING_GETCWD and HAVE_PARTLY_WORKING_GETCWD
+  dnl if appropriate.
+  case "$gl_cv_func_getcwd_path_max" in
+    "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
+         trusted when it succeeds.])
+      ;;
+  esac
+  case "$gl_cv_func_getcwd_path_max" in
+    "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.])
+      ;;
+  esac
+
+  if { case "$gl_cv_func_getcwd_null" in *yes) false;; *) true;; esac; } \
+     || test $gl_cv_func_getcwd_posix_signature != yes \
+     || test "$gl_cv_func_getcwd_path_max" != yes \
+     || test $gl_abort_bug = yes; then
+    REPLACE_GETCWD=1
+  fi
+])
+
+# Prerequisites of lib/getcwd.c, when full replacement is in effect.
+AC_DEFUN([gl_PREREQ_GETCWD],
+[
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+  AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO])
+  :
+])
index ef12736..a6f4872 100644 (file)
@@ -1,6 +1,6 @@
-# getdelim.m4 serial 8
+# getdelim.m4 serial 10
 
-dnl Copyright (C) 2005-2007, 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2007, 2009-2012 Free Software Foundation, Inc.
 dnl
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -19,6 +19,7 @@ AC_DEFUN([gl_FUNC_GETDELIM],
 
   AC_CHECK_FUNCS_ONCE([getdelim])
   if test $ac_cv_func_getdelim = yes; then
+    HAVE_GETDELIM=1
     dnl Found it in some library.  Verify that it works.
     AC_CACHE_CHECK([for working getdelim function], [gl_cv_func_working_getdelim],
     [echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
@@ -62,24 +63,21 @@ AC_DEFUN([gl_FUNC_GETDELIM],
  #endif
 #endif
          ],
-         [gl_cv_func_working_getdelim=yes],
-         [gl_cv_func_working_getdelim=no])]
+         [gl_cv_func_working_getdelim="guessing yes"],
+         [gl_cv_func_working_getdelim="guessing no"])]
     )])
+    case "$gl_cv_func_working_getdelim" in
+      *no)
+        REPLACE_GETDELIM=1
+        ;;
+    esac
   else
-    gl_cv_func_working_getdelim=no
+    HAVE_GETDELIM=0
   fi
 
   if test $ac_cv_have_decl_getdelim = no; then
     HAVE_DECL_GETDELIM=0
   fi
-
-  if test $gl_cv_func_working_getdelim = no; then
-    if test $ac_cv_func_getdelim = yes; then
-      REPLACE_GETDELIM=1
-    fi
-    AC_LIBOBJ([getdelim])
-    gl_PREREQ_GETDELIM
-  fi
 ])
 
 # Prerequisites of lib/getdelim.c.
index ec001b9..72fbc9d 100644 (file)
@@ -1,6 +1,6 @@
-# getline.m4 serial 23
+# getline.m4 serial 26
 
-dnl Copyright (C) 1998-2003, 2005-2007, 2009-2011 Free Software Foundation,
+dnl Copyright (C) 1998-2003, 2005-2007, 2009-2012 Free Software Foundation,
 dnl Inc.
 dnl
 dnl This file is free software; the Free Software Foundation
@@ -70,8 +70,8 @@ AC_DEFUN([gl_FUNC_GETLINE],
  #endif
 #endif
          ],
-         [am_cv_func_working_getline=yes],
-         [am_cv_func_working_getline=no])]
+         [am_cv_func_working_getline="guessing yes"],
+         [am_cv_func_working_getline="guessing no"])]
     )])
   fi
 
@@ -79,19 +79,18 @@ AC_DEFUN([gl_FUNC_GETLINE],
     HAVE_DECL_GETLINE=0
   fi
 
-  if test $am_cv_func_working_getline = no; then
-    dnl Set REPLACE_GETLINE always: Even if we have not found the broken
-    dnl getline function among $LIBS, it may exist in libinet and the
-    dnl executable may be linked with -linet.
-    REPLACE_GETLINE=1
-    AC_LIBOBJ([getline])
-
-    gl_PREREQ_GETLINE
-  fi
+  case "$am_cv_func_working_getline" in
+    *no)
+      dnl Set REPLACE_GETLINE always: Even if we have not found the broken
+      dnl getline function among $LIBS, it may exist in libinet and the
+      dnl executable may be linked with -linet.
+      REPLACE_GETLINE=1
+      ;;
+  esac
 ])
 
 # Prerequisites of lib/getline.c.
 AC_DEFUN([gl_PREREQ_GETLINE],
 [
-  gl_FUNC_GETDELIM
+  :
 ])
index 035a530..f6902b5 100644 (file)
@@ -1,5 +1,5 @@
-# getopt.m4 serial 34
-dnl Copyright (C) 2002-2006, 2008-2011 Free Software Foundation, Inc.
+# getopt.m4 serial 44
+dnl Copyright (C) 2002-2006, 2008-2012 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,10 +9,22 @@ AC_DEFUN([gl_FUNC_GETOPT_POSIX],
 [
   m4_divert_text([DEFAULTS], [gl_getopt_required=POSIX])
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  gl_GETOPT_IFELSE([
-    gl_REPLACE_GETOPT
-  ],
-  [])
+  AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
+  dnl Other modules can request the gnulib implementation of the getopt
+  dnl functions unconditionally, by defining gl_REPLACE_GETOPT_ALWAYS.
+  dnl argp.m4 does this.
+  m4_ifdef([gl_REPLACE_GETOPT_ALWAYS], [
+    REPLACE_GETOPT=1
+  ], [
+    REPLACE_GETOPT=0
+    if test -n "$gl_replace_getopt"; then
+      REPLACE_GETOPT=1
+    fi
+  ])
+  if test $REPLACE_GETOPT = 1; then
+    dnl Arrange for getopt.h to be created.
+    gl_GETOPT_SUBSTITUTE_HEADER
+  fi
 ])
 
 # Request a POSIX compliant getopt function with GNU extensions (such as
@@ -25,27 +37,6 @@ AC_DEFUN([gl_FUNC_GETOPT_GNU],
   AC_REQUIRE([gl_FUNC_GETOPT_POSIX])
 ])
 
-# Request the gnulib implementation of the getopt functions unconditionally.
-# argp.m4 uses this.
-AC_DEFUN([gl_REPLACE_GETOPT],
-[
-  dnl Arrange for getopt.h to be created.
-  gl_GETOPT_SUBSTITUTE_HEADER
-  dnl Arrange for unistd.h to include getopt.h.
-  GNULIB_UNISTD_H_GETOPT=1
-  dnl Arrange to compile the getopt implementation.
-  AC_LIBOBJ([getopt])
-  AC_LIBOBJ([getopt1])
-  gl_PREREQ_GETOPT
-])
-
-# emacs' configure.in uses this.
-AC_DEFUN([gl_GETOPT_IFELSE],
-[
-  AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
-  AS_IF([test -n "$gl_replace_getopt"], [$1], [$2])
-])
-
 # Determine whether to replace the entire getopt facility.
 AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
 [
@@ -75,11 +66,6 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
     AC_CHECK_FUNCS([getopt_long_only], [], [gl_replace_getopt=yes])
   fi
 
-  dnl mingw's getopt (in libmingwex.a) does weird things when the options
-  dnl strings starts with '+' and it's not the first call.  Some internal state
-  dnl is left over from earlier calls, and neither setting optind = 0 nor
-  dnl setting optreset = 1 get rid of this internal state.
-  dnl POSIX is silent on optind vs. optreset, so we allow either behavior.
   dnl POSIX 2008 does not specify leading '+' behavior, but see
   dnl http://austingroupbugs.net/view.php?id=191 for a recommendation on
   dnl the next version of POSIX.  For now, we only guarantee leading '+'
@@ -88,30 +74,16 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
     AC_CACHE_CHECK([whether getopt is POSIX compatible],
       [gl_cv_func_getopt_posix],
       [
-        dnl BSD getopt_long uses an incompatible method to reset
-        dnl option processing.  Existence of the variable, in and of
-        dnl itself, is not a reason to replace getopt, but knowledge
-        dnl of the variable is needed to determine how to reset and
-        dnl whether a reset reparses the environment.  Solaris
-        dnl supports neither optreset nor optind=0, but keeps no state
-        dnl that needs a reset beyond setting optind=1; detect Solaris
-        dnl by getopt_clip.
-        AC_COMPILE_IFELSE(
-          [AC_LANG_PROGRAM(
-             [[#include <unistd.h>]],
-             [[int *p = &optreset; return optreset;]])],
-          [gl_optind_min=1],
-          [AC_COMPILE_IFELSE(
-             [AC_LANG_PROGRAM(
-                [[#include <getopt.h>]],
-                [[return !getopt_clip;]])],
-             [gl_optind_min=1],
-             [gl_optind_min=0])])
-
-        dnl This test fails on mingw and succeeds on many other platforms.
-        gl_save_CPPFLAGS=$CPPFLAGS
-        CPPFLAGS="$CPPFLAGS -DOPTIND_MIN=$gl_optind_min"
-        AC_RUN_IFELSE([AC_LANG_SOURCE([[
+        dnl Merging these three different test programs into a single one
+        dnl would require a reset mechanism. On BSD systems, it can be done
+        dnl through 'optreset'; on some others (glibc), it can be done by
+        dnl setting 'optind' to 0; on others again (HP-UX, IRIX, OSF/1,
+        dnl Solaris 9, musl libc), there is no such mechanism.
+        if test $cross_compiling = no; then
+          dnl Sanity check. Succeeds everywhere (except on MSVC,
+          dnl which lacks <unistd.h> and getopt() entirely).
+          AC_RUN_IFELSE(
+            [AC_LANG_SOURCE([[
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
@@ -119,91 +91,107 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
 int
 main ()
 {
-  {
-    int argc = 0;
-    char *argv[10];
-    int c;
-
-    argv[argc++] = "program";
-    argv[argc++] = "-a";
-    argv[argc++] = "foo";
-    argv[argc++] = "bar";
-    argv[argc] = NULL;
-    optind = OPTIND_MIN;
-    opterr = 0;
+  static char program[] = "program";
+  static char a[] = "-a";
+  static char foo[] = "foo";
+  static char bar[] = "bar";
+  char *argv[] = { program, a, foo, bar, NULL };
+  int c;
 
-    c = getopt (argc, argv, "ab");
-    if (!(c == 'a'))
-      return 1;
-    c = getopt (argc, argv, "ab");
-    if (!(c == -1))
-      return 2;
-    if (!(optind == 2))
-      return 3;
-  }
-  /* Some internal state exists at this point.  */
-  {
-    int argc = 0;
-    char *argv[10];
-    int c;
+  c = getopt (4, argv, "ab");
+  if (!(c == 'a'))
+    return 1;
+  c = getopt (4, argv, "ab");
+  if (!(c == -1))
+    return 2;
+  if (!(optind == 2))
+    return 3;
+  return 0;
+}
+]])],
+            [gl_cv_func_getopt_posix=maybe],
+            [gl_cv_func_getopt_posix=no])
+          if test $gl_cv_func_getopt_posix = maybe; then
+            dnl Sanity check with '+'. Succeeds everywhere (except on MSVC,
+            dnl which lacks <unistd.h> and getopt() entirely).
+            AC_RUN_IFELSE(
+              [AC_LANG_SOURCE([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
 
-    argv[argc++] = "program";
-    argv[argc++] = "donald";
-    argv[argc++] = "-p";
-    argv[argc++] = "billy";
-    argv[argc++] = "duck";
-    argv[argc++] = "-a";
-    argv[argc++] = "bar";
-    argv[argc] = NULL;
-    optind = OPTIND_MIN;
-    opterr = 0;
+int
+main ()
+{
+  static char program[] = "program";
+  static char donald[] = "donald";
+  static char p[] = "-p";
+  static char billy[] = "billy";
+  static char duck[] = "duck";
+  static char a[] = "-a";
+  static char bar[] = "bar";
+  char *argv[] = { program, donald, p, billy, duck, a, bar, NULL };
+  int c;
 
-    c = getopt (argc, argv, "+abp:q:");
-    if (!(c == -1))
-      return 4;
-    if (!(strcmp (argv[0], "program") == 0))
-      return 5;
-    if (!(strcmp (argv[1], "donald") == 0))
-      return 6;
-    if (!(strcmp (argv[2], "-p") == 0))
-      return 7;
-    if (!(strcmp (argv[3], "billy") == 0))
-      return 8;
-    if (!(strcmp (argv[4], "duck") == 0))
-      return 9;
-    if (!(strcmp (argv[5], "-a") == 0))
-      return 10;
-    if (!(strcmp (argv[6], "bar") == 0))
-      return 11;
-    if (!(optind == 1))
-      return 12;
-  }
-  /* Detect MacOS 10.5, AIX 7.1 bug.  */
-  {
-    char *argv[3] = { "program", "-ab", NULL };
-    optind = OPTIND_MIN;
-    opterr = 0;
-    if (getopt (2, argv, "ab:") != 'a')
-      return 13;
-    if (getopt (2, argv, "ab:") != '?')
-      return 14;
-    if (optopt != 'b')
-      return 15;
-    if (optind != 2)
-      return 16;
-  }
+  c = getopt (7, argv, "+abp:q:");
+  if (!(c == -1))
+    return 4;
+  if (!(strcmp (argv[0], "program") == 0))
+    return 5;
+  if (!(strcmp (argv[1], "donald") == 0))
+    return 6;
+  if (!(strcmp (argv[2], "-p") == 0))
+    return 7;
+  if (!(strcmp (argv[3], "billy") == 0))
+    return 8;
+  if (!(strcmp (argv[4], "duck") == 0))
+    return 9;
+  if (!(strcmp (argv[5], "-a") == 0))
+    return 10;
+  if (!(strcmp (argv[6], "bar") == 0))
+    return 11;
+  if (!(optind == 1))
+    return 12;
+  return 0;
+}
+]])],
+              [gl_cv_func_getopt_posix=maybe],
+              [gl_cv_func_getopt_posix=no])
+          fi
+          if test $gl_cv_func_getopt_posix = maybe; then
+            dnl Detect Mac OS X 10.5, AIX 7.1, mingw bug.
+            AC_RUN_IFELSE(
+              [AC_LANG_SOURCE([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
 
+int
+main ()
+{
+  static char program[] = "program";
+  static char ab[] = "-ab";
+  char *argv[3] = { program, ab, NULL };
+  if (getopt (2, argv, "ab:") != 'a')
+    return 13;
+  if (getopt (2, argv, "ab:") != '?')
+    return 14;
+  if (optopt != 'b')
+    return 15;
+  if (optind != 2)
+    return 16;
   return 0;
 }
 ]])],
-          [gl_cv_func_getopt_posix=yes], [gl_cv_func_getopt_posix=no],
-          [case "$host_os" in
-             mingw*)         gl_cv_func_getopt_posix="guessing no";;
-             darwin* | aix*) gl_cv_func_getopt_posix="guessing no";;
-             *)              gl_cv_func_getopt_posix="guessing yes";;
-           esac
-          ])
-        CPPFLAGS=$gl_save_CPPFLAGS
+              [gl_cv_func_getopt_posix=yes],
+              [gl_cv_func_getopt_posix=no])
+          fi
+        else
+          case "$host_os" in
+            darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";;
+            *)                       gl_cv_func_getopt_posix="guessing yes";;
+          esac
+        fi
       ])
     case "$gl_cv_func_getopt_posix" in
       *no) gl_replace_getopt=yes ;;
@@ -232,25 +220,32 @@ dnl is ambiguous with environment values that contain newlines.
         [AC_LANG_PROGRAM([[#include <getopt.h>
                            #include <stddef.h>
                            #include <string.h>
+           ]GL_NOCRASH[
            ]], [[
              int result = 0;
+
+             nocrash_init();
+
              /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
-                and fails on MacOS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
+                and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
                 OSF/1 5.1, Solaris 10.  */
              {
-               char *myargv[3];
-               myargv[0] = "conftest";
-               myargv[1] = "-+";
-               myargv[2] = 0;
+               static char conftest[] = "conftest";
+               static char plus[] = "-+";
+               char *argv[3] = { conftest, plus, NULL };
                opterr = 0;
-               if (getopt (2, myargv, "+a") != '?')
+               if (getopt (2, argv, "+a") != '?')
                  result |= 1;
              }
              /* This code succeeds on glibc 2.8, mingw,
-                and fails on MacOS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+                and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
                 IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x.  */
              {
-               char *argv[] = { "program", "-p", "foo", "bar", NULL };
+               static char program[] = "program";
+               static char p[] = "-p";
+               static char foo[] = "foo";
+               static char bar[] = "bar";
+               char *argv[] = { program, p, foo, bar, NULL };
 
                optind = 1;
                if (getopt (4, argv, "p::") != 'p')
@@ -264,32 +259,44 @@ dnl is ambiguous with environment values that contain newlines.
              }
              /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0.  */
              {
-               char *argv[] = { "program", "foo", "-p", NULL };
+               static char program[] = "program";
+               static char foo[] = "foo";
+               static char p[] = "-p";
+               char *argv[] = { program, foo, p, NULL };
                optind = 0;
                if (getopt (3, argv, "-p") != 1)
                  result |= 16;
                else if (getopt (3, argv, "-p") != 'p')
-                 result |= 32;
+                 result |= 16;
              }
              /* This code fails on glibc 2.11.  */
              {
-               char *argv[] = { "program", "-b", "-a", NULL };
+               static char program[] = "program";
+               static char b[] = "-b";
+               static char a[] = "-a";
+               char *argv[] = { program, b, a, NULL };
                optind = opterr = 0;
                if (getopt (3, argv, "+:a:b") != 'b')
-                 result |= 64;
+                 result |= 32;
                else if (getopt (3, argv, "+:a:b") != ':')
+                 result |= 32;
+             }
+             /* This code dumps core on glibc 2.14.  */
+             {
+               static char program[] = "program";
+               static char w[] = "-W";
+               static char dummy[] = "dummy";
+               char *argv[] = { program, w, dummy, NULL };
+               optind = opterr = 1;
+               if (getopt (3, argv, "W;") != 'W')
                  result |= 64;
              }
              return result;
            ]])],
         [gl_cv_func_getopt_gnu=yes],
         [gl_cv_func_getopt_gnu=no],
-        [dnl Cross compiling. Guess based on host and declarations.
-         case $host_os:$ac_cv_have_decl_optreset in
-           *-gnu*:* | mingw*:*) gl_cv_func_getopt_gnu=no;;
-           *:yes)               gl_cv_func_getopt_gnu=no;;
-           *)                   gl_cv_func_getopt_gnu=yes;;
-         esac
+        [dnl Cross compiling. Assume the worst, even on glibc platforms.
+         gl_cv_func_getopt_gnu="guessing no"
         ])
        case $gl_had_POSIXLY_CORRECT in
          exported) ;;
@@ -297,13 +304,54 @@ dnl is ambiguous with environment values that contain newlines.
          *) AS_UNSET([POSIXLY_CORRECT]) ;;
        esac
       ])
-    if test "$gl_cv_func_getopt_gnu" = "no"; then
+    if test "$gl_cv_func_getopt_gnu" != yes; then
       gl_replace_getopt=yes
+    else
+      AC_CACHE_CHECK([for working GNU getopt_long function],
+        [gl_cv_func_getopt_long_gnu],
+        [AC_RUN_IFELSE(
+           [AC_LANG_PROGRAM(
+              [[#include <getopt.h>
+                #include <stddef.h>
+                #include <string.h>
+              ]],
+              [[static const struct option long_options[] =
+                  {
+                    { "xtremely-",no_argument,       NULL, 1003 },
+                    { "xtra",     no_argument,       NULL, 1001 },
+                    { "xtreme",   no_argument,       NULL, 1002 },
+                    { "xtremely", no_argument,       NULL, 1003 },
+                    { NULL,       0,                 NULL, 0 }
+                  };
+                /* This code fails on OpenBSD 5.0.  */
+                {
+                  static char program[] = "program";
+                  static char xtremel[] = "--xtremel";
+                  char *argv[] = { program, xtremel, NULL };
+                  int option_index;
+                  optind = 1; opterr = 0;
+                  if (getopt_long (2, argv, "", long_options, &option_index) != 1003)
+                    return 1;
+                }
+                return 0;
+              ]])],
+           [gl_cv_func_getopt_long_gnu=yes],
+           [gl_cv_func_getopt_long_gnu=no],
+           [dnl Cross compiling. Guess no on OpenBSD, yes otherwise.
+            case "$host_os" in
+              openbsd*) gl_cv_func_getopt_long_gnu="guessing no";;
+              *)        gl_cv_func_getopt_long_gnu="guessing yes";;
+            esac
+           ])
+        ])
+      case "$gl_cv_func_getopt_long_gnu" in
+        *yes) ;;
+        *) gl_replace_getopt=yes ;;
+      esac
     fi
   fi
 ])
 
-# emacs' configure.in uses this.
 AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
 [
   GETOPT_H=getopt.h
@@ -314,7 +362,6 @@ AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
 ])
 
 # Prerequisites of lib/getopt*.
-# emacs' configure.in uses this.
 AC_DEFUN([gl_PREREQ_GETOPT],
 [
   AC_CHECK_DECLS_ONCE([getenv])
index 79dfbbe..156133a 100644 (file)
@@ -1,5 +1,5 @@
-# getpagesize.m4 serial 8
-dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2011 Free Software Foundation,
+# getpagesize.m4 serial 9
+dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2012 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,
@@ -24,7 +24,6 @@ AC_DEFUN([gl_FUNC_GETPAGESIZE],
   case "$host_os" in
     mingw*)
       REPLACE_GETPAGESIZE=1
-      AC_LIBOBJ([getpagesize])
       ;;
   esac
   dnl Also check whether it's declared.
diff --git a/gnulib/m4/gettimeofday.m4 b/gnulib/m4/gettimeofday.m4
new file mode 100644 (file)
index 0000000..eda9702
--- /dev/null
@@ -0,0 +1,140 @@
+# serial 20
+
+# Copyright (C) 2001-2003, 2005, 2007, 2009-2012 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 Jim Meyering.
+
+AC_DEFUN([gl_FUNC_GETTIMEOFDAY],
+[
+  AC_REQUIRE([AC_C_RESTRICT])
+  AC_REQUIRE([gl_HEADER_SYS_TIME_H])
+  AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
+  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(
+         [AC_LANG_PROGRAM(
+            [[#include <sys/time.h>
+              struct timeval c;
+              int gettimeofday (struct timeval *restrict, void *restrict);
+            ]],
+            [[/* 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);
+            ]])],
+          [gl_cv_func_gettimeofday_posix_signature=yes],
+          [AC_COMPILE_IFELSE(
+            [AC_LANG_PROGRAM(
+              [[#include <sys/time.h>
+int gettimeofday (struct timeval *restrict, struct timezone *restrict);
+              ]])],
+            [gl_cv_func_gettimeofday_posix_signature=almost],
+            [gl_cv_func_gettimeofday_posix_signature=no])])])
+    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
+    dnl If we override 'struct timeval', we also have to override gettimeofday.
+    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
+    ])
+  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], [
+  AC_DEFINE([gmtime], [rpl_gmtime],
+    [Define to rpl_gmtime if the replacement function should be used.])
+  AC_DEFINE([localtime], [rpl_localtime],
+    [Define to rpl_localtime if the replacement function should be used.])
+])
+
+# Prerequisites of lib/gettimeofday.c.
+AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [
+  AC_CHECK_HEADERS([sys/timeb.h])
+  AC_CHECK_FUNCS([_ftime])
+])
index bc81c11..c938fb1 100644 (file)
@@ -1,5 +1,5 @@
 # glibc21.m4 serial 5
-dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2011 Free Software Foundation,
+dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2012 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 ecbf336..15d2b2b 100644 (file)
@@ -1,5 +1,5 @@
-# gnulib-common.m4 serial 23
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# gnulib-common.m4 serial 33
+dnl Copyright (C) 2007-2012 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,25 @@ AC_DEFUN([gl_COMMON], [
   AC_REQUIRE([gl_COMMON_BODY])
 ])
 AC_DEFUN([gl_COMMON_BODY], [
+  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)
+#  define _Noreturn __attribute__ ((__noreturn__))
+# elif defined _MSC_VER && 1200 <= _MSC_VER
+#  define _Noreturn __declspec (noreturn)
+# else
+#  define _Noreturn
+# endif
+#endif
+])
   AH_VERBATIM([isoc99_inline],
 [/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
    the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
    earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
-   __APPLE__ && __MACH__ test for MacOS X.
+   __APPLE__ && __MACH__ test for Mac OS X.
    __APPLE_CC__ tests for the Apple compiler and its version.
    __STDC_VERSION__ tests for the C99 mode.  */
 #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
@@ -34,6 +48,20 @@ AC_DEFUN([gl_COMMON_BODY], [
 /* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
    is a misnomer outside of parameter lists.  */
 #define _UNUSED_PARAMETER_ _GL_UNUSED
+
+/* 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
 ])
   dnl Preparation for running test programs:
   dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
@@ -47,16 +75,49 @@ AC_DEFUN([gl_COMMON_BODY], [
 # 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
 # or not.
-AC_DEFUN([gl_MODULE_INDICATOR_CONDITION], [1])
+m4_define([gl_MODULE_INDICATOR_CONDITION], [1])
 
 # gl_MODULE_INDICATOR_SET_VARIABLE([modulename])
 # sets the shell variable that indicates the presence of the given module to
 # a C preprocessor expression that will evaluate to 1.
 AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE],
 [
-  GNULIB_[]m4_translit([[$1]],
-    [abcdefghijklmnopqrstuvwxyz./-],
-    [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=gl_MODULE_INDICATOR_CONDITION
+  gl_MODULE_INDICATOR_SET_VARIABLE_AUX(
+    [GNULIB_[]m4_translit([[$1]],
+                          [abcdefghijklmnopqrstuvwxyz./-],
+                          [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])],
+    [gl_MODULE_INDICATOR_CONDITION])
+])
+
+# gl_MODULE_INDICATOR_SET_VARIABLE_AUX([variable])
+# modifies the shell variable to include the gl_MODULE_INDICATOR_CONDITION.
+# The shell variable's value is a C preprocessor expression that evaluates
+# to 0 or 1.
+AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX],
+[
+  m4_if(m4_defn([gl_MODULE_INDICATOR_CONDITION]), [1],
+    [
+     dnl Simplify the expression VALUE || 1 to 1.
+     $1=1
+    ],
+    [gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([$1],
+                                             [gl_MODULE_INDICATOR_CONDITION])])
+])
+
+# gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([variable], [condition])
+# modifies the shell variable to include the given condition.  The shell
+# variable's value is a C preprocessor expression that evaluates to 0 or 1.
+AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR],
+[
+  dnl Simplify the expression 1 || CONDITION to 1.
+  if test "$[]$1" != 1; then
+    dnl Simplify the expression 0 || CONDITION to CONDITION.
+    if test "$[]$1" = 0; then
+      $1=$2
+    else
+      $1="($[]$1 || $2)"
+    fi
+  fi
 ])
 
 # gl_MODULE_INDICATOR([modulename])
@@ -109,7 +170,8 @@ AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS],
 AC_DEFUN([gl_ASSERT_NO_GNULIB_POSIXCHECK],
 [
   dnl Override gl_WARN_ON_USE_PREPARE.
-  AC_DEFUN([gl_WARN_ON_USE_PREPARE], [])
+  dnl But hide this definition from 'aclocal'.
+  AC_DEFUN([gl_W][ARN_ON_USE_PREPARE], [])
 ])
 
 # gl_ASSERT_NO_GNULIB_TESTS
@@ -150,6 +212,83 @@ 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])])
+])
+
+# gl_PROG_AR_RANLIB
+# Determines the values for AR, ARFLAGS, RANLIB that fit with the compiler.
+# The user can set the variables AR, ARFLAGS, RANLIB if he wants to override
+# the values.
+AC_DEFUN([gl_PROG_AR_RANLIB],
+[
+  dnl Minix 3 comes with two toolchains: The Amsterdam Compiler Kit compiler
+  dnl as "cc", and GCC as "gcc". They have different object file formats and
+  dnl library formats. In particular, the GNU binutils programs ar, ranlib
+  dnl produce libraries that work only with gcc, not with cc.
+  AC_REQUIRE([AC_PROG_CC])
+  AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler],
+    [
+      AC_EGREP_CPP([Amsterdam],
+        [
+#ifdef __ACK__
+Amsterdam
+#endif
+        ],
+        [gl_cv_c_amsterdam_compiler=yes],
+        [gl_cv_c_amsterdam_compiler=no])
+    ])
+  if test -z "$AR"; then
+    if test $gl_cv_c_amsterdam_compiler = yes; then
+      AR='cc -c.a'
+      if test -z "$ARFLAGS"; then
+        ARFLAGS='-o'
+      fi
+    else
+      dnl Use the Automake-documented default values for AR and ARFLAGS,
+      dnl but prefer ${host}-ar over ar (useful for cross-compiling).
+      AC_CHECK_TOOL([AR], [ar], [ar])
+      if test -z "$ARFLAGS"; then
+        ARFLAGS='cru'
+      fi
+    fi
+  else
+    if test -z "$ARFLAGS"; then
+      ARFLAGS='cru'
+    fi
+  fi
+  AC_SUBST([AR])
+  AC_SUBST([ARFLAGS])
+  if test -z "$RANLIB"; then
+    if test $gl_cv_c_amsterdam_compiler = yes; then
+      RANLIB=':'
+    else
+      dnl Use the ranlib program if it is available.
+      AC_PROG_RANLIB
+    fi
+  fi
+  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.
index e42948b..b1c95fe 100644 (file)
@@ -1,10 +1,22 @@
 # DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2011 Free Software Foundation, Inc.
+# Copyright (C) 2002-2012 Free Software Foundation, Inc.
 #
-# This file is free software, distributed under the terms of the GNU
-# General Public License.  As a special exception to the GNU General
-# Public License, this file may be distributed as part of a program
-# that contains a configuration script generated by Autoconf, under
+# 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 this file.  If not, see <http://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
+# contains a configuration script generated by Autoconf, under
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
@@ -25,23 +37,23 @@ AC_DEFUN([gl_EARLY],
   m4_pattern_allow([^gl_ES$])dnl a valid locale name
   m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
   m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
-  AC_REQUIRE([AC_PROG_RANLIB])
+  AC_REQUIRE([gl_PROG_AR_RANLIB])
   # Code from module alloca:
   # Code from module alloca-opt:
   # Code from module alloca-opt-tests:
-  # Code from module arg-nonnull:
   # Code from module argz:
   # Code from module binary-io:
   # Code from module binary-io-tests:
   # Code from module btowc:
   # Code from module btowc-tests:
-  # Code from module c++defs:
   # Code from module c-ctype:
   # Code from module c-ctype-tests:
   # Code from module c-strcase:
   # Code from module c-strcase-tests:
   # Code from module canonicalize-lgpl:
   # Code from module canonicalize-lgpl-tests:
+  # Code from module close:
+  # Code from module close-tests:
   # Code from module configmake:
   # Code from module ctype:
   # Code from module ctype-tests:
@@ -56,9 +68,24 @@ AC_DEFUN([gl_EARLY],
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
   # Code from module fcntl-h:
   # Code from module fcntl-h-tests:
+  # Code from module fd-hook:
+  # Code from module fdopen:
+  # Code from module fdopen-tests:
+  # Code from module fgetc-tests:
   # Code from module float:
+  # Code from module float-tests:
   # Code from module fnmatch:
   # Code from module fnmatch-tests:
+  # Code from module fpieee:
+  AC_REQUIRE([gl_FP_IEEE])
+  # Code from module fpucw:
+  # Code from module fputc-tests:
+  # Code from module fread-tests:
+  # Code from module fstat:
+  # Code from module fstat-tests:
+  # Code from module fwrite-tests:
+  # Code from module getcwd-lgpl:
+  # Code from module getcwd-lgpl-tests:
   # Code from module getdelim:
   # Code from module getdelim-tests:
   # Code from module getline:
@@ -68,19 +95,29 @@ AC_DEFUN([gl_EARLY],
   # Code from module getopt-posix-tests:
   # Code from module getpagesize:
   # Code from module gettext-h:
+  # Code from module gettimeofday:
+  # Code from module gettimeofday-tests:
   # Code from module gitlog-to-changelog:
   # Code from module havelib:
   # Code from module ignore-value:
   # Code from module ignore-value-tests:
   # Code from module include_next:
   # Code from module intprops:
+  # Code from module intprops-tests:
+  # Code from module inttypes:
+  # Code from module inttypes-incomplete:
+  # Code from module inttypes-tests:
   # Code from module isblank:
   # Code from module isblank-tests:
   # Code from module langinfo:
   # Code from module langinfo-tests:
+  # Code from module largefile:
+  AC_REQUIRE([AC_SYS_LARGEFILE])
   # Code from module localcharset:
   # Code from module locale:
   # Code from module locale-tests:
+  # Code from module localeconv:
+  # Code from module localeconv-tests:
   # Code from module localename:
   # Code from module localename-tests:
   # Code from module lock:
@@ -102,13 +139,20 @@ AC_DEFUN([gl_EARLY],
   # Code from module memchr:
   # Code from module memchr-tests:
   # Code from module mempcpy:
+  # Code from module mkstemp:
+  # Code from module msvc-inval:
+  # Code from module msvc-nothrow:
   # Code from module multiarch:
   # Code from module nl_langinfo:
   # Code from module nl_langinfo-tests:
+  # Code from module nocrash:
   # Code from module open:
   # Code from module open-tests:
   # Code from module pathmax:
+  # Code from module pathmax-tests:
   # Code from module putenv:
+  # Code from module rawmemchr:
+  # Code from module rawmemchr-tests:
   # Code from module readlink:
   # Code from module readlink-tests:
   # Code from module realloc-posix:
@@ -122,6 +166,11 @@ AC_DEFUN([gl_EARLY],
   # Code from module setlocale:
   # Code from module setlocale-tests:
   # Code from module size_max:
+  # Code from module snippet/_Noreturn:
+  # Code from module snippet/arg-nonnull:
+  # Code from module snippet/c++defs:
+  # Code from module snippet/unused-parameter:
+  # Code from module snippet/warn-on-use:
   # Code from module ssize_t:
   # Code from module stat:
   # Code from module stat-tests:
@@ -137,6 +186,8 @@ AC_DEFUN([gl_EARLY],
   # Code from module stdlib-tests:
   # Code from module stpcpy:
   # Code from module stpncpy:
+  # Code from module strchrnul:
+  # Code from module strchrnul-tests:
   # Code from module streq:
   # Code from module string:
   # Code from module string-tests:
@@ -151,9 +202,17 @@ AC_DEFUN([gl_EARLY],
   # Code from module symlink-tests:
   # Code from module sys_stat:
   # Code from module sys_stat-tests:
+  # Code from module sys_time:
+  # Code from module sys_time-tests:
+  # Code from module sys_types:
+  # Code from module sys_types-tests:
   # Code from module sys_wait:
   # 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-tests:
   # Code from module threadlib:
   gl_THREADLIB_EARLY
   # Code from module time:
@@ -162,14 +221,12 @@ AC_DEFUN([gl_EARLY],
   # Code from module unistd-tests:
   # Code from module unsetenv:
   # Code from module unsetenv-tests:
-  # Code from module unused-parameter:
   # Code from module vasnprintf:
   # Code from module vasnprintf-tests:
   # Code from module vasprintf:
   # Code from module vasprintf-tests:
   # Code from module verify:
   # Code from module verify-tests:
-  # Code from module warn-on-use:
   # Code from module wchar:
   # Code from module wchar-tests:
   # Code from module wcrtomb:
@@ -196,182 +253,274 @@ AC_DEFUN([gl_INIT],
   m4_pushdef([gl_LIBSOURCES_DIR], [])
   gl_COMMON
   gl_source_base='gnulib/lib'
-  # Code from module alloca:
 changequote(,)dnl
 LTALLOCA=`echo "$ALLOCA" | sed -e 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'`
 changequote([, ])dnl
 AC_SUBST([LTALLOCA])
-  # Code from module alloca-opt:
-  gl_FUNC_ALLOCA
-  # Code from module arg-nonnull:
-  # Code from module argz:
-  gl_FUNC_ARGZ
-  # Code from module btowc:
-  gl_FUNC_BTOWC
-  gl_WCHAR_MODULE_INDICATOR([btowc])
-  # Code from module c++defs:
-  # Code from module canonicalize-lgpl:
-  gl_CANONICALIZE_LGPL
-  gl_MODULE_INDICATOR([canonicalize-lgpl])
-  gl_STDLIB_MODULE_INDICATOR([canonicalize_file_name])
-  gl_STDLIB_MODULE_INDICATOR([realpath])
-  # Code from module configmake:
-  gl_CONFIGMAKE_PREP
-  # Code from module ctype:
-  gl_CTYPE_H
-  # Code from module dosname:
-  # Code from module errno:
-  gl_HEADER_ERRNO_H
-  # Code from module extensions:
-  # Code from module float:
-  gl_FLOAT_H
-  # Code from module fnmatch:
-  gl_FUNC_FNMATCH_POSIX
-  # Code from module getdelim:
-  gl_FUNC_GETDELIM
-  gl_STDIO_MODULE_INDICATOR([getdelim])
-  # Code from module getline:
-  gl_FUNC_GETLINE
-  gl_STDIO_MODULE_INDICATOR([getline])
-  # Code from module getopt-gnu:
-  gl_FUNC_GETOPT_GNU
-  gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu])
-  # Code from module getopt-posix:
-  gl_FUNC_GETOPT_POSIX
-  # Code from module gettext-h:
-  AC_SUBST([LIBINTL])
-  AC_SUBST([LTLIBINTL])
-  # Code from module gitlog-to-changelog:
-  # Code from module include_next:
-  # Code from module isblank:
-  gl_FUNC_ISBLANK
-  gl_CTYPE_MODULE_INDICATOR([isblank])
-  # Code from module langinfo:
-  gl_LANGINFO_H
-  # Code from module localcharset:
-  gl_LOCALCHARSET
-  LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\""
-  AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
-  # Code from module locale:
-  gl_LOCALE_H
-  # Code from module lstat:
-  gl_FUNC_LSTAT
-  gl_SYS_STAT_MODULE_INDICATOR([lstat])
-  # Code from module malloc-gnu:
-  gl_FUNC_MALLOC_GNU
-  gl_MODULE_INDICATOR([malloc-gnu])
-  # Code from module malloc-posix:
-  gl_FUNC_MALLOC_POSIX
-  gl_STDLIB_MODULE_INDICATOR([malloc-posix])
-  # Code from module malloca:
-  gl_MALLOCA
-  # Code from module mbrtowc:
-  gl_FUNC_MBRTOWC
-  gl_WCHAR_MODULE_INDICATOR([mbrtowc])
-  # Code from module mbsinit:
-  gl_FUNC_MBSINIT
-  gl_WCHAR_MODULE_INDICATOR([mbsinit])
-  # Code from module mbsrtowcs:
-  gl_FUNC_MBSRTOWCS
-  gl_WCHAR_MODULE_INDICATOR([mbsrtowcs])
-  # Code from module mbtowc:
-  gl_FUNC_MBTOWC
-  gl_STDLIB_MODULE_INDICATOR([mbtowc])
-  # Code from module memchr:
-  gl_FUNC_MEMCHR
-  gl_STRING_MODULE_INDICATOR([memchr])
-  # Code from module mempcpy:
-  gl_FUNC_MEMPCPY
-  gl_STRING_MODULE_INDICATOR([mempcpy])
-  # Code from module multiarch:
-  gl_MULTIARCH
-  # Code from module nl_langinfo:
-  gl_FUNC_NL_LANGINFO
-  gl_LANGINFO_MODULE_INDICATOR([nl_langinfo])
-  # Code from module pathmax:
-  gl_PATHMAX
-  # Code from module readlink:
-  gl_FUNC_READLINK
-  gl_UNISTD_MODULE_INDICATOR([readlink])
-  # Code from module realloc-posix:
-  gl_FUNC_REALLOC_POSIX
-  gl_STDLIB_MODULE_INDICATOR([realloc-posix])
-  # Code from module regex:
-  gl_REGEX
-  # Code from module safe-alloc:
-  gl_SAFE_ALLOC
-  # Code from module selinux-h:
-  gl_HEADERS_SELINUX_SELINUX_H
-  gl_HEADERS_SELINUX_CONTEXT_H
-  AC_REQUIRE([AC_C_INLINE])
-  # Code from module size_max:
-  gl_SIZE_MAX
-  # Code from module ssize_t:
-  gt_TYPE_SSIZE_T
-  # Code from module stat:
-  gl_FUNC_STAT
-  gl_SYS_STAT_MODULE_INDICATOR([stat])
-  # Code from module stdbool:
-  AM_STDBOOL_H
-  # Code from module stddef:
-  gl_STDDEF_H
-  # Code from module stdint:
-  gl_STDINT_H
-  # Code from module stdio:
-  gl_STDIO_H
-  # Code from module stdlib:
-  gl_STDLIB_H
-  # Code from module stpcpy:
-  gl_FUNC_STPCPY
-  gl_STRING_MODULE_INDICATOR([stpcpy])
-  # Code from module stpncpy:
-  gl_FUNC_STPNCPY
-  gl_STRING_MODULE_INDICATOR([stpncpy])
-  # Code from module streq:
-  # Code from module string:
-  gl_HEADER_STRING_H
-  # Code from module strndup:
-  gl_FUNC_STRNDUP
-  gl_STRING_MODULE_INDICATOR([strndup])
-  # Code from module strnlen:
-  gl_FUNC_STRNLEN
-  gl_STRING_MODULE_INDICATOR([strnlen])
-  # Code from module strnlen1:
-  # Code from module strstr:
-  gl_FUNC_STRSTR
-  # Code from module strstr-simple:
-  gl_FUNC_STRSTR_SIMPLE
-  gl_STRING_MODULE_INDICATOR([strstr])
-  # Code from module sys_stat:
-  gl_HEADER_SYS_STAT_H
-  AC_PROG_MKDIR_P
-  # Code from module sys_wait:
-  gl_SYS_WAIT_H
-  AC_PROG_MKDIR_P
-  # Code from module time:
-  gl_HEADER_TIME_H
-  # Code from module unistd:
-  gl_UNISTD_H
-  # Code from module unused-parameter:
-  # Code from module vasnprintf:
-  gl_FUNC_VASNPRINTF
-  # Code from module vasprintf:
-  gl_FUNC_VASPRINTF
-  gl_STDIO_MODULE_INDICATOR([vasprintf])
-  m4_ifdef([AM_XGETTEXT_OPTION],
-    [AM_][XGETTEXT_OPTION([--flag=asprintf:2:c-format])
-     AM_][XGETTEXT_OPTION([--flag=vasprintf:2:c-format])])
-  # Code from module verify:
-  # Code from module warn-on-use:
-  # Code from module wchar:
-  gl_WCHAR_H
-  # Code from module wcrtomb:
-  gl_FUNC_WCRTOMB
-  gl_WCHAR_MODULE_INDICATOR([wcrtomb])
-  # Code from module wctype-h:
-  gl_WCTYPE_H
-  # Code from module xsize:
-  gl_XSIZE
+gl_FUNC_ALLOCA
+gl_FUNC_ARGZ
+if test -n "$ARGZ_H"; then
+  AC_LIBOBJ([argz])
+fi
+gl_FUNC_BTOWC
+if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
+  AC_LIBOBJ([btowc])
+  gl_PREREQ_BTOWC
+fi
+gl_WCHAR_MODULE_INDICATOR([btowc])
+gl_CANONICALIZE_LGPL
+if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
+  AC_LIBOBJ([canonicalize-lgpl])
+fi
+gl_MODULE_INDICATOR([canonicalize-lgpl])
+gl_STDLIB_MODULE_INDICATOR([canonicalize_file_name])
+gl_STDLIB_MODULE_INDICATOR([realpath])
+gl_CONFIGMAKE_PREP
+gl_CTYPE_H
+gl_HEADER_ERRNO_H
+gl_FCNTL_H
+gl_FLOAT_H
+if test $REPLACE_FLOAT_LDBL = 1; then
+  AC_LIBOBJ([float])
+fi
+if test $REPLACE_ITOLD = 1; then
+  AC_LIBOBJ([itold])
+fi
+gl_FUNC_FNMATCH_POSIX
+if test -n "$FNMATCH_H"; then
+  AC_LIBOBJ([fnmatch])
+  gl_PREREQ_FNMATCH
+fi
+gl_FUNC_GETDELIM
+if test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1; then
+  AC_LIBOBJ([getdelim])
+  gl_PREREQ_GETDELIM
+fi
+gl_STDIO_MODULE_INDICATOR([getdelim])
+gl_FUNC_GETLINE
+if test $REPLACE_GETLINE = 1; then
+  AC_LIBOBJ([getline])
+  gl_PREREQ_GETLINE
+fi
+gl_STDIO_MODULE_INDICATOR([getline])
+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_UNISTD_H_GETOPT=1
+fi
+AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT])
+gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu])
+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_UNISTD_H_GETOPT=1
+fi
+AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT])
+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])
+gl_FUNC_ISBLANK
+if test $HAVE_ISBLANK = 0; then
+  AC_LIBOBJ([isblank])
+fi
+gl_CTYPE_MODULE_INDICATOR([isblank])
+gl_LANGINFO_H
+AC_REQUIRE([gl_LARGEFILE])
+gl_LOCALCHARSET
+LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
+AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
+gl_LOCALE_H
+gl_FUNC_LOCALECONV
+if test $REPLACE_LOCALECONV = 1; then
+  AC_LIBOBJ([localeconv])
+  gl_PREREQ_LOCALECONV
+fi
+gl_LOCALE_MODULE_INDICATOR([localeconv])
+gl_FUNC_LSTAT
+if test $REPLACE_LSTAT = 1; then
+  AC_LIBOBJ([lstat])
+  gl_PREREQ_LSTAT
+fi
+gl_SYS_STAT_MODULE_INDICATOR([lstat])
+gl_FUNC_MALLOC_GNU
+if test $REPLACE_MALLOC = 1; then
+  AC_LIBOBJ([malloc])
+fi
+gl_MODULE_INDICATOR([malloc-gnu])
+gl_FUNC_MALLOC_POSIX
+if test $REPLACE_MALLOC = 1; then
+  AC_LIBOBJ([malloc])
+fi
+gl_STDLIB_MODULE_INDICATOR([malloc-posix])
+gl_MALLOCA
+gl_FUNC_MBRTOWC
+if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
+  AC_LIBOBJ([mbrtowc])
+  gl_PREREQ_MBRTOWC
+fi
+gl_WCHAR_MODULE_INDICATOR([mbrtowc])
+gl_FUNC_MBSINIT
+if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
+  AC_LIBOBJ([mbsinit])
+  gl_PREREQ_MBSINIT
+fi
+gl_WCHAR_MODULE_INDICATOR([mbsinit])
+gl_FUNC_MBSRTOWCS
+if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
+  AC_LIBOBJ([mbsrtowcs])
+  AC_LIBOBJ([mbsrtowcs-state])
+  gl_PREREQ_MBSRTOWCS
+fi
+gl_WCHAR_MODULE_INDICATOR([mbsrtowcs])
+gl_FUNC_MBTOWC
+if test $REPLACE_MBTOWC = 1; then
+  AC_LIBOBJ([mbtowc])
+  gl_PREREQ_MBTOWC
+fi
+gl_STDLIB_MODULE_INDICATOR([mbtowc])
+gl_FUNC_MEMCHR
+if test $HAVE_MEMCHR = 0 || 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_MKSTEMP
+if test $HAVE_MKSTEMP = 0 || test $REPLACE_MKSTEMP = 1; then
+  AC_LIBOBJ([mkstemp])
+  gl_PREREQ_MKSTEMP
+fi
+gl_STDLIB_MODULE_INDICATOR([mkstemp])
+gl_MULTIARCH
+gl_FUNC_NL_LANGINFO
+if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then
+  AC_LIBOBJ([nl_langinfo])
+fi
+gl_LANGINFO_MODULE_INDICATOR([nl_langinfo])
+gl_PATHMAX
+gl_FUNC_RAWMEMCHR
+if test $HAVE_RAWMEMCHR = 0; then
+  AC_LIBOBJ([rawmemchr])
+  gl_PREREQ_RAWMEMCHR
+fi
+gl_STRING_MODULE_INDICATOR([rawmemchr])
+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_POSIX
+if test $REPLACE_REALLOC = 1; then
+  AC_LIBOBJ([realloc])
+fi
+gl_STDLIB_MODULE_INDICATOR([realloc-posix])
+gl_REGEX
+if test $ac_use_included_regex = yes; then
+  AC_LIBOBJ([regex])
+  gl_PREREQ_REGEX
+fi
+gl_SAFE_ALLOC
+gl_HEADERS_SELINUX_SELINUX_H
+gl_HEADERS_SELINUX_CONTEXT_H
+AC_REQUIRE([AC_C_INLINE])
+if test "$with_selinux" != no && test "$ac_cv_header_selinux_selinux_h" = yes; then
+  AC_LIBOBJ([getfilecon])
+fi
+gl_SIZE_MAX
+gt_TYPE_SSIZE_T
+gl_FUNC_STAT
+if test $REPLACE_STAT = 1; then
+  AC_LIBOBJ([stat])
+  gl_PREREQ_STAT
+fi
+gl_SYS_STAT_MODULE_INDICATOR([stat])
+AM_STDBOOL_H
+gl_STDDEF_H
+gl_STDINT_H
+gl_STDIO_H
+gl_STDLIB_H
+gl_FUNC_STPCPY
+if test $HAVE_STPCPY = 0; then
+  AC_LIBOBJ([stpcpy])
+  gl_PREREQ_STPCPY
+fi
+gl_STRING_MODULE_INDICATOR([stpcpy])
+gl_FUNC_STPNCPY
+if test $HAVE_STPNCPY = 0 || test $REPLACE_STPNCPY = 1; then
+  AC_LIBOBJ([stpncpy])
+  gl_PREREQ_STPNCPY
+fi
+gl_STRING_MODULE_INDICATOR([stpncpy])
+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_HEADER_STRING_H
+gl_FUNC_STRNDUP
+if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then
+  AC_LIBOBJ([strndup])
+fi
+gl_STRING_MODULE_INDICATOR([strndup])
+gl_FUNC_STRNLEN
+if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then
+  AC_LIBOBJ([strnlen])
+  gl_PREREQ_STRNLEN
+fi
+gl_STRING_MODULE_INDICATOR([strnlen])
+gl_FUNC_STRSTR
+if test $REPLACE_STRSTR = 1; then
+  AC_LIBOBJ([strstr])
+fi
+gl_FUNC_STRSTR_SIMPLE
+if test $REPLACE_STRSTR = 1; then
+  AC_LIBOBJ([strstr])
+fi
+gl_STRING_MODULE_INDICATOR([strstr])
+gl_HEADER_SYS_STAT_H
+AC_PROG_MKDIR_P
+gl_HEADER_SYS_TIME_H
+AC_PROG_MKDIR_P
+gl_SYS_TYPES_H
+AC_PROG_MKDIR_P
+gl_SYS_WAIT_H
+AC_PROG_MKDIR_P
+gl_FUNC_GEN_TEMPNAME
+gl_HEADER_TIME_H
+gl_UNISTD_H
+gl_FUNC_VASNPRINTF
+gl_FUNC_VASPRINTF
+gl_STDIO_MODULE_INDICATOR([vasprintf])
+m4_ifdef([AM_XGETTEXT_OPTION],
+  [AM_][XGETTEXT_OPTION([--flag=asprintf:2:c-format])
+   AM_][XGETTEXT_OPTION([--flag=vasprintf:2:c-format])])
+gl_WCHAR_H
+gl_FUNC_WCRTOMB
+if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then
+  AC_LIBOBJ([wcrtomb])
+  gl_PREREQ_WCRTOMB
+fi
+gl_WCHAR_MODULE_INDICATOR([wcrtomb])
+gl_WCTYPE_H
+gl_XSIZE
   # End of code from modules
   m4_ifval(gl_LIBSOURCES_LIST, [
     m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ ||
@@ -418,74 +567,146 @@ changequote([, ])dnl
   AC_SUBST([gltests_WITNESS])
   gl_module_indicator_condition=$gltests_WITNESS
   m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition])
-  gt_LOCALE_FR
-  gt_LOCALE_FR_UTF8
-  gt_LOCALE_FR
-  gt_LOCALE_TR_UTF8
-  gl_FUNC_DUP2
-  gl_UNISTD_MODULE_INDICATOR([dup2])
-  gl_ENVIRON
-  gl_UNISTD_MODULE_INDICATOR([environ])
-  gl_FCNTL_H
-  gl_FUNC_GETPAGESIZE
-  gl_UNISTD_MODULE_INDICATOR([getpagesize])
-  AC_REQUIRE([AC_C_INLINE])
-  AC_CHECK_FUNCS_ONCE([newlocale])
-  gl_LOCALENAME
-  AC_CHECK_FUNCS_ONCE([newlocale])
-  gl_LOCK
-  gt_LOCALE_FR
-  gt_LOCALE_FR_UTF8
-  gt_LOCALE_JA
-  gt_LOCALE_ZH_CN
-  gt_LOCALE_FR_UTF8
-  gt_LOCALE_FR
-  gt_LOCALE_FR_UTF8
-  gt_LOCALE_JA
-  gt_LOCALE_ZH_CN
-  dnl Check for prerequisites for memory fence checks.
-  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_OPEN
-  gl_FCNTL_MODULE_INDICATOR([open])
-  gl_FUNC_PUTENV
-  gl_STDLIB_MODULE_INDICATOR([putenv])
-  gl_FUNC_SETENV
-  gl_STDLIB_MODULE_INDICATOR([setenv])
-  gl_FUNC_SETLOCALE
-  gl_LOCALE_MODULE_INDICATOR([setlocale])
-  gt_LOCALE_FR
-  gt_LOCALE_FR_UTF8
-  gt_LOCALE_JA
-  gt_LOCALE_ZH_CN
-  gt_TYPE_WCHAR_T
-  gt_TYPE_WINT_T
-  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_CHECK_DECLS_ONCE([alarm])
-  gl_FUNC_MMAP_ANON
-  AC_CHECK_HEADERS_ONCE([sys/mman.h])
-  AC_CHECK_FUNCS_ONCE([mprotect])
-  gl_FUNC_SYMLINK
-  gl_UNISTD_MODULE_INDICATOR([symlink])
-  gl_THREAD
-  gl_THREADLIB
-  gl_FUNC_UNSETENV
-  gl_STDLIB_MODULE_INDICATOR([unsetenv])
-  gt_LOCALE_FR
-  gt_LOCALE_FR_UTF8
-  gt_LOCALE_JA
-  gt_LOCALE_ZH_CN
-  gl_FUNC_WCTOB
-  gl_WCHAR_MODULE_INDICATOR([wctob])
-  gl_FUNC_WCTOMB
-  gl_STDLIB_MODULE_INDICATOR([wctomb])
-  gl_YIELD
+AC_REQUIRE([AC_C_INLINE])
+gt_LOCALE_FR
+gt_LOCALE_FR_UTF8
+gt_LOCALE_FR
+gt_LOCALE_TR_UTF8
+gl_FUNC_CLOSE
+if test $REPLACE_CLOSE = 1; then
+  AC_LIBOBJ([close])
+fi
+gl_UNISTD_MODULE_INDICATOR([close])
+gl_FUNC_DUP2
+if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
+  AC_LIBOBJ([dup2])
+  gl_PREREQ_DUP2
+fi
+gl_UNISTD_MODULE_INDICATOR([dup2])
+gl_ENVIRON
+gl_UNISTD_MODULE_INDICATOR([environ])
+gl_FUNC_FDOPEN
+if test $REPLACE_FDOPEN = 1; then
+  AC_LIBOBJ([fdopen])
+  gl_PREREQ_FDOPEN
+fi
+gl_STDIO_MODULE_INDICATOR([fdopen])
+gl_FUNC_FSTAT
+if test $REPLACE_FSTAT = 1; then
+  AC_LIBOBJ([fstat])
+  gl_PREREQ_FSTAT
+fi
+gl_SYS_STAT_MODULE_INDICATOR([fstat])
+gl_FUNC_GETCWD_LGPL
+if test $REPLACE_GETCWD = 1; then
+  AC_LIBOBJ([getcwd-lgpl])
+fi
+gl_UNISTD_MODULE_INDICATOR([getcwd])
+gl_FUNC_GETPAGESIZE
+if test $REPLACE_GETPAGESIZE = 1; then
+  AC_LIBOBJ([getpagesize])
+fi
+gl_UNISTD_MODULE_INDICATOR([getpagesize])
+AC_REQUIRE([AC_C_INLINE])
+gl_INTTYPES_H
+gl_INTTYPES_INCOMPLETE
+AC_CHECK_FUNCS_ONCE([newlocale])
+gl_LOCALENAME
+AC_CHECK_FUNCS_ONCE([newlocale])
+gl_LOCK
+gt_LOCALE_FR
+gt_LOCALE_FR_UTF8
+gt_LOCALE_JA
+gt_LOCALE_ZH_CN
+gt_LOCALE_FR_UTF8
+gt_LOCALE_FR
+gt_LOCALE_FR_UTF8
+gt_LOCALE_JA
+gt_LOCALE_ZH_CN
+dnl Check for prerequisites for memory fence checks.
+gl_FUNC_MMAP_ANON
+AC_CHECK_HEADERS_ONCE([sys/mman.h])
+AC_CHECK_FUNCS_ONCE([mprotect])
+gl_MSVC_INVAL
+if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+  AC_LIBOBJ([msvc-inval])
+fi
+gl_MSVC_NOTHROW
+if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+  AC_LIBOBJ([msvc-nothrow])
+fi
+gt_LOCALE_FR
+gt_LOCALE_FR_UTF8
+gl_FUNC_OPEN
+if test $REPLACE_OPEN = 1; then
+  AC_LIBOBJ([open])
+  gl_PREREQ_OPEN
+fi
+gl_FCNTL_MODULE_INDICATOR([open])
+gl_FUNC_PUTENV
+if test $REPLACE_PUTENV = 1; then
+  AC_LIBOBJ([putenv])
+fi
+gl_STDLIB_MODULE_INDICATOR([putenv])
+dnl Check for prerequisites for memory fence checks.
+gl_FUNC_MMAP_ANON
+AC_CHECK_HEADERS_ONCE([sys/mman.h])
+AC_CHECK_FUNCS_ONCE([mprotect])
+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
+gt_TYPE_WCHAR_T
+gt_TYPE_WINT_T
+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_CHECK_DECLS_ONCE([alarm])
+gl_FUNC_MMAP_ANON
+AC_CHECK_HEADERS_ONCE([sys/mman.h])
+AC_CHECK_FUNCS_ONCE([mprotect])
+gl_FUNC_SYMLINK
+if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then
+  AC_LIBOBJ([symlink])
+fi
+gl_UNISTD_MODULE_INDICATOR([symlink])
+gl_THREAD
+gl_THREADLIB
+gl_FUNC_UNSETENV
+if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then
+  AC_LIBOBJ([unsetenv])
+  gl_PREREQ_UNSETENV
+fi
+gl_STDLIB_MODULE_INDICATOR([unsetenv])
+gt_LOCALE_FR
+gt_LOCALE_FR_UTF8
+gt_LOCALE_JA
+gt_LOCALE_ZH_CN
+gl_FUNC_WCTOB
+if test $HAVE_WCTOB = 0 || test $REPLACE_WCTOB = 1; then
+  AC_LIBOBJ([wctob])
+  gl_PREREQ_WCTOB
+fi
+gl_WCHAR_MODULE_INDICATOR([wctob])
+gl_FUNC_WCTOMB
+if test $REPLACE_WCTOMB = 1; then
+  AC_LIBOBJ([wctomb])
+  gl_PREREQ_WCTOMB
+fi
+gl_STDLIB_MODULE_INDICATOR([wctomb])
+gl_YIELD
   m4_popdef([gl_MODULE_INDICATOR_CONDITION])
   m4_ifval(gltests_LIBSOURCES_LIST, [
     m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ ||
@@ -578,12 +799,13 @@ AC_DEFUN([gltests_LIBSOURCES], [
 # This macro records the list of files which have been installed by
 # gnulib-tool and may be removed by future gnulib-tool invocations.
 AC_DEFUN([gl_FILE_LIST], [
-  build-aux/arg-nonnull.h
-  build-aux/c++defs.h
   build-aux/config.rpath
   build-aux/gitlog-to-changelog
-  build-aux/unused-parameter.h
-  build-aux/warn-on-use.h
+  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
   lib/alloca.c
   lib/alloca.in.h
   lib/argz.c
@@ -596,7 +818,9 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/ctype.in.h
   lib/dosname.h
   lib/errno.in.h
+  lib/fcntl.in.h
   lib/float+.h
+  lib/float.c
   lib/float.in.h
   lib/fnmatch.c
   lib/fnmatch.in.h
@@ -609,11 +833,14 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/getopt1.c
   lib/getopt_int.h
   lib/gettext.h
+  lib/gettimeofday.c
   lib/isblank.c
+  lib/itold.c
   lib/langinfo.in.h
   lib/localcharset.c
   lib/localcharset.h
   lib/locale.in.h
+  lib/localeconv.c
   lib/lstat.c
   lib/malloc.c
   lib/malloca.c
@@ -629,12 +856,15 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/memchr.c
   lib/memchr.valgrind
   lib/mempcpy.c
+  lib/mkstemp.c
   lib/nl_langinfo.c
   lib/pathmax.h
   lib/printf-args.c
   lib/printf-args.h
   lib/printf-parse.c
   lib/printf-parse.h
+  lib/rawmemchr.c
+  lib/rawmemchr.valgrind
   lib/readlink.c
   lib/realloc.c
   lib/ref-add.sin
@@ -659,6 +889,8 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/stpcpy.c
   lib/stpncpy.c
   lib/str-two-way.h
+  lib/strchrnul.c
+  lib/strchrnul.valgrind
   lib/streq.h
   lib/string.in.h
   lib/strndup.c
@@ -667,7 +899,11 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/strnlen1.h
   lib/strstr.c
   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/time.in.h
   lib/unistd.in.h
   lib/vasnprintf.c
@@ -683,6 +919,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/argz.m4
   m4/btowc.m4
   m4/canonicalize.m4
+  m4/close.m4
   m4/codeset.m4
   m4/configmake.m4
   m4/ctype.m4
@@ -691,23 +928,32 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/eealloc.m4
   m4/environ.m4
   m4/errno_h.m4
+  m4/exponentd.m4
   m4/extensions.m4
   m4/fcntl-o.m4
   m4/fcntl_h.m4
+  m4/fdopen.m4
   m4/float_h.m4
   m4/fnmatch.m4
+  m4/fpieee.m4
+  m4/fstat.m4
+  m4/getcwd.m4
   m4/getdelim.m4
   m4/getline.m4
   m4/getopt.m4
   m4/getpagesize.m4
+  m4/gettimeofday.m4
   m4/glibc21.m4
   m4/gnulib-common.m4
   m4/include_next.m4
   m4/intlmacosx.m4
   m4/intmax_t.m4
+  m4/inttypes-pri.m4
+  m4/inttypes.m4
   m4/inttypes_h.m4
   m4/isblank.m4
   m4/langinfo_h.m4
+  m4/largefile.m4
   m4/lcmessage.m4
   m4/lib-ld.m4
   m4/lib-link.m4
@@ -718,12 +964,14 @@ AC_DEFUN([gl_FILE_LIST], [
   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/lstat.m4
   m4/malloc.m4
   m4/malloca.m4
+  m4/math_h.m4
   m4/mbrtowc.m4
   m4/mbsinit.m4
   m4/mbsrtowcs.m4
@@ -731,15 +979,21 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/mbtowc.m4
   m4/memchr.m4
   m4/mempcpy.m4
+  m4/mkstemp.m4
   m4/mmap-anon.m4
   m4/mode_t.m4
+  m4/msvc-inval.m4
+  m4/msvc-nothrow.m4
   m4/multiarch.m4
   m4/nl_langinfo.m4
+  m4/nocrash.m4
+  m4/off_t.m4
   m4/onceonly.m4
   m4/open.m4
   m4/pathmax.m4
   m4/printf.m4
   m4/putenv.m4
+  m4/rawmemchr.m4
   m4/readlink.m4
   m4/realloc.m4
   m4/regex.m4
@@ -759,13 +1013,18 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/stdlib_h.m4
   m4/stpcpy.m4
   m4/stpncpy.m4
+  m4/strchrnul.m4
   m4/string_h.m4
   m4/strndup.m4
   m4/strnlen.m4
   m4/strstr.m4
   m4/symlink.m4
+  m4/sys_socket_h.m4
   m4/sys_stat_h.m4
+  m4/sys_time_h.m4
+  m4/sys_types_h.m4
   m4/sys_wait_h.m4
+  m4/tempname.m4
   m4/thread.m4
   m4/threadlib.m4
   m4/time_h.m4
@@ -796,21 +1055,35 @@ AC_DEFUN([gl_FILE_LIST], [
   tests/test-c-strcasecmp.c
   tests/test-c-strncasecmp.c
   tests/test-canonicalize-lgpl.c
+  tests/test-close.c
   tests/test-ctype.c
   tests/test-dup2.c
   tests/test-environ.c
   tests/test-errno.c
   tests/test-fcntl-h.c
+  tests/test-fdopen.c
+  tests/test-fgetc.c
+  tests/test-float.c
   tests/test-fnmatch.c
+  tests/test-fputc.c
+  tests/test-fread.c
+  tests/test-fstat.c
+  tests/test-fwrite.c
+  tests/test-getcwd-lgpl.c
   tests/test-getdelim.c
   tests/test-getline.c
   tests/test-getopt.c
   tests/test-getopt.h
   tests/test-getopt_long.h
+  tests/test-gettimeofday.c
   tests/test-ignore-value.c
+  tests/test-init.sh
+  tests/test-intprops.c
+  tests/test-inttypes.c
   tests/test-isblank.c
   tests/test-langinfo.c
   tests/test-locale.c
+  tests/test-localeconv.c
   tests/test-localename.c
   tests/test-lock.c
   tests/test-lstat.c
@@ -840,6 +1113,8 @@ AC_DEFUN([gl_FILE_LIST], [
   tests/test-nl_langinfo.sh
   tests/test-open.c
   tests/test-open.h
+  tests/test-pathmax.c
+  tests/test-rawmemchr.c
   tests/test-readlink.c
   tests/test-readlink.h
   tests/test-safe-alloc.c
@@ -855,14 +1130,19 @@ AC_DEFUN([gl_FILE_LIST], [
   tests/test-stdint.c
   tests/test-stdio.c
   tests/test-stdlib.c
+  tests/test-strchrnul.c
   tests/test-string.c
   tests/test-strnlen.c
   tests/test-strstr.c
   tests/test-symlink.c
   tests/test-symlink.h
   tests/test-sys_stat.c
+  tests/test-sys_time.c
+  tests/test-sys_types.c
   tests/test-sys_wait.c
   tests/test-sys_wait.h
+  tests/test-thread_create.c
+  tests/test-thread_self.c
   tests/test-time.c
   tests/test-unistd.c
   tests/test-unsetenv.c
@@ -887,8 +1167,14 @@ AC_DEFUN([gl_FILE_LIST], [
   tests=lib/c-strcase.h
   tests=lib/c-strcasecmp.c
   tests=lib/c-strncasecmp.c
+  tests=lib/close.c
   tests=lib/dup2.c
-  tests=lib/fcntl.in.h
+  tests=lib/fd-hook.c
+  tests=lib/fd-hook.h
+  tests=lib/fdopen.c
+  tests=lib/fpucw.h
+  tests=lib/fstat.c
+  tests=lib/getcwd-lgpl.c
   tests=lib/getpagesize.c
   tests=lib/glthread/lock.c
   tests=lib/glthread/lock.h
@@ -898,8 +1184,13 @@ AC_DEFUN([gl_FILE_LIST], [
   tests=lib/glthread/yield.h
   tests=lib/ignore-value.h
   tests=lib/intprops.h
+  tests=lib/inttypes.in.h
   tests=lib/localename.c
   tests=lib/localename.h
+  tests=lib/msvc-inval.c
+  tests=lib/msvc-inval.h
+  tests=lib/msvc-nothrow.c
+  tests=lib/msvc-nothrow.h
   tests=lib/open.c
   tests=lib/putenv.c
   tests=lib/same-inode.h
index b3c7849..a60a261 100644 (file)
@@ -1,5 +1,5 @@
-# include_next.m4 serial 18
-dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
+# include_next.m4 serial 23
+dnl Copyright (C) 2006-2012 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.
@@ -143,7 +143,7 @@ choke me
 # even if the compiler does not support include_next.
 # The three "///" are to pacify Sun C 5.8, which otherwise would say
 # "warning: #include of /usr/include/... may be non-portable".
-# Use `""', not `<>', so that the /// cannot be confused with a C99 comment.
+# Use '""', not '<>', so that the /// cannot be confused with a C99 comment.
 # Note: This macro assumes that the header file is not empty after
 # preprocessing, i.e. it does not only define preprocessor macros but also
 # provides some type/enum definitions or function/variable declarations.
@@ -175,11 +175,13 @@ 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])[>],
@@ -205,33 +207,57 @@ AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
                  aix*) gl_absname_cpp="$ac_cpp -C" ;;
                  *)    gl_absname_cpp="$ac_cpp" ;;
                esac
+changequote(,)
+               case "$host_os" in
+                 mingw*)
+                   dnl For the sake of native Windows compilers (excluding gcc),
+                   dnl treat backslash as a directory separator, like /.
+                   dnl Actually, these compilers use a double-backslash as
+                   dnl directory separator, inside the
+                   dnl   # line "filename"
+                   dnl directives.
+                   gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+               dnl A sed expression that turns a string into a basic regular
+               dnl expression, for use within "/.../".
+               gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+changequote([,])
+               gl_header_literal_regex=`echo ']m4_defn([gl_HEADER_NAME])[' \
+                                        | 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/
+changequote(,)dnl
+                   s|^/[^/]|//&|
+changequote([,])dnl
+                   p
+                   q
+                 }'
                dnl eval is necessary to expand gl_absname_cpp.
                dnl Ultrix and Pyramid sh refuse to redirect output of eval,
                dnl so use subshell.
-               AS_VAR_SET([gl_next_header],
+               AS_VAR_SET(gl_next_header,
                  ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
-                  sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
-                    s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
-                    s#^/[^/]#//&#
-                    p
-                    q
-                  }'`'"'])
+                      sed -n "$gl_absolute_header_sed"`'"'])
           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])),
index 51f8547..d4da190 100644 (file)
@@ -1,5 +1,5 @@
-# intlmacosx.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2004-2011 Free Software Foundation, Inc.
+# intlmacosx.m4 serial 5 (gettext-0.18.2)
+dnl Copyright (C) 2004-2012 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,11 @@ 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 Checks for special options needed on MacOS X.
+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 MacOS X 10.2.
+  dnl Check for API introduced in Mac OS X 10.2.
   AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
     [gt_cv_func_CFPreferencesCopyAppValue],
     [gt_save_LIBS="$LIBS"
@@ -31,9 +31,9 @@ AC_DEFUN([gt_INTL_MACOSX],
      LIBS="$gt_save_LIBS"])
   if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
     AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
-      [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
+      [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
   fi
-  dnl Check for API introduced in MacOS X 10.3.
+  dnl Check for API introduced in Mac OS X 10.3.
   AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
     [gt_save_LIBS="$LIBS"
      LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
@@ -46,7 +46,7 @@ AC_DEFUN([gt_INTL_MACOSX],
      LIBS="$gt_save_LIBS"])
   if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
     AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
-      [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
+      [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
   fi
   INTL_MACOSX_LIBS=
   if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
index 7341054..c1a4a75 100644 (file)
@@ -1,5 +1,5 @@
 # intmax_t.m4 serial 8
-dnl Copyright (C) 1997-2004, 2006-2007, 2009-2011 Free Software Foundation,
+dnl Copyright (C) 1997-2004, 2006-2007, 2009-2012 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,
diff --git a/gnulib/m4/inttypes-pri.m4 b/gnulib/m4/inttypes-pri.m4
new file mode 100644 (file)
index 0000000..977206f
--- /dev/null
@@ -0,0 +1,42 @@
+# inttypes-pri.m4 serial 7 (gettext-0.18.2)
+dnl Copyright (C) 1997-2002, 2006, 2008-2012 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])
+])
diff --git a/gnulib/m4/inttypes.m4 b/gnulib/m4/inttypes.m4
new file mode 100644 (file)
index 0000000..eec4f41
--- /dev/null
@@ -0,0 +1,157 @@
+# inttypes.m4 serial 26
+dnl Copyright (C) 2006-2012 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 Derek Price, Bruno Haible.
+dnl Test whether <inttypes.h> is supported or must be substituted.
+
+AC_DEFUN([gl_INTTYPES_H],
+[
+  AC_REQUIRE([gl_INTTYPES_INCOMPLETE])
+  gl_INTTYPES_PRI_SCN
+])
+
+AC_DEFUN_ONCE([gl_INTTYPES_INCOMPLETE],
+[
+  AC_REQUIRE([gl_STDINT_H])
+  AC_CHECK_HEADERS_ONCE([inttypes.h])
+
+  dnl Override <inttypes.h> always, so that the portability warnings work.
+  AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
+  gl_CHECK_NEXT_HEADERS([inttypes.h])
+
+  AC_REQUIRE([gl_MULTIARCH])
+
+  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 <inttypes.h>
+    ]], [imaxabs imaxdiv strtoimax strtoumax])
+])
+
+# 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"'
+  else
+    dnl Using the system's <stdint.h>.
+    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
+      AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM([[#include <stdint.h>
+           extern intptr_t foo;
+           extern $gltype1 foo;]])],
+        [PRIPTR_PREFIX='"'$glpfx'"'])
+      test -n "$PRIPTR_PREFIX" && break
+    done
+  fi
+  AC_SUBST([PRIPTR_PREFIX])
+
+  gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+    [INT32_MAX_LT_INTMAX_MAX],
+    [defined INT32_MAX && defined INTMAX_MAX],
+    [INT32_MAX < INTMAX_MAX],
+    [sizeof (int) < sizeof (long long int)])
+  if test $APPLE_UNIVERSAL_BUILD = 0; then
+    gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+      [INT64_MAX_EQ_LONG_MAX],
+      [defined INT64_MAX],
+      [INT64_MAX == LONG_MAX],
+      [sizeof (long long int) == sizeof (long int)])
+  else
+    INT64_MAX_EQ_LONG_MAX=-1
+  fi
+  gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+    [UINT32_MAX_LT_UINTMAX_MAX],
+    [defined UINT32_MAX && defined UINTMAX_MAX],
+    [UINT32_MAX < UINTMAX_MAX],
+    [sizeof (unsigned int) < sizeof (unsigned long long int)])
+  if test $APPLE_UNIVERSAL_BUILD = 0; then
+    gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+      [UINT64_MAX_EQ_ULONG_MAX],
+      [defined UINT64_MAX],
+      [UINT64_MAX == ULONG_MAX],
+      [sizeof (unsigned long long int) == sizeof (unsigned long int)])
+  else
+    UINT64_MAX_EQ_ULONG_MAX=-1
+  fi
+])
+
+# Define the symbol $1 to be 1 if the condition is true, 0 otherwise.
+# If $2 is true, the condition is $3; otherwise if long long int is supported
+# approximate the condition with $4; otherwise, assume the condition is false.
+# The condition should work on all C99 platforms; the approximations should be
+# good enough to work on all practical pre-C99 platforms.
+# $2 is evaluated by the C preprocessor, $3 and $4 as compile-time constants.
+AC_DEFUN([gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION],
+[
+  AC_CACHE_CHECK([whether $3],
+    [gl_cv_test_$1],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[/* 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 $2
+             #define CONDITION ($3)
+            #elif HAVE_LONG_LONG_INT
+             #define CONDITION ($4)
+            #else
+             #define CONDITION 0
+            #endif
+            int test[CONDITION ? 1 : -1];]])],
+       [gl_cv_test_$1=yes],
+       [gl_cv_test_$1=no])])
+  if test $gl_cv_test_$1 = yes; then
+    $1=1;
+  else
+    $1=0;
+  fi
+  AC_SUBST([$1])
+])
+
+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])
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+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])
+  REPLACE_STRTOIMAX=0;   AC_SUBST([REPLACE_STRTOIMAX])
+  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 f10fd54..91c7bca 100644 (file)
@@ -1,5 +1,5 @@
 # inttypes_h.m4 serial 10
-dnl Copyright (C) 1997-2004, 2006, 2008-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2012 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 771deef..98e926d 100644 (file)
@@ -1,5 +1,5 @@
-# isblank.m4 serial 2
-dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
+# isblank.m4 serial 3
+dnl Copyright (C) 2009-2012 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,6 +13,5 @@ AC_DEFUN([gl_FUNC_ISBLANK],
   AC_CHECK_FUNCS_ONCE([isblank])
   if test $ac_cv_func_isblank = no; then
     HAVE_ISBLANK=0
-    AC_LIBOBJ([isblank])
   fi
 ])
index 4cced8a..b93fe70 100644 (file)
@@ -1,5 +1,5 @@
 # langinfo_h.m4 serial 7
-dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2012 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/gnulib/m4/largefile.m4 b/gnulib/m4/largefile.m4
new file mode 100644 (file)
index 0000000..a88850a
--- /dev/null
@@ -0,0 +1,149 @@
+# Enable large files on systems where this is not the default.
+
+# Copyright 1992-1996, 1998-2012 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 implementation works around a problem in autoconf <= 2.68;
+# AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5.
+m4_version_prereq([2.69], [] ,[
+
+# _AC_SYS_LARGEFILE_TEST_INCLUDES
+# -------------------------------
+m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES],
+[@%:@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))
+  int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721
+                       && LARGE_OFF_T % 2147483647 == 1)
+                      ? 1 : -1]];[]dnl
+])
+
+
+# _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE,
+#                              CACHE-VAR,
+#                              DESCRIPTION,
+#                              PROLOGUE, [FUNCTION-BODY])
+# --------------------------------------------------------
+m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE],
+[AC_CACHE_CHECK([for $1 value needed for large files], [$3],
+[while :; do
+  m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
+    [AC_LANG_PROGRAM([$5], [$6])],
+    [$3=no; break])
+  m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
+    [AC_LANG_PROGRAM([@%:@define $1 $2
+$5], [$6])],
+    [$3=$2; break])
+  $3=unknown
+  break
+done])
+case $$3 in #(
+  no | unknown) ;;
+  *) AC_DEFINE_UNQUOTED([$1], [$$3], [$4]);;
+esac
+rm -rf conftest*[]dnl
+])# _AC_SYS_LARGEFILE_MACRO_VALUE
+
+
+# AC_SYS_LARGEFILE
+# ----------------
+# 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
+AC_DEFUN([AC_SYS_LARGEFILE],
+[AC_ARG_ENABLE(largefile,
+               [  --disable-largefile     omit support for large files])
+if test "$enable_largefile" != no; then
+
+  AC_CACHE_CHECK([for special C compiler options needed for large files],
+    ac_cv_sys_largefile_CC,
+    [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.
+         AC_LANG_CONFTEST([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_INCLUDES])])
+         AC_COMPILE_IFELSE([], [break])
+         CC="$CC -n32"
+         AC_COMPILE_IFELSE([], [ac_cv_sys_largefile_CC=' -n32'; break])
+         break
+       done
+       CC=$ac_save_CC
+       rm -f conftest.$ac_ext
+    fi])
+  if test "$ac_cv_sys_largefile_CC" != no; then
+    CC=$CC$ac_cv_sys_largefile_CC
+  fi
+
+  _AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
+    ac_cv_sys_file_offset_bits,
+    [Number of bits in a file offset, on hosts where this is settable.],
+    [_AC_SYS_LARGEFILE_TEST_INCLUDES])
+  if test $ac_cv_sys_file_offset_bits = unknown; then
+    _AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
+      ac_cv_sys_large_files,
+      [Define for large files, on AIX-style hosts.],
+      [_AC_SYS_LARGEFILE_TEST_INCLUDES])
+  fi
+
+  AH_VERBATIM([_DARWIN_USE_64_BIT_INODE],
+[/* Enable large inode numbers on Mac OS X.  */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif])
+fi
+])# AC_SYS_LARGEFILE
+
+])# m4_version_prereq 2.69
+
+# Enable large files on systems where this is implemented by Gnulib, not by the
+# system headers.
+# Set the variables WINDOWS_64_BIT_OFF_T, WINDOWS_64_BIT_ST_SIZE if Gnulib
+# overrides ensure that off_t or 'struct size.st_size' are 64-bit, respectively.
+AC_DEFUN([gl_LARGEFILE],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  case "$host_os" in
+    mingw*)
+      dnl Native Windows.
+      dnl mingw64 defines off_t to a 64-bit type already, if
+      dnl _FILE_OFFSET_BITS=64, which is ensured by AC_SYS_LARGEFILE.
+      AC_CACHE_CHECK([for 64-bit off_t], [gl_cv_type_off_t_64],
+        [AC_COMPILE_IFELSE(
+           [AC_LANG_PROGRAM(
+              [[#include <sys/types.h>
+                int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1];
+              ]],
+              [[]])],
+           [gl_cv_type_off_t_64=yes], [gl_cv_type_off_t_64=no])
+        ])
+      if test $gl_cv_type_off_t_64 = no; then
+        WINDOWS_64_BIT_OFF_T=1
+      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 Nothing to do on gnulib's side.
+      dnl A 64-bit off_t is
+      dnl   - already the default on Mac OS X, FreeBSD, NetBSD, OpenBSD, IRIX,
+      dnl     OSF/1, Cygwin,
+      dnl   - enabled by _FILE_OFFSET_BITS=64 (ensured by AC_SYS_LARGEFILE) on
+      dnl     glibc, HP-UX, Solaris,
+      dnl   - enabled by _LARGE_FILES=1 (ensured by AC_SYS_LARGEFILE) on AIX,
+      dnl   - impossible to achieve on Minix 3.1.8.
+      WINDOWS_64_BIT_OFF_T=0
+      WINDOWS_64_BIT_ST_SIZE=0
+      ;;
+  esac
+])
index baf41c5..4ed0eb6 100644 (file)
@@ -1,5 +1,5 @@
 # lcmessage.m4 serial 7 (gettext-0.18.2)
-dnl Copyright (C) 1995-2002, 2004-2005, 2008-2011 Free Software Foundation,
+dnl Copyright (C) 1995-2002, 2004-2005, 2008-2012 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 ae003f7..4e1374d 100644 (file)
@@ -1,5 +1,5 @@
 # lib-ld.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 1996-2003, 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 1996-2003, 2009-2012 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 e7c9ba9..d11b4b4 100644 (file)
@@ -1,5 +1,5 @@
 # lib-link.m4 serial 26 (gettext-0.18.2)
-dnl Copyright (C) 2001-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2012 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 7e5f0bd..007aa05 100644 (file)
@@ -1,5 +1,5 @@
 # lib-prefix.m4 serial 7 (gettext-0.18)
-dnl Copyright (C) 2001-2005, 2008-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2005, 2008-2012 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 88de383..126202f 100644 (file)
@@ -1,8 +1,8 @@
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 #
 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-#                 Inc.
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 # This file is free software; the Free Software Foundation gives
@@ -11,8 +11,8 @@
 
 m4_define([_LT_COPYING], [dnl
 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-#                 Inc.
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 #   This file is part of GNU Libtool.
@@ -146,6 +146,8 @@ AC_REQUIRE([AC_CANONICAL_BUILD])dnl
 AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
 
+_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
+dnl
 _LT_DECL([], [host_alias], [0], [The host system])dnl
 _LT_DECL([], [host], [0])dnl
 _LT_DECL([], [host_os], [0])dnl
@@ -637,7 +639,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
 configured by $[0], generated by m4_PACKAGE_STRING.
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2011 Free Software Foundation, Inc.
 This config.lt script is free software; the Free Software Foundation
 gives unlimited permision to copy, distribute and modify it."
 
@@ -801,6 +803,7 @@ AC_DEFUN([LT_LANG],
 m4_case([$1],
   [C],                 [_LT_LANG(C)],
   [C++],               [_LT_LANG(CXX)],
+  [Go],                        [_LT_LANG(GO)],
   [Java],              [_LT_LANG(GCJ)],
   [Fortran 77],                [_LT_LANG(F77)],
   [Fortran],           [_LT_LANG(FC)],
@@ -822,6 +825,31 @@ m4_defun([_LT_LANG],
 ])# _LT_LANG
 
 
+m4_ifndef([AC_PROG_GO], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+############################################################
+m4_defun([AC_PROG_GO],
+[AC_LANG_PUSH(Go)dnl
+AC_ARG_VAR([GOC],     [Go compiler command])dnl
+AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+AC_CHECK_TOOL(GOC, gccgo)
+if test -z "$GOC"; then
+  if test -n "$ac_tool_prefix"; then
+    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
+  fi
+fi
+if test -z "$GOC"; then
+  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
+fi
+])#m4_defun
+])#m4_ifndef
+
+
 # _LT_LANG_DEFAULT_CONFIG
 # -----------------------
 m4_defun([_LT_LANG_DEFAULT_CONFIG],
@@ -852,6 +880,10 @@ AC_PROVIDE_IFELSE([AC_PROG_GCJ],
        m4_ifdef([LT_PROG_GCJ],
        [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
 
+AC_PROVIDE_IFELSE([AC_PROG_GO],
+  [LT_LANG(GO)],
+  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
+
 AC_PROVIDE_IFELSE([LT_PROG_RC],
   [LT_LANG(RC)],
   [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
@@ -954,7 +986,13 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
        $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
          -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
         _lt_result=$?
-       if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+       # If there is a non-empty error log, and "single_module"
+       # appears in it, assume the flag caused a linker warning
+        if test -s conftest.err && $GREP single_module conftest.err; then
+         cat conftest.err >&AS_MESSAGE_LOG_FD
+       # Otherwise, if the output was created with a 0 exit code from
+       # the compiler, it worked.
+       elif test -f libconftest.dylib && test $_lt_result -eq 0; then
          lt_cv_apple_cc_single_mod=yes
        else
          cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -962,6 +1000,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
        rm -rf libconftest.dylib*
        rm -f conftest.*
       fi])
+
     AC_CACHE_CHECK([for -exported_symbols_list linker flag],
       [lt_cv_ld_exported_symbols_list],
       [lt_cv_ld_exported_symbols_list=no
@@ -973,6 +1012,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
        [lt_cv_ld_exported_symbols_list=no])
        LDFLAGS="$save_LDFLAGS"
     ])
+
     AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
       [lt_cv_ld_force_load=no
       cat > conftest.c << _LT_EOF
@@ -990,7 +1030,9 @@ _LT_EOF
       echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
       $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
       _lt_result=$?
-      if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+      if test -s conftest.err && $GREP force_load conftest.err; then
+       cat conftest.err >&AS_MESSAGE_LOG_FD
+      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
        lt_cv_ld_force_load=yes
       else
        cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -1035,8 +1077,8 @@ _LT_EOF
 ])
 
 
-# _LT_DARWIN_LINKER_FEATURES
-# --------------------------
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
 # Checks for linker and compiler features on darwin
 m4_defun([_LT_DARWIN_LINKER_FEATURES],
 [
@@ -1047,6 +1089,8 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
   if test "$lt_cv_ld_force_load" = "yes"; then
     _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
+                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
   else
     _LT_TAGVAR(whole_archive_flag_spec, $1)=''
   fi
@@ -1268,7 +1312,7 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
@@ -1282,7 +1326,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
          x86_64-*linux*)
            LD="${LD-ld} -m elf_i386"
            ;;
-         ppc64-*linux*|powerpc64-*linux*)
+         powerpcle-*linux*)
+           LD="${LD-ld} -m elf32lppclinux"
+           ;;
+         powerpc-*linux*)
            LD="${LD-ld} -m elf32ppclinux"
            ;;
          s390x-*linux*)
@@ -1301,7 +1348,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
          x86_64-*linux*)
            LD="${LD-ld} -m elf_x86_64"
            ;;
-         ppc*-*linux*|powerpc*-*linux*)
+         powerpcle-*linux*)
+           LD="${LD-ld} -m elf64lppc"
+           ;;
+         powerpc-*linux*)
            LD="${LD-ld} -m elf64ppc"
            ;;
          s390*-*linux*|s390*-*tpf*)
@@ -1330,14 +1380,27 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
     CFLAGS="$SAVE_CFLAGS"
   fi
   ;;
-sparc*-*solaris*)
+*-*solaris*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.o` in
     *64-bit*)
       case $lt_cv_prog_gnu_ld in
-      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      yes*)
+        case $host in
+        i?86-*-solaris*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        sparc*-*-solaris*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+        esac
+        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
+        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+          LD="${LD-ld}_sol2"
+        fi
+        ;;
       *)
        if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
          LD="${LD-ld} -64"
@@ -1414,13 +1477,13 @@ old_postuninstall_cmds=
 if test -n "$RANLIB"; then
   case $host_os in
   openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
     ;;
   *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
     ;;
   esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
 fi
 
 case $host_os in
@@ -1600,6 +1663,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     lt_cv_sys_max_cmd_len=196608
     ;;
 
+  os2*)
+    # The test takes a long time on OS/2.
+    lt_cv_sys_max_cmd_len=8192
+    ;;
+
   osf*)
     # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
     # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
@@ -1639,7 +1707,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
       # If test is not a shell built-in, we'll probably end up computing a
       # maximum length that is only half of the actual maximum length, but
       # we can't tell.
-      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
                 = "X$teststring$teststring"; } >/dev/null 2>&1 &&
              test $i != 17 # 1/2 MB should be enough
       do
@@ -2185,7 +2253,7 @@ need_version=unknown
 
 case $host_os in
 aix3*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
@@ -2194,7 +2262,7 @@ aix3*)
   ;;
 
 aix[[4-9]]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
@@ -2259,7 +2327,7 @@ beos*)
   ;;
 
 bsdi[[45]]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
@@ -2398,7 +2466,7 @@ m4_if([$1], [],[
   ;;
 
 dgux*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
@@ -2406,10 +2474,6 @@ dgux*)
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
 freebsd* | dragonfly*)
   # DragonFly does not have aout.  When/if they implement a new
   # versioning mechanism, adjust this.
@@ -2417,7 +2481,7 @@ freebsd* | dragonfly*)
     objformat=`/usr/bin/objformat`
   else
     case $host_os in
-    freebsd[[123]]*) objformat=aout ;;
+    freebsd[[23]].*) objformat=aout ;;
     *) objformat=elf ;;
     esac
   fi
@@ -2435,7 +2499,7 @@ freebsd* | dragonfly*)
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
-  freebsd2*)
+  freebsd2.*)
     shlibpath_overrides_runpath=yes
     ;;
   freebsd3.[[01]]* | freebsdelf3.[[01]]*)
@@ -2455,17 +2519,18 @@ freebsd* | dragonfly*)
   ;;
 
 gnu*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
   ;;
 
 haiku*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   dynamic_linker="$host_os runtime_loader"
@@ -2526,7 +2591,7 @@ hpux9* | hpux10* | hpux11*)
   ;;
 
 interix[[3-9]]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
@@ -2542,7 +2607,7 @@ irix5* | irix6* | nonstopux*)
     nonstopux*) version_type=nonstopux ;;
     *)
        if test "$lt_cv_prog_gnu_ld" = yes; then
-               version_type=linux
+               version_type=linux # correct to gnu/linux during the next big refactor
        else
                version_type=irix
        fi ;;
@@ -2579,9 +2644,9 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
-# This must be Linux ELF.
+# This must be glibc/ELF.
 linux* | k*bsd*-gnu | kopensolaris*-gnu)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -2648,7 +2713,7 @@ netbsd*)
   ;;
 
 newsos6)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
@@ -2717,7 +2782,7 @@ rdos*)
   ;;
 
 solaris*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -2742,7 +2807,7 @@ sunos4*)
   ;;
 
 sysv4 | sysv4.3*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
@@ -2766,7 +2831,7 @@ sysv4 | sysv4.3*)
 
 sysv4*MP*)
   if test -d /usr/nec ;then
-    version_type=linux
+    version_type=linux # correct to gnu/linux during the next big refactor
     library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
     soname_spec='$libname${shared_ext}.$major'
     shlibpath_var=LD_LIBRARY_PATH
@@ -2797,7 +2862,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
 
 tpf*)
   # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -2807,7 +2872,7 @@ tpf*)
   ;;
 
 uts4*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
@@ -3229,7 +3294,7 @@ irix5* | irix6* | nonstopux*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-# This must be Linux ELF.
+# This must be glibc/ELF.
 linux* | k*bsd*-gnu | kopensolaris*-gnu)
   lt_cv_deplibs_check_method=pass_all
   ;;
@@ -3649,6 +3714,7 @@ for ac_symprfx in "" "_"; do
     # which start with @ or ?.
     lt_cv_sys_global_symbol_pipe="$AWK ['"\
 "     {last_section=section; section=\$ 3};"\
+"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
 "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
 "     \$ 0!~/External *\|/{next};"\
 "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
@@ -4233,7 +4299,9 @@ m4_if([$1], [CXX], [
     case $cc_basename in
     nvcc*) # Cuda Compiler Driver 2.2
       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
+      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
+      fi
       ;;
     esac
   else
@@ -4325,18 +4393,33 @@ m4_if([$1], [CXX], [
        ;;
       *)
        case `$CC -V 2>&1 | sed 5q` in
-       *Sun\ F* | *Sun*Fortran*)
+       *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
          # Sun Fortran 8.3 passes all unrecognized flags to the linker
          _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
          _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
          _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
          ;;
+       *Sun\ F* | *Sun*Fortran*)
+         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+         ;;
        *Sun\ C*)
          # Sun C 5.9
          _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
          _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
          _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
          ;;
+        *Intel*\ [[CF]]*Compiler*)
+         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+         ;;
+       *Portland\ Group*)
+         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+         ;;
        esac
        ;;
       esac
@@ -4496,7 +4579,9 @@ m4_if([$1], [CXX], [
     ;;
   cygwin* | mingw* | cegcc*)
     case $cc_basename in
-    cl*) ;;
+    cl*)
+      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+      ;;
     *)
       _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
       _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
@@ -4521,7 +4606,6 @@ m4_if([$1], [CXX], [
   _LT_TAGVAR(hardcode_direct, $1)=no
   _LT_TAGVAR(hardcode_direct_absolute, $1)=no
   _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
   _LT_TAGVAR(hardcode_libdir_separator, $1)=
   _LT_TAGVAR(hardcode_minus_L, $1)=no
   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
@@ -4772,8 +4856,7 @@ _LT_EOF
        xlf* | bgf* | bgxlf* | mpixlf*)
          # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
          _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
-         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-         _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
          _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
          if test "x$supports_anon_versioning" = xyes; then
            _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
@@ -5068,6 +5151,7 @@ _LT_EOF
        # The linker will not automatically build a static lib if we build a DLL.
        # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+       _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
        _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
        # Don't use ranlib
        _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
@@ -5114,10 +5198,6 @@ _LT_EOF
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
 
-    freebsd1*)
-      _LT_TAGVAR(ld_shlibs, $1)=no
-      ;;
-
     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
     # support.  Future versions do this automatically, but an explicit c++rt0.o
     # does not break anything, and helps significantly (at the cost of a little
@@ -5130,7 +5210,7 @@ _LT_EOF
       ;;
 
     # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
+    freebsd2.*)
       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
       _LT_TAGVAR(hardcode_direct, $1)=yes
       _LT_TAGVAR(hardcode_minus_L, $1)=yes
@@ -5169,7 +5249,6 @@ _LT_EOF
       fi
       if test "$with_gnu_ld" = no; then
        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-       _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
        _LT_TAGVAR(hardcode_direct, $1)=yes
        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
@@ -5611,9 +5690,6 @@ _LT_TAGDECL([], [no_undefined_flag], [1],
 _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
     [Flag to hardcode $libdir into a binary during linking.
     This must work even if $libdir does not exist])
-_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
-    [[If ld is used when linking, flag to hardcode $libdir into a binary
-    during linking.  This must work even if $libdir does not exist]])
 _LT_TAGDECL([], [hardcode_libdir_separator], [1],
     [Whether we need a single "-rpath" flag with a separated argument])
 _LT_TAGDECL([], [hardcode_direct], [0],
@@ -5771,7 +5847,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
 _LT_TAGVAR(hardcode_direct, $1)=no
 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
 _LT_TAGVAR(hardcode_libdir_separator, $1)=
 _LT_TAGVAR(hardcode_minus_L, $1)=no
 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
@@ -6141,7 +6216,7 @@ if test "$_lt_caught_CXX_error" != yes; then
         esac
         ;;
 
-      freebsd[[12]]*)
+      freebsd2.*)
         # C++ shared libraries reported to be fairly broken before
        # switch to ELF
         _LT_TAGVAR(ld_shlibs, $1)=no
@@ -6902,12 +6977,18 @@ public class foo {
   }
 };
 _LT_EOF
+], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
+package foo
+func foo() {
+}
+_LT_EOF
 ])
 
 _lt_libdeps_save_CFLAGS=$CFLAGS
 case "$CC $CFLAGS " in #(
 *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
 *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
 esac
 
 dnl Parse the compiler output and extract the necessary
@@ -7104,7 +7185,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
 _LT_TAGVAR(hardcode_direct, $1)=no
 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
 _LT_TAGVAR(hardcode_libdir_separator, $1)=
 _LT_TAGVAR(hardcode_minus_L, $1)=no
 _LT_TAGVAR(hardcode_automatic, $1)=no
@@ -7237,7 +7317,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
 _LT_TAGVAR(hardcode_direct, $1)=no
 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
 _LT_TAGVAR(hardcode_libdir_separator, $1)=
 _LT_TAGVAR(hardcode_minus_L, $1)=no
 _LT_TAGVAR(hardcode_automatic, $1)=no
@@ -7424,6 +7503,77 @@ CFLAGS=$lt_save_CFLAGS
 ])# _LT_LANG_GCJ_CONFIG
 
 
+# _LT_LANG_GO_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Go compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GO_CONFIG],
+[AC_REQUIRE([LT_PROG_GO])dnl
+AC_LANG_SAVE
+
+# Source file extension for Go test sources.
+ac_ext=go
+
+# Object file extension for compiled Go test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="package main; func main() { }"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='package main; func main() { }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GOC-"gccgo"}
+CFLAGS=$GOFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# Go did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+
+  _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GO_CONFIG
+
+
 # _LT_LANG_RC_CONFIG([TAG])
 # -------------------------
 # Ensure that the configuration variables for the Windows resource compiler
@@ -7493,6 +7643,13 @@ dnl aclocal-1.4 backwards compatibility:
 dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
 
 
+# LT_PROG_GO
+# ----------
+AC_DEFUN([LT_PROG_GO],
+[AC_CHECK_TOOL(GOC, gccgo,)
+])
+
+
 # LT_PROG_RC
 # ----------
 AC_DEFUN([LT_PROG_RC],
index 6801ca9..8010379 100644 (file)
@@ -1,5 +1,5 @@
 # localcharset.m4 serial 7
-dnl Copyright (C) 2002, 2004, 2006, 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2004, 2006, 2009-2012 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 3f4f954..71b6847 100644 (file)
@@ -1,5 +1,5 @@
-# locale-fr.m4 serial 13
-dnl Copyright (C) 2003, 2005-2011 Free Software Foundation, Inc.
+# locale-fr.m4 serial 17
+dnl Copyright (C) 2003, 2005-2012 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.
@@ -26,9 +26,9 @@ char buf[16];
 int main () {
   /* Check whether the given locale name is recognized by the system.  */
 #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -37,7 +37,7 @@ int main () {
   if (setlocale (LC_ALL, "") == NULL) return 1;
 #endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -63,10 +63,12 @@ int main () {
      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;
 }
 changequote([,])dnl
@@ -80,7 +82,7 @@ changequote([,])dnl
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the native Win32 locale name.
+          # 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
@@ -90,7 +92,7 @@ changequote([,])dnl
           ;;
         *)
           # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
@@ -152,9 +154,9 @@ int main () {
 #if !(defined __BEOS__ || defined __HAIKU__)
   /* Check whether the given locale name is recognized by the system.  */
 # if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -163,7 +165,7 @@ int main () {
   if (setlocale (LC_ALL, "") == NULL) return 1;
 # endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -189,10 +191,12 @@ int main () {
       || 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;
 }
 changequote([,])dnl
@@ -206,7 +210,7 @@ changequote([,])dnl
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the hypothetical native Win32 locale name.
+          # 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
@@ -216,7 +220,7 @@ changequote([,])dnl
           ;;
         *)
           # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
index d44c2c8..5ba0e43 100644 (file)
@@ -1,5 +1,5 @@
-# locale-ja.m4 serial 9
-dnl Copyright (C) 2003, 2005-2011 Free Software Foundation, Inc.
+# locale-ja.m4 serial 12
+dnl Copyright (C) 2003, 2005-2012 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.
@@ -28,9 +28,9 @@ int main ()
   const char *p;
   /* Check whether the given locale name is recognized by the system.  */
 #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -39,7 +39,7 @@ int main ()
   if (setlocale (LC_ALL, "") == NULL) return 1;
 #endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -84,13 +84,14 @@ changequote([,])dnl
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Note that on native Win32, the Japanese locale is Japanese_Japan.932,
-          # and CP932 is very different from EUC-JP, so we cannot use it here.
+          # 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 MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
index 19ded1b..5f3bf80 100644 (file)
@@ -1,5 +1,5 @@
-# locale-tr.m4 serial 7
-dnl Copyright (C) 2003, 2005-2011 Free Software Foundation, Inc.
+# locale-tr.m4 serial 10
+dnl Copyright (C) 2003, 2005-2012 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.
@@ -31,9 +31,9 @@ int main () {
      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 Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -42,7 +42,7 @@ int main () {
   if (setlocale (LC_ALL, "") == NULL) return 1;
 #endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET)
+     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,
@@ -85,7 +85,7 @@ changequote([,])dnl
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the hypothetical native Win32 locale name.
+          # 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
@@ -95,7 +95,7 @@ changequote([,])dnl
           ;;
         *)
           # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
index e03f91f..e5502b2 100644 (file)
@@ -1,5 +1,5 @@
-# locale-zh.m4 serial 8
-dnl Copyright (C) 2003, 2005-2011 Free Software Foundation, Inc.
+# locale-zh.m4 serial 12
+dnl Copyright (C) 2003, 2005-2012 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,9 +29,9 @@ int main ()
   const char *p;
   /* Check whether the given locale name is recognized by the system.  */
 #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Win32, setlocale(category, "") looks at the system settings,
+  /* 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 speficied, it succeeds but sets the LC_CTYPE
+     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)
@@ -40,7 +40,7 @@ int main ()
   if (setlocale (LC_ALL, "") == NULL) return 1;
 #endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+     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,
@@ -85,7 +85,7 @@ changequote([,])dnl
         # "ja" as "Japanese" or "Japanese_Japan.932",
         # and similar.
         mingw*)
-          # Test for the hypothetical native Win32 locale name.
+          # 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
@@ -93,9 +93,15 @@ changequote([,])dnl
             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 MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # 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.
index 4d0f894..c0f4d52 100644 (file)
@@ -1,5 +1,5 @@
-# locale_h.m4 serial 13
-dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+# locale_h.m4 serial 19
+dnl Copyright (C) 2007, 2009-2012 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,18 +10,29 @@ AC_DEFUN([gl_LOCALE_H],
   dnl once only, before all statements that occur in other macros.
   AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
 
-  dnl Persuade glibc <locale.h> to define locale_t.
+  dnl Persuade glibc <locale.h> to define locale_t and the int_p_*, int_n_*
+  dnl members of 'struct lconv'.
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
 
   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'
+  dnl only if _LCONV_C99 is defined.
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  case "$host_os" in
+    solaris*)
+      AC_DEFINE([_LCONV_C99], [1], [Define to 1 on Solaris.])
+      ;;
+  esac
+
   AC_CACHE_CHECK([whether locale.h conforms to POSIX:2001],
     [gl_cv_header_locale_h_posix2001],
     [AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM(
           [[#include <locale.h>
-            int x = LC_MESSAGES;]],
+            int x = LC_MESSAGES;
+            int y = sizeof (((struct lconv *) 0)->decimal_point);]],
           [[]])],
        [gl_cv_header_locale_h_posix2001=yes],
        [gl_cv_header_locale_h_posix2001=no])])
@@ -31,7 +42,7 @@ AC_DEFUN([gl_LOCALE_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 MacOS X 10.5. If <locale.h> does not define locale_t by
+    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],
@@ -54,15 +65,29 @@ AC_DEFUN([gl_LOCALE_H],
   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,
+  dnl mingw, MSVC 9, it lacks the int_p_* and int_n_* members.
+  AC_CACHE_CHECK([whether struct lconv is properly defined],
+    [gl_cv_sys_struct_lconv_ok],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <locale.h>
+            struct lconv l;
+            int x = sizeof (l.decimal_point);
+            int y = sizeof (l.int_p_cs_precedes);]],
+          [[]])],
+       [gl_cv_sys_struct_lconv_ok=yes],
+       [gl_cv_sys_struct_lconv_ok=no])
+    ])
+  if test $gl_cv_sys_struct_lconv_ok = no; then
+    REPLACE_STRUCT_LCONV=1
+  fi
+
   dnl <locale.h> is always overridden, because of GNULIB_POSIXCHECK.
   gl_NEXT_HEADERS([locale.h])
 
-  if test -n "$STDDEF_H" \
-     || test $gl_cv_header_locale_h_posix2001 = no \
-     || test $gl_cv_header_locale_h_needs_xlocale_h = yes; then
-    gl_REPLACE_LOCALE_H
-  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([[#include <locale.h>
@@ -74,13 +99,6 @@ AC_DEFUN([gl_LOCALE_H],
     [setlocale duplocale])
 ])
 
-dnl Unconditionally enables the replacement of <locale.h>.
-AC_DEFUN([gl_REPLACE_LOCALE_H],
-[
-  dnl This is a no-op, because <locale.h> is always overridden.
-  :
-])
-
 AC_DEFUN([gl_LOCALE_MODULE_INDICATOR],
 [
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
@@ -92,10 +110,13 @@ AC_DEFUN([gl_LOCALE_MODULE_INDICATOR],
 
 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_DUPLOCALE=1;    AC_SUBST([HAVE_DUPLOCALE])
-  REPLACE_SETLOCALE=0; AC_SUBST([REPLACE_SETLOCALE])
-  REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE])
+  HAVE_DUPLOCALE=1;       AC_SUBST([HAVE_DUPLOCALE])
+  REPLACE_LOCALECONV=0;   AC_SUBST([REPLACE_LOCALECONV])
+  REPLACE_SETLOCALE=0;    AC_SUBST([REPLACE_SETLOCALE])
+  REPLACE_DUPLOCALE=0;    AC_SUBST([REPLACE_DUPLOCALE])
+  REPLACE_STRUCT_LCONV=0; AC_SUBST([REPLACE_STRUCT_LCONV])
 ])
diff --git a/gnulib/m4/localeconv.m4 b/gnulib/m4/localeconv.m4
new file mode 100644 (file)
index 0000000..5fae06d
--- /dev/null
@@ -0,0 +1,22 @@
+# localeconv.m4 serial 1
+dnl Copyright (C) 2012 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_LOCALECONV],
+[
+  AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
+  AC_REQUIRE([gl_LOCALE_H])
+
+  if test $REPLACE_STRUCT_LCONV = 1; then
+    REPLACE_LOCALECONV=1
+  fi
+])
+
+# Prerequisites of lib/localeconv.c.
+AC_DEFUN([gl_PREREQ_LOCALECONV],
+[
+  AC_CHECK_MEMBERS([struct lconv.decimal_point], [], [],
+    [[#include <locale.h>]])
+])
index 926ada6..2ba295e 100644 (file)
@@ -1,5 +1,5 @@
 # localename.m4 serial 2
-dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2012 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 9686945..19c6d45 100644 (file)
@@ -1,5 +1,5 @@
-# lock.m4 serial 11 (gettext-0.18.2)
-dnl Copyright (C) 2005-2011 Free Software Foundation, Inc.
+# lock.m4 serial 12 (gettext-0.18.2)
+dnl Copyright (C) 2005-2012 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_LOCK],
 [
   AC_REQUIRE([gl_THREADLIB])
   if test "$gl_threads_api" = posix; then
-    # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the
+    # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
     # pthread_rwlock_* functions.
     AC_CHECK_TYPE([pthread_rwlock_t],
       [AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
index aed816c..b9c65c7 100644 (file)
@@ -1,5 +1,5 @@
-# longlong.m4 serial 16
-dnl Copyright (C) 1999-2007, 2009-2011 Free Software Foundation, Inc.
+# longlong.m4 serial 17
+dnl Copyright (C) 1999-2007, 2009-2012 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.
@@ -51,7 +51,7 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT],
       fi])
   if test $ac_cv_type_long_long_int = yes; then
     AC_DEFINE([HAVE_LONG_LONG_INT], [1],
-      [Define to 1 if the system has the type `long long int'.])
+      [Define to 1 if the system has the type 'long long int'.])
   fi
 ])
 
@@ -77,7 +77,7 @@ AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
      fi])
   if test $ac_cv_type_unsigned_long_long_int = yes; then
     AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
-      [Define to 1 if the system has the type `unsigned long long int'.])
+      [Define to 1 if the system has the type 'unsigned long long int'.])
   fi
 ])
 
index b9b22a6..b7335bd 100644 (file)
@@ -1,6 +1,6 @@
-# serial 21
+# serial 25
 
-# Copyright (C) 1997-2001, 2003-2011 Free Software Foundation, Inc.
+# Copyright (C) 1997-2001, 2003-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,24 +15,30 @@ AC_DEFUN([gl_FUNC_LSTAT],
   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([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
-    if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then
-      dnl Note: AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK does AC_LIBOBJ([lstat]).
-      REPLACE_LSTAT=1
-    fi
-    # Prerequisites of lib/lstat.c.
-    AC_REQUIRE([AC_C_INLINE])
+    AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
+    case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
+      *no)
+        REPLACE_LSTAT=1
+        ;;
+    esac
   else
     HAVE_LSTAT=0
   fi
 ])
 
-# Redefine AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK, because it is no longer
-# maintained in Autoconf.
-AC_DEFUN([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
+# Prerequisites of lib/lstat.c.
+AC_DEFUN([gl_PREREQ_LSTAT],
 [
+  AC_REQUIRE([AC_C_INLINE])
+  :
+])
+
+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_CACHE_CHECK([whether lstat correctly handles trailing slash],
-    [ac_cv_func_lstat_dereferences_slashed_symlink],
+    [gl_cv_func_lstat_dereferences_slashed_symlink],
     [rm -f conftest.sym conftest.file
      echo >conftest.file
      if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
@@ -45,25 +51,27 @@ AC_DEFUN([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
                  have to compile and use the lstat wrapper.  */
               return lstat ("conftest.sym/", &sbuf) == 0;
             ]])],
-         [ac_cv_func_lstat_dereferences_slashed_symlink=yes],
-         [ac_cv_func_lstat_dereferences_slashed_symlink=no],
-         [# When cross-compiling, be pessimistic so we will end up using the
-          # replacement version of lstat that checks for trailing slashes and
-          # calls lstat a second time when necessary.
-          ac_cv_func_lstat_dereferences_slashed_symlink=no
+         [gl_cv_func_lstat_dereferences_slashed_symlink=yes],
+         [gl_cv_func_lstat_dereferences_slashed_symlink=no],
+         [case "$host_os" in
+                    # Guess yes on glibc systems.
+            *-gnu*) 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 the 'ln -s' command failed, then we probably don't even
        # have an lstat function.
-       ac_cv_func_lstat_dereferences_slashed_symlink=no
+       gl_cv_func_lstat_dereferences_slashed_symlink="guessing no"
      fi
      rm -f conftest.sym conftest.file
     ])
-  test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
-    AC_DEFINE_UNQUOTED([LSTAT_FOLLOWS_SLASHED_SYMLINK], [1],
-      [Define to 1 if `lstat' dereferences a symlink specified
-       with a trailing slash.])
-  if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then
-    AC_LIBOBJ([lstat])
-  fi
+  case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
+    *yes)
+      AC_DEFINE_UNQUOTED([LSTAT_FOLLOWS_SLASHED_SYMLINK], [1],
+        [Define to 1 if 'lstat' dereferences a symlink specified
+         with a trailing slash.])
+      ;;
+  esac
 ])
index 17cfd51..5d9acd8 100644 (file)
@@ -326,9 +326,24 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
 # MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
 m4_define([_LT_WITH_PIC],
 [AC_ARG_WITH([pic],
-    [AS_HELP_STRING([--with-pic],
+    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
        [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
-    [pic_mode="$withval"],
+    [lt_p=${PACKAGE-default}
+    case $withval in
+    yes|no) pic_mode=$withval ;;
+    *)
+      pic_mode=default
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for lt_pkg in $withval; do
+       IFS="$lt_save_ifs"
+       if test "X$lt_pkg" = "X$lt_p"; then
+         pic_mode=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
     [pic_mode=default])
 
 test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
index 9c7b5d4..07a8602 100644 (file)
@@ -9,15 +9,15 @@
 
 # @configure_input@
 
-# serial 3293 ltversion.m4
+# serial 3337 ltversion.m4
 # This file is part of GNU Libtool
 
-m4_define([LT_PACKAGE_VERSION], [2.4])
-m4_define([LT_PACKAGE_REVISION], [1.3293])
+m4_define([LT_PACKAGE_VERSION], [2.4.2])
+m4_define([LT_PACKAGE_REVISION], [1.3337])
 
 AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4'
-macro_revision='1.3293'
+[macro_version='2.4.2'
+macro_revision='1.3337'
 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
 _LT_DECL(, macro_revision, 0)
 ])
index 8094444..8fa48e9 100644 (file)
@@ -1,9 +1,47 @@
-# malloc.m4 serial 12
-dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+# malloc.m4 serial 14
+dnl Copyright (C) 2007, 2009-2012 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 taken from the following Autoconf patch:
+# http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=7fbb553727ed7e0e689a17594b58559ecf3ea6e9
+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_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
+          ]],
+          [[return ! malloc (0);]])
+       ],
+       [ac_cv_func_malloc_0_nonnull=yes],
+       [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 ;;
+        esac
+       ])
+    ])
+  AS_IF([test $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
@@ -17,7 +55,7 @@ AC_DEFUN([gl_FUNC_MALLOC_GNU],
                [Define to 1 if your system has a GNU libc compatible 'malloc'
                 function, and to 0 otherwise.])],
     [AC_DEFINE([HAVE_MALLOC_GNU], [0])
-     gl_REPLACE_MALLOC
+     REPLACE_MALLOC=1
     ])
 ])
 
@@ -33,7 +71,7 @@ AC_DEFUN([gl_FUNC_MALLOC_POSIX],
     AC_DEFINE([HAVE_MALLOC_POSIX], [1],
       [Define if the 'malloc' function is POSIX compliant.])
   else
-    gl_REPLACE_MALLOC
+    REPLACE_MALLOC=1
   fi
 ])
 
@@ -58,9 +96,3 @@ AC_DEFUN([gl_CHECK_MALLOC_POSIX],
         [gl_cv_func_malloc_posix=no])
     ])
 ])
-
-AC_DEFUN([gl_REPLACE_MALLOC],
-[
-  AC_LIBOBJ([malloc])
-  REPLACE_MALLOC=1
-])
index aec43f5..7841979 100644 (file)
@@ -1,5 +1,5 @@
 # malloca.m4 serial 1
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2011 Free Software Foundation,
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2012 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 c353862..8f829c8 100644 (file)
@@ -1,5 +1,5 @@
-# mbrtowc.m4 serial 22
-dnl Copyright (C) 2001-2002, 2004-2005, 2008-2011 Free Software Foundation,
+# mbrtowc.m4 serial 25
+dnl Copyright (C) 2001-2002, 2004-2005, 2008-2012 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,
@@ -15,6 +15,22 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
   AC_CHECK_FUNCS_ONCE([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>
+]])
+    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
+      dnl replacement.
+      REPLACE_MBRTOWC=1
+    fi
   else
     if test $REPLACE_MBSTATE_T = 1; then
       REPLACE_MBRTOWC=1
@@ -53,11 +69,6 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
       esac
     fi
   fi
-  if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
-    gl_REPLACE_WCHAR_H
-    AC_LIBOBJ([mbrtowc])
-    gl_PREREQ_MBRTOWC
-  fi
 ])
 
 dnl Test whether mbsinit() and mbrtowc() need to be overridden in a way that
@@ -88,9 +99,6 @@ AC_DEFUN([gl_MBSTATE_T_BROKEN],
   else
     REPLACE_MBSTATE_T=1
   fi
-  if test $REPLACE_MBSTATE_T = 1; then
-    gl_REPLACE_WCHAR_H
-  fi
 ])
 
 dnl Test whether mbrtowc puts the state into non-initial state when parsing an
index 47e2d14..da56c3d 100644 (file)
@@ -1,5 +1,5 @@
-# mbsinit.m4 serial 5
-dnl Copyright (C) 2008, 2010-2011 Free Software Foundation, Inc.
+# mbsinit.m4 serial 8
+dnl Copyright (C) 2008, 2010-2012 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,6 +15,22 @@ AC_DEFUN([gl_FUNC_MBSINIT],
   AC_CHECK_FUNCS_ONCE([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>
+]])
+    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
+      dnl replacement.
+      REPLACE_MBSINIT=1
+    fi
   else
     if test $REPLACE_MBSTATE_T = 1; then
       REPLACE_MBSINIT=1
@@ -27,11 +43,6 @@ AC_DEFUN([gl_FUNC_MBSINIT],
       esac
     fi
   fi
-  if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
-    gl_REPLACE_WCHAR_H
-    AC_LIBOBJ([mbsinit])
-    gl_PREREQ_MBSINIT
-  fi
 ])
 
 # Prerequisites of lib/mbsinit.c.
index 1fe8dcf..a95f606 100644 (file)
@@ -1,5 +1,5 @@
-# mbsrtowcs.m4 serial 10
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# mbsrtowcs.m4 serial 13
+dnl Copyright (C) 2008-2012 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,22 @@ AC_DEFUN([gl_FUNC_MBSRTOWCS],
   AC_CHECK_FUNCS_ONCE([mbsrtowcs])
   if test $ac_cv_func_mbsrtowcs = no; then
     HAVE_MBSRTOWCS=0
+    AC_CHECK_DECLS([mbsrtowcs],,, [[
+/* 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 $ac_cv_have_decl_mbsrtowcs = yes; then
+      dnl On Minix 3.1.8, the system's <wchar.h> declares mbsrtowcs() although
+      dnl it does not have the function. Avoid a collision with gnulib's
+      dnl replacement.
+      REPLACE_MBSRTOWCS=1
+    fi
   else
     if test $REPLACE_MBSTATE_T = 1; then
       REPLACE_MBSRTOWCS=1
@@ -25,12 +41,6 @@ AC_DEFUN([gl_FUNC_MBSRTOWCS],
       esac
     fi
   fi
-  if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then
-    gl_REPLACE_WCHAR_H
-    AC_LIBOBJ([mbsrtowcs])
-    AC_LIBOBJ([mbsrtowcs-state])
-    gl_PREREQ_MBSRTOWCS
-  fi
 ])
 
 dnl Test whether mbsrtowcs works.
index f7c46b8..61a8190 100644 (file)
@@ -1,5 +1,5 @@
 # mbstate_t.m4 serial 13
-dnl Copyright (C) 2000-2002, 2008-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-2002, 2008-2012 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 9215892..fec0d25 100644 (file)
@@ -1,5 +1,5 @@
-# mbtowc.m4 serial 1
-dnl Copyright (C) 2011 Free Software Foundation, Inc.
+# mbtowc.m4 serial 2
+dnl Copyright (C) 2011-2012 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,10 +11,6 @@ AC_DEFUN([gl_FUNC_MBTOWC],
   if false; then
     REPLACE_MBTOWC=1
   fi
-  if test $REPLACE_MBTOWC = 1; then
-    AC_LIBOBJ([mbtowc])
-    gl_PREREQ_MBTOWC
-  fi
 ])
 
 # Prerequisites of lib/mbtowc.c.
index 3c2b313..0040294 100644 (file)
@@ -1,5 +1,5 @@
-# memchr.m4 serial 10
-dnl Copyright (C) 2002-2004, 2009-2011 Free Software Foundation, Inc.
+# memchr.m4 serial 12
+dnl Copyright (C) 2002-2004, 2009-2012 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,10 +11,16 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
   AC_CHECK_HEADERS_ONCE([sys/mman.h])
   AC_CHECK_FUNCS_ONCE([mprotect])
 
-  dnl These days, we assume memchr is present.  But just in case...
   AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
-  AC_CHECK_FUNCS_ONCE([memchr])
-  if test $ac_cv_func_memchr = yes; then
+  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
@@ -73,12 +79,6 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
     if test "$gl_cv_func_memchr_works" != yes; then
       REPLACE_MEMCHR=1
     fi
-  else
-    HAVE_MEMCHR=0
-  fi
-  if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
-    AC_LIBOBJ([memchr])
-    gl_PREREQ_MEMCHR
   fi
 ])
 
index cc36900..c926941 100644 (file)
@@ -1,5 +1,5 @@
-# mempcpy.m4 serial 10
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2011 Free Software Foundation,
+# mempcpy.m4 serial 11
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2012 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,
@@ -14,10 +14,9 @@ AC_DEFUN([gl_FUNC_MEMPCPY],
   AC_REQUIRE([AC_C_RESTRICT])
 
   AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
-  AC_REPLACE_FUNCS([mempcpy])
+  AC_CHECK_FUNCS([mempcpy])
   if test $ac_cv_func_mempcpy = no; then
     HAVE_MEMPCPY=0
-    gl_PREREQ_MEMPCPY
   fi
 ])
 
diff --git a/gnulib/m4/mkstemp.m4 b/gnulib/m4/mkstemp.m4
new file mode 100644 (file)
index 0000000..cee0572
--- /dev/null
@@ -0,0 +1,82 @@
+#serial 23
+
+# Copyright (C) 2001, 2003-2007, 2009-2012 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 hosts (e.g., HP-UX 10.20, SunOS 4.1.4, Solaris 2.5.1), mkstemp has a
+# silly limit that it can create no more than 26 files from a given template.
+# Other systems lack mkstemp altogether.
+# On OSF1/Tru64 V4.0F, the system-provided mkstemp function can create
+# only 32 files per process.
+# On some hosts, mkstemp creates files with mode 0666, which is a security
+# problem and a violation of POSIX 2008.
+# On systems like the above, arrange to use the replacement function.
+AC_DEFUN([gl_FUNC_MKSTEMP],
+[
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+  AC_CHECK_FUNCS_ONCE([mkstemp])
+  if test $ac_cv_func_mkstemp = yes; then
+    AC_CACHE_CHECK([for working mkstemp],
+      [gl_cv_func_working_mkstemp],
+      [
+        mkdir conftest.mkstemp
+        AC_RUN_IFELSE(
+          [AC_LANG_PROGRAM(
+            [AC_INCLUDES_DEFAULT],
+            [[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;]])],
+          [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" ;;
+           esac
+          ])
+        rm -rf conftest.mkstemp
+      ])
+    case "$gl_cv_func_working_mkstemp" in
+      *yes) ;;
+      *)
+        REPLACE_MKSTEMP=1
+        ;;
+    esac
+  else
+    HAVE_MKSTEMP=0
+  fi
+])
+
+# Prerequisites of lib/mkstemp.c.
+AC_DEFUN([gl_PREREQ_MKSTEMP],
+[
+])
index 7ba7fd2..748b17d 100644 (file)
@@ -1,5 +1,5 @@
-# mmap-anon.m4 serial 9
-dnl Copyright (C) 2005, 2007, 2009-2011 Free Software Foundation, Inc.
+# mmap-anon.m4 serial 10
+dnl Copyright (C) 2005, 2007, 2009-2012 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 @@ 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 MacOS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists.
+# - On Mac OS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists.
 # - On IRIX, neither exists, and a file descriptor opened to /dev/zero must be
 #   used.
 
@@ -27,18 +27,18 @@ AC_DEFUN([gl_FUNC_MMAP_ANON],
   gl_have_mmap_anonymous=no
   if test $gl_have_mmap = yes; then
     AC_MSG_CHECKING([for MAP_ANONYMOUS])
-    AC_EGREP_CPP([I cant identify this map.], [
+    AC_EGREP_CPP([I cannot identify this map], [
 #include <sys/mman.h>
 #ifdef MAP_ANONYMOUS
-    I cant identify this map.
+    I cannot identify this map
 #endif
 ],
       [gl_have_mmap_anonymous=yes])
     if test $gl_have_mmap_anonymous != yes; then
-      AC_EGREP_CPP([I cant identify this map.], [
+      AC_EGREP_CPP([I cannot identify this map], [
 #include <sys/mman.h>
 #ifdef MAP_ANON
-    I cant identify this map.
+    I cannot identify this map
 #endif
 ],
         [AC_DEFINE([MAP_ANONYMOUS], [MAP_ANON],
index f9cf704..40f612a 100644 (file)
@@ -1,5 +1,5 @@
 # mode_t.m4 serial 2
-dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2012 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/gnulib/m4/msvc-inval.m4 b/gnulib/m4/msvc-inval.m4
new file mode 100644 (file)
index 0000000..8db4617
--- /dev/null
@@ -0,0 +1,19 @@
+# msvc-inval.m4 serial 1
+dnl Copyright (C) 2011-2012 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_MSVC_INVAL],
+[
+  AC_CHECK_FUNCS_ONCE([_set_invalid_parameter_handler])
+  if test $ac_cv_func__set_invalid_parameter_handler = yes; then
+    HAVE_MSVC_INVALID_PARAMETER_HANDLER=1
+    AC_DEFINE([HAVE_MSVC_INVALID_PARAMETER_HANDLER], [1],
+      [Define to 1 on MSVC platforms that have the "invalid parameter handler"
+       concept.])
+  else
+    HAVE_MSVC_INVALID_PARAMETER_HANDLER=0
+  fi
+  AC_SUBST([HAVE_MSVC_INVALID_PARAMETER_HANDLER])
+])
diff --git a/gnulib/m4/msvc-nothrow.m4 b/gnulib/m4/msvc-nothrow.m4
new file mode 100644 (file)
index 0000000..0125050
--- /dev/null
@@ -0,0 +1,10 @@
+# msvc-nothrow.m4 serial 1
+dnl Copyright (C) 2011-2012 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_MSVC_NOTHROW],
+[
+  AC_REQUIRE([gl_MSVC_INVAL])
+])
index 691d892..0c288b8 100644 (file)
@@ -1,12 +1,12 @@
-# multiarch.m4 serial 6
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# multiarch.m4 serial 7
+dnl Copyright (C) 2008-2012 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.
 
 # Determine whether the compiler is or may be producing universal binaries.
 #
-# On MacOS X 10.5 and later systems, the user can create libraries and
+# On Mac OS X 10.5 and later systems, the user can create libraries and
 # executables that work on multiple system types--known as "fat" or
 # "universal" binaries--by specifying multiple '-arch' options to the
 # compiler but only a single '-arch' option to the preprocessor.  Like
index ca9d28d..80fe60d 100644 (file)
@@ -1,5 +1,5 @@
-# nl_langinfo.m4 serial 4
-dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
+# nl_langinfo.m4 serial 5
+dnl Copyright (C) 2009-2012 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.
@@ -43,10 +43,8 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO],
       REPLACE_NL_LANGINFO=1
       AC_DEFINE([REPLACE_NL_LANGINFO], [1],
         [Define if nl_langinfo exists but is overridden by gnulib.])
-      AC_LIBOBJ([nl_langinfo])
     fi
   else
     HAVE_NL_LANGINFO=0
-    AC_LIBOBJ([nl_langinfo])
   fi
 ])
diff --git a/gnulib/m4/nocrash.m4 b/gnulib/m4/nocrash.m4
new file mode 100644 (file)
index 0000000..c2638df
--- /dev/null
@@ -0,0 +1,130 @@
+# nocrash.m4 serial 4
+dnl Copyright (C) 2005, 2009-2012 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 Based on libsigsegv, from Bruno Haible and Paolo Bonzini.
+
+AC_PREREQ([2.13])
+
+dnl Expands to some code for use in .c programs that will cause the configure
+dnl test to exit instead of crashing. This is useful to avoid triggering
+dnl action from a background debugger and to avoid core dumps.
+dnl Usage:   ...
+dnl          ]GL_NOCRASH[
+dnl          ...
+dnl          int main() { nocrash_init(); ... }
+AC_DEFUN([GL_NOCRASH],[[
+#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 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>
+/* 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
+]])
diff --git a/gnulib/m4/off_t.m4 b/gnulib/m4/off_t.m4
new file mode 100644 (file)
index 0000000..dfca2df
--- /dev/null
@@ -0,0 +1,18 @@
+# off_t.m4 serial 1
+dnl Copyright (C) 2012 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 Check whether to override the 'off_t' type.
+dnl Set WINDOWS_64_BIT_OFF_T.
+
+AC_DEFUN([gl_TYPE_OFF_T],
+[
+  m4_ifdef([gl_LARGEFILE], [
+    AC_REQUIRE([gl_LARGEFILE])
+  ], [
+    WINDOWS_64_BIT_OFF_T=0
+  ])
+  AC_SUBST([WINDOWS_64_BIT_OFF_T])
+])
index 223071a..275d73c 100644 (file)
@@ -1,9 +1,22 @@
-# onceonly.m4 serial 7
-dnl Copyright (C) 2002-2003, 2005-2006, 2008-2011 Free Software Foundation,
+# onceonly.m4 serial 9
+dnl Copyright (C) 2002-2003, 2005-2006, 2008-2012 Free Software Foundation,
 dnl 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
+dnl This file is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This file is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this file.  If not, see <http://www.gnu.org/licenses/>.
+dnl
+dnl As a special exception to the GNU General Public License,
+dnl 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.
 
@@ -67,7 +80,7 @@ AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
         [gl_func_list="$gl_func_list gl_FUNC_NAME"])
       gl_FUNCS_EXPANSION
       AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_FUNC_NAME])),
-        [Define to 1 if you have the `]m4_defn([gl_FUNC_NAME])[' function.])
+        [Define to 1 if you have the ']m4_defn([gl_FUNC_NAME])[' function.])
     ])
     AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]))
   ])
index bfebdab..c85971d 100644 (file)
@@ -1,5 +1,5 @@
-# open.m4 serial 11
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# open.m4 serial 13
+dnl Copyright (C) 2007-2012 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_OPEN],
   AC_REQUIRE([AC_CANONICAL_HOST])
   case "$host_os" in
     mingw* | pw*)
-      gl_REPLACE_OPEN
+      REPLACE_OPEN=1
       ;;
     *)
       dnl open("foo/") should not create a file when the file name has a
@@ -57,19 +57,30 @@ changequote([,])dnl
         *no)
           AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1],
             [Define to 1 if open() fails to recognize a trailing slash.])
-          gl_REPLACE_OPEN
+          REPLACE_OPEN=1
           ;;
       esac
       ;;
   esac
-])
-
-AC_DEFUN([gl_REPLACE_OPEN],
-[
-  AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
-  REPLACE_OPEN=1
-  AC_LIBOBJ([open])
-  gl_PREREQ_OPEN
+  dnl Replace open() for supporting the gnulib-defined fchdir() function,
+  dnl to keep fchdir's bookkeeping up-to-date.
+  m4_ifdef([gl_FUNC_FCHDIR], [
+    if test $REPLACE_OPEN = 0; then
+      gl_TEST_FCHDIR
+      if test $HAVE_FCHDIR = 0; then
+        REPLACE_OPEN=1
+      fi
+    fi
+  ])
+  dnl Replace open() for supporting the gnulib-defined O_NONBLOCK flag.
+  m4_ifdef([gl_NONBLOCKING_IO], [
+    if test $REPLACE_OPEN = 0; then
+      gl_NONBLOCKING_IO
+      if test $gl_cv_have_open_O_NONBLOCK != yes; then
+        REPLACE_OPEN=1
+      fi
+    fi
+  ])
 ])
 
 # Prerequisites of lib/open.c.
index 17b3d64..0117861 100644 (file)
@@ -1,5 +1,5 @@
-# pathmax.m4 serial 8
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2011 Free Software Foundation,
+# pathmax.m4 serial 10
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2012 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,35 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_PATHMAX],
 [
   dnl Prerequisites of lib/pathmax.h.
-  AC_CHECK_FUNCS_ONCE([pathconf])
   AC_CHECK_HEADERS_ONCE([sys/param.h])
 ])
+
+# Expands to a piece of C program that defines PATH_MAX in the same way as
+# "pathmax.h" will do.
+AC_DEFUN([gl_PATHMAX_SNIPPET], [[
+/* 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 __WIN32__) && ! defined __CYGWIN__
+# undef PATH_MAX
+# define PATH_MAX 260
+#endif
+]])
+
+# Prerequisites of gl_PATHMAX_SNIPPET.
+AC_DEFUN([gl_PATHMAX_SNIPPET_PREREQ],
+[
+  AC_CHECK_HEADERS_ONCE([unistd.h sys/param.h])
+])
index 9c2ed1e..751e896 100644 (file)
@@ -1,5 +1,5 @@
-# printf.m4 serial 42
-dnl Copyright (C) 2003, 2007-2011 Free Software Foundation, Inc.
+# printf.m4 serial 50
+dnl Copyright (C) 2003, 2007-2012 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.
@@ -63,7 +63,7 @@ changequote(,)dnl
                                  # 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 MacOS X >= 10.3.
+                                 # 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.
@@ -178,28 +178,28 @@ static double zero = 0.0;
 int main ()
 {
   int result = 0;
-  if (sprintf (buf, "%f", 1.0 / 0.0) < 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 / 0.0) < 0
+  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 / 0.0) < 0
+  if (sprintf (buf, "%e", 1.0 / zero) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
     result |= 4;
-  if (sprintf (buf, "%e", -1.0 / 0.0) < 0
+  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 / 0.0) < 0
+  if (sprintf (buf, "%g", 1.0 / zero) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
     result |= 16;
-  if (sprintf (buf, "%g", -1.0 / 0.0) < 0
+  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
@@ -222,7 +222,7 @@ changequote(,)dnl
                                  # 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 MacOS X >= 10.3.
+                                 # 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.
@@ -251,6 +251,7 @@ AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE],
   AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
   AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([gl_BIGENDIAN])
+  AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   dnl The user can set or unset the variable gl_printf_safe to indicate
   dnl that he wishes a safe handling of non-IEEE-754 'long double' values.
@@ -294,34 +295,34 @@ int main ()
 {
   int result = 0;
   nocrash_init();
-  if (sprintf (buf, "%Lf", 1.0L / 0.0L) < 0
+  if (sprintf (buf, "%Lf", 1.0L / zeroL) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
     result |= 1;
-  if (sprintf (buf, "%Lf", -1.0L / 0.0L) < 0
+  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 / 0.0L) < 0
+  if (sprintf (buf, "%Le", 1.0L / zeroL) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
     result |= 1;
-  if (sprintf (buf, "%Le", -1.0L / 0.0L) < 0
+  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 / 0.0L) < 0
+  if (sprintf (buf, "%Lg", 1.0L / zeroL) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
     result |= 1;
-  if (sprintf (buf, "%Lg", -1.0L / 0.0L) < 0
+  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_))
+#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
@@ -478,6 +479,7 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_A],
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
+static double zero = 0.0;
 int main ()
 {
   int result = 0;
@@ -502,17 +504,17 @@ int main ()
     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 / 0.0, 33, 44, 55) < 0
+  if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0
       || buf[0] == '0')
     result |= 8;
-  /* This catches a MacOS X 10.3.9 (Darwin 7.9) bug.  */
+  /* 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 MacOS X 10.3.9 (Darwin 7.9) bug and also a
+  /* 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
@@ -562,13 +564,14 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_F],
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
+static double zero = 0.0;
 int main ()
 {
   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 / 0.0) < 0
+  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.  */
@@ -587,7 +590,7 @@ changequote(,)dnl
                                  # 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 MacOS X >= 10.3.
+                                 # 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.
@@ -615,12 +618,27 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_N],
       AC_RUN_IFELSE(
         [AC_LANG_SOURCE([[
 #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)
+{
+  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.  */
@@ -636,7 +654,8 @@ int main ()
         [
 changequote(,)dnl
          case "$host_os" in
-           *)     gl_cv_func_printf_directive_n="guessing yes";;
+           mingw*) gl_cv_func_printf_directive_n="guessing no";;
+           *)      gl_cv_func_printf_directive_n="guessing yes";;
          esac
 changequote([,])dnl
         ])
@@ -862,9 +881,10 @@ AC_DEFUN([gl_PRINTF_FLAG_ZERO],
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
+static double zero = 0.0;
 int main ()
 {
-  if (sprintf (buf, "%010f", 1.0 / 0.0, 33, 44, 55) < 0
+  if (sprintf (buf, "%010f", 1.0 / zero, 33, 44, 55) < 0
       || (strcmp (buf, "       inf") != 0
           && strcmp (buf, "  infinity") != 0))
     return 1;
@@ -892,7 +912,8 @@ dnl On mingw, precisions larger than 512 are treated like 512, in integer,
 dnl floating-point or pointer output. On Solaris 10/x86, precisions larger
 dnl than 510 in floating-point output crash the program. On Solaris 10/SPARC,
 dnl precisions larger than 510 in floating-point output yield wrong results.
-dnl On BeOS, precisions larger than 1044 crash the program.
+dnl On AIX 7.1, precisions larger than 998 in floating-point output yield
+dnl wrong results. On BeOS, precisions larger than 1044 crash the program.
 dnl Result is gl_cv_func_printf_precision.
 
 AC_DEFUN([gl_PRINTF_PRECISION],
@@ -921,6 +942,9 @@ int main ()
   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;
 }]])],
         [gl_cv_func_printf_precision=yes],
@@ -928,7 +952,7 @@ int main ()
         [
 changequote(,)dnl
          case "$host_os" in
-           # Guess no only on Solaris, native Win32, and BeOS systems.
+           # 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" ;;
@@ -1004,8 +1028,9 @@ int main()
 changequote([,])dnl
           ])])
           if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
-            (./conftest
+            (./conftest 2>&AS_MESSAGE_LOG_FD
              result=$?
+             _AS_ECHO_LOG([\$? = $result])
              if test $result != 0 && test $result != 77; then result=1; fi
              exit $result
             ) >/dev/null 2>/dev/null
@@ -1019,7 +1044,7 @@ changequote([,])dnl
           fi
           rm -fr conftest*
         else
-          dnl A universal build on Apple MacOS X platforms.
+          dnl A universal build on Apple Mac OS X platforms.
           dnl The result would be 'no' in 32-bit mode and 'yes' in 64-bit mode.
           dnl But we need a configuration result that is valid in both modes.
           gl_cv_func_printf_enomem="guessing no"
@@ -1072,6 +1097,7 @@ AC_DEFUN([gl_SNPRINTF_TRUNCATION_C99],
 [
   AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_REQUIRE([gl_SNPRINTF_PRESENCE])
   AC_CACHE_CHECK([whether snprintf truncates the result as in C99],
     [gl_cv_func_snprintf_truncation_c99],
     [
@@ -1079,11 +1105,25 @@ AC_DEFUN([gl_SNPRINTF_TRUNCATION_C99],
         [AC_LANG_SOURCE([[
 #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");
-  snprintf (buf, 3, "%d %d", 4567, 89);
+  my_snprintf (buf, 3, "%d %d", 4567, 89);
   if (memcmp (buf, "45\0DEF", 6) != 0)
     return 1;
   return 0;
@@ -1098,7 +1138,7 @@ changequote(,)dnl
                                  # 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";;
-                                 # Guess yes on MacOS X >= 10.3.
+                                 # 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.
@@ -1153,6 +1193,7 @@ AC_DEFUN_ONCE([gl_SNPRINTF_RETVAL_C99],
 [
   AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_REQUIRE([gl_SNPRINTF_PRESENCE])
   AC_CACHE_CHECK([whether snprintf returns a byte count as in C99],
     [gl_cv_func_snprintf_retval_c99],
     [
@@ -1160,15 +1201,29 @@ AC_DEFUN_ONCE([gl_SNPRINTF_RETVAL_C99],
         [AC_LANG_SOURCE([[
 #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 (snprintf (buf, 3, "%d %d", 4567, 89) != 7)
+  if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7)
     return 1;
-  if (snprintf (buf, 0, "%d %d", 4567, 89) != 7)
+  if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7)
     return 2;
-  if (snprintf (NULL, 0, "%d %d", 4567, 89) != 7)
+  if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7)
     return 3;
   return 0;
 }]])],
@@ -1182,7 +1237,7 @@ changequote(,)dnl
                                  # Guess yes on FreeBSD >= 5.
            freebsd[1-4]*)        gl_cv_func_snprintf_retval_c99="guessing no";;
            freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
-                                 # Guess yes on MacOS X >= 10.3.
+                                 # 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.
@@ -1217,6 +1272,7 @@ AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N],
 [
   AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_REQUIRE([gl_SNPRINTF_PRESENCE])
   AC_CACHE_CHECK([whether snprintf fully supports the 'n' directive],
     [gl_cv_func_snprintf_directive_n],
     [
@@ -1224,6 +1280,20 @@ AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N],
         [AC_LANG_SOURCE([[
 #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 fmtstring[10];
 static char buf[100];
 int main ()
@@ -1233,7 +1303,7 @@ int main ()
      support %n in format strings in read-only memory but not in writable
      memory.  */
   strcpy (fmtstring, "%d %n");
-  snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55);
+  my_snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55);
   if (count != 6)
     return 1;
   return 0;
@@ -1248,7 +1318,7 @@ changequote(,)dnl
                                  # 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";;
-                                 # Guess yes on MacOS X >= 10.3.
+                                 # 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";;
                                  # Guess yes on Solaris >= 2.6.
@@ -1285,16 +1355,31 @@ dnl Result is gl_cv_func_snprintf_size1.
 AC_DEFUN([gl_SNPRINTF_SIZE1],
 [
   AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([gl_SNPRINTF_PRESENCE])
   AC_CACHE_CHECK([whether snprintf respects a size of 1],
     [gl_cv_func_snprintf_size1],
     [
       AC_RUN_IFELSE(
         [AC_LANG_SOURCE([[
 #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' };
-  snprintf (buf, 1, "%d", 12345);
+  my_snprintf (buf, 1, "%d", 12345);
   return buf[1] != 'E';
 }]])],
         [gl_cv_func_snprintf_size1=yes],
@@ -1375,7 +1460,7 @@ changequote(,)dnl
                                  # 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";;
-                                 # Guess yes on MacOS X >= 10.3.
+                                 # 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";;
                                  # Guess yes on Cygwin.
@@ -1455,17 +1540,18 @@ dnl                                  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
 dnl   glibc 2.5                      .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
 dnl   glibc 2.3.6                    .  .  .  .  #  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
 dnl   FreeBSD 5.4, 6.1               .  .  .  .  #  .  .  .  .  .  .  #  .  #  .  .  .  .  .  .
-dnl   MacOS X 10.5.8                 .  .  .  #  #  .  .  .  .  .  .  #  .  .  .  .  .  .  .  .
-dnl   MacOS X 10.3.9                 .  .  .  .  #  .  .  .  .  .  .  #  .  #  .  .  .  .  .  .
+dnl   Mac OS X 10.5.8                .  .  .  #  #  .  .  .  .  .  .  #  .  .  .  .  .  .  .  .
+dnl   Mac OS X 10.3.9                .  .  .  .  #  .  .  .  .  .  .  #  .  #  .  .  .  .  .  .
 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 2010-11             .  .  #  #  #  .  .  #  .  .  .  #  .  .  .  .  .  .  .  .
+dnl   Solaris 11 2011-11             .  .  #  #  #  .  .  #  .  .  .  #  .  .  .  .  .  .  .  .
 dnl   Solaris 10                     .  .  #  #  #  .  .  #  .  .  .  #  #  .  .  .  .  .  .  .
 dnl   Solaris 2.6 ... 9              #  .  #  #  #  #  .  #  .  .  .  #  #  .  .  .  #  .  .  .
 dnl   Solaris 2.5.1                  #  .  #  #  #  #  .  #  .  .  .  #  .  .  #  #  #  #  #  #
-dnl   AIX 5.2, 7.1                   .  .  #  #  #  .  .  .  .  .  .  #  .  .  .  .  .  .  .  .
+dnl   AIX 7.1                        .  .  #  #  #  .  .  .  .  .  .  #  #  .  .  .  .  .  .  .
+dnl   AIX 5.2                        .  .  #  #  #  .  .  .  .  .  .  #  .  .  .  .  .  .  .  .
 dnl   AIX 4.3.2, 5.1                 #  .  #  #  #  #  .  .  .  .  .  #  .  .  .  .  #  .  .  .
 dnl   HP-UX 11.31                    .  .  .  .  #  .  .  .  .  .  .  #  .  .  .  .  #  #  .  .
 dnl   HP-UX 11.{00,11,23}            #  .  .  .  #  #  .  .  .  .  .  #  .  .  .  .  #  #  .  #
@@ -1478,4 +1564,7 @@ dnl   NetBSD 4.0                     .  ?  ?  ?  ?  ?  .  ?  .  ?  ?  ?  ?  ?  .
 dnl   NetBSD 3.0                     .  .  .  .  #  #  .  ?  #  #  ?  #  .  #  .  .  .  .  .  .
 dnl   Haiku                          .  .  .  #  #  #  .  #  .  .  .  .  .  ?  .  .  ?  .  .  .
 dnl   BeOS                           #  #  .  #  #  #  .  ?  #  .  ?  .  #  ?  .  .  ?  .  .  .
-dnl   mingw                          #  #  #  #  #  #  .  .  #  #  .  #  #  ?  .  #  #  #  .  .
+dnl   old mingw / msvcrt             #  #  #  #  #  #  .  .  #  #  .  #  #  ?  .  #  #  #  .  .
+dnl   MSVC 9                         #  #  #  #  #  #  #  .  #  #  .  #  #  ?  #  #  #  #  .  .
+dnl   mingw 2009-2011                .  #  .  #  .  .  .  .  #  #  .  .  .  ?  .  .  .  .  .  .
+dnl   mingw-w64 2011                 #  #  #  #  #  #  .  .  #  #  .  #  #  ?  .  #  #  #  .  .
index de3900b..b971b12 100644 (file)
@@ -1,5 +1,5 @@
-# putenv.m4 serial 17
-dnl Copyright (C) 2002-2011 Free Software Foundation, Inc.
+# putenv.m4 serial 19
+dnl Copyright (C) 2002-2012 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,6 +12,7 @@ dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that.
 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],[[
@@ -32,10 +33,18 @@ AC_DEFUN([gl_FUNC_PUTENV],
              gl_cv_func_svid_putenv=yes,
              gl_cv_func_svid_putenv=no,
              dnl When crosscompiling, assume putenv is broken.
-             gl_cv_func_svid_putenv=no)
+             [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
+             ])
    ])
-  if test $gl_cv_func_svid_putenv = no; then
-    REPLACE_PUTENV=1
-    AC_LIBOBJ([putenv])
-  fi
+  case "$gl_cv_func_svid_putenv" in
+    *yes) ;;
+    *)
+      REPLACE_PUTENV=1
+      ;;
+  esac
 ])
diff --git a/gnulib/m4/rawmemchr.m4 b/gnulib/m4/rawmemchr.m4
new file mode 100644 (file)
index 0000000..1930164
--- /dev/null
@@ -0,0 +1,20 @@
+# rawmemchr.m4 serial 2
+dnl Copyright (C) 2003, 2007-2012 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_RAWMEMCHR],
+[
+  dnl Persuade glibc <string.h> to declare rawmemchr().
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  AC_CHECK_FUNCS([rawmemchr])
+  if test $ac_cv_func_rawmemchr = no; then
+    HAVE_RAWMEMCHR=0
+  fi
+])
+
+# Prerequisites of lib/strchrnul.c.
+AC_DEFUN([gl_PREREQ_RAWMEMCHR], [:])
index a502ca5..ccf5141 100644 (file)
@@ -1,5 +1,5 @@
-# readlink.m4 serial 9
-dnl Copyright (C) 2003, 2007, 2009-2011 Free Software Foundation, Inc.
+# readlink.m4 serial 12
+dnl Copyright (C) 2003, 2007, 2009-2012 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,11 +7,10 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_READLINK],
 [
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CHECK_FUNCS_ONCE([readlink])
   if test $ac_cv_func_readlink = no; then
     HAVE_READLINK=0
-    AC_LIBOBJ([readlink])
-    gl_PREREQ_READLINK
   else
     AC_CACHE_CHECK([whether readlink signature is correct],
       [gl_cv_decl_readlink_works],
@@ -34,21 +33,31 @@ AC_DEFUN([gl_FUNC_READLINK],
 ]], [[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_works="guessing 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" ;;
+          esac
+         ])
       rm -f conftest.link conftest.lnk2])
-    if test "$gl_cv_func_readlink_works" != yes; then
-      AC_DEFINE([READLINK_TRAILING_SLASH_BUG], [1], [Define to 1 if readlink
-        fails to recognize a trailing slash.])
-      REPLACE_READLINK=1
-      AC_LIBOBJ([readlink])
-    elif test "$gl_cv_decl_readlink_works" != yes; then
-      REPLACE_READLINK=1
-      AC_LIBOBJ([readlink])
-    fi
+    case "$gl_cv_func_readlink_works" in
+      *yes)
+        if test "$gl_cv_decl_readlink_works" != yes; then
+          REPLACE_READLINK=1
+        fi
+        ;;
+      *)
+        AC_DEFINE([READLINK_TRAILING_SLASH_BUG], [1], [Define to 1 if readlink
+          fails to recognize a trailing slash.])
+        REPLACE_READLINK=1
+        ;;
+    esac
   fi
 ])
 
-# Like gl_FUNC_READLINK, except prepare for separate compilation (no AC_LIBOBJ).
+# Like gl_FUNC_READLINK, except prepare for separate compilation
+# (no REPLACE_READLINK, no AC_LIBOBJ).
 AC_DEFUN([gl_FUNC_READLINK_SEPARATE],
 [
   AC_CHECK_FUNCS_ONCE([readlink])
index a403d9f..954c2f0 100644 (file)
@@ -1,9 +1,47 @@
-# realloc.m4 serial 11
-dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+# realloc.m4 serial 13
+dnl Copyright (C) 2007, 2009-2012 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 taken from the following Autoconf patch:
+# http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=7fbb553727ed7e0e689a17594b58559ecf3ea6e9
+AC_DEFUN([_AC_FUNC_REALLOC_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 realloc],
+    [ac_cv_func_realloc_0_nonnull],
+    [AC_RUN_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+            # include <stdlib.h>
+            #else
+            char *realloc ();
+            #endif
+          ]],
+          [[return ! realloc (0, 0);]])
+       ],
+       [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* \
+          | hpux* | solaris* | cygwin* | mingw*)
+            ac_cv_func_realloc_0_nonnull=yes ;;
+          # If we don't know, assume the worst.
+          *) ac_cv_func_realloc_0_nonnull=no ;;
+        esac
+       ])
+    ])
+  AS_IF([test $ac_cv_func_realloc_0_nonnull = yes], [$1], [$2])
+])# AC_FUNC_REALLOC
+
+])
+
 # gl_FUNC_REALLOC_GNU
 # -------------------
 # Test whether 'realloc (0, 0)' is handled like in GNU libc, and replace
@@ -17,7 +55,7 @@ AC_DEFUN([gl_FUNC_REALLOC_GNU],
                [Define to 1 if your system has a GNU libc compatible 'realloc'
                 function, and to 0 otherwise.])],
     [AC_DEFINE([HAVE_REALLOC_GNU], [0])
-     gl_REPLACE_REALLOC
+     REPLACE_REALLOC=1
     ])
 ])# gl_FUNC_REALLOC_GNU
 
@@ -33,12 +71,6 @@ AC_DEFUN([gl_FUNC_REALLOC_POSIX],
     AC_DEFINE([HAVE_REALLOC_POSIX], [1],
       [Define if the 'realloc' function is POSIX compliant.])
   else
-    gl_REPLACE_REALLOC
+    REPLACE_REALLOC=1
   fi
 ])
-
-AC_DEFUN([gl_REPLACE_REALLOC],
-[
-  AC_LIBOBJ([realloc])
-  REPLACE_REALLOC=1
-])
index 24198b5..41be5e8 100644 (file)
@@ -1,6 +1,6 @@
-# serial 58
+# serial 61
 
-# Copyright (C) 1996-2001, 2003-2011 Free Software Foundation, Inc.
+# Copyright (C) 1996-2001, 2003-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -175,6 +175,9 @@ AC_DEFUN([gl_REGEX],
   esac
 
   if test $ac_use_included_regex = yes; then
+    AC_DEFINE([_REGEX_INCLUDE_LIMITS_H], [1],
+      [Define if you want <regex.h> to include <limits.h>, so that it
+       consistently overrides <limits.h>'s RE_DUP_MAX.])
     AC_DEFINE([_REGEX_LARGE_OFFSETS], [1],
       [Define if you want regoff_t to be at least as wide POSIX requires.])
     AC_DEFINE([re_syntax_options], [rpl_re_syntax_options],
@@ -207,8 +210,6 @@ AC_DEFUN([gl_REGEX],
       [Define to rpl_regerror if the replacement should be used.])
     AC_DEFINE([regfree], [rpl_regfree],
       [Define to rpl_regfree if the replacement should be used.])
-    AC_LIBOBJ([regex])
-    gl_PREREQ_REGEX
   fi
 ])
 
@@ -221,5 +222,5 @@ AC_DEFUN([gl_PREREQ_REGEX],
   AC_REQUIRE([AC_TYPE_MBSTATE_T])
   AC_CHECK_HEADERS([libintl.h])
   AC_CHECK_FUNCS_ONCE([isblank iswctype wcscoll])
-  AC_CHECK_DECLS([isblank], [], [], [#include <ctype.h>])
+  AC_CHECK_DECLS([isblank], [], [], [[#include <ctype.h>]])
 ])
index cdd3928..abd6589 100644 (file)
@@ -1,9 +1,10 @@
-# safe-alloc.m4 serial 1
-dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
+# safe-alloc.m4 serial 2
+dnl Copyright (C) 2009-2012 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_SAFE_ALLOC],
 [
-  AC_LIBOBJ([safe-alloc])
+  :
 ])
index 227ab6b..7ad67bb 100644 (file)
@@ -1,5 +1,5 @@
-# serial 2   -*- Autoconf -*-
-# Copyright (C) 2006-2007, 2009-2011 Free Software Foundation, Inc.
+# serial 3   -*- Autoconf -*-
+# Copyright (C) 2006-2007, 2009-2012 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.
@@ -18,4 +18,5 @@ AC_DEFUN([gl_HEADERS_SELINUX_CONTEXT_H],
     SELINUX_CONTEXT_H=selinux/context.h
   fi
   AC_SUBST([SELINUX_CONTEXT_H])
+  AM_CONDITIONAL([GL_GENERATE_SELINUX_CONTEXT_H], [test -n "$SELINUX_CONTEXT_H"])
 ])
index 7afd416..ed5215b 100644 (file)
@@ -1,5 +1,5 @@
-# serial 4   -*- Autoconf -*-
-# Copyright (C) 2006-2007, 2009-2011 Free Software Foundation, Inc.
+# serial 5   -*- Autoconf -*-
+# Copyright (C) 2006-2007, 2009-2012 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.
@@ -18,7 +18,6 @@ AC_DEFUN([gl_HEADERS_SELINUX_SELINUX_H],
     if test "$ac_cv_header_selinux_selinux_h" = yes; then
       # We do have <selinux/selinux.h>, so do compile getfilecon.c
       # and arrange to use its wrappers.
-      AC_LIBOBJ([getfilecon])
       gl_CHECK_NEXT_HEADERS([selinux/selinux.h])
       AC_DEFINE([getfilecon], [rpl_getfilecon],
                 [Always use our getfilecon wrapper.])
index ba619b0..e1931e7 100644 (file)
@@ -1,5 +1,5 @@
-# setenv.m4 serial 21
-dnl Copyright (C) 2001-2004, 2006-2011 Free Software Foundation, Inc.
+# setenv.m4 serial 26
+dnl Copyright (C) 2001-2004, 2006-2012 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,20 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_SETENV],
 [
   AC_REQUIRE([gl_FUNC_SETENV_SEPARATE])
-  if test $HAVE_SETENV$REPLACE_SETENV != 10; then
-    AC_LIBOBJ([setenv])
-  fi
-])
-
-# Like gl_FUNC_SETENV, except prepare for separate compilation (no AC_LIBOBJ).
-AC_DEFUN([gl_FUNC_SETENV_SEPARATE],
-[
-  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
-  AC_CHECK_DECLS_ONCE([setenv])
-  if test $ac_cv_have_decl_setenv = no; then
-    HAVE_DECL_SETENV=0
-  fi
-  AC_CHECK_FUNCS_ONCE([setenv])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   if test $ac_cv_func_setenv = no; then
     HAVE_SETENV=0
   else
@@ -47,27 +34,48 @@ AC_DEFUN([gl_FUNC_SETENV_SEPARATE],
        return result;
       ]])],
       [gl_cv_func_setenv_works=yes], [gl_cv_func_setenv_works=no],
-      [gl_cv_func_setenv_works="guessing no"])])
-    if test "$gl_cv_func_setenv_works" != yes; then
-      REPLACE_SETENV=1
-      AC_LIBOBJ([setenv])
-    fi
+      [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
+      ])])
+    case "$gl_cv_func_setenv_works" in
+      *yes) ;;
+      *)
+        REPLACE_SETENV=1
+        ;;
+    esac
   fi
+])
+
+# Like gl_FUNC_SETENV, except prepare for separate compilation
+# (no REPLACE_SETENV, no AC_LIBOBJ).
+AC_DEFUN([gl_FUNC_SETENV_SEPARATE],
+[
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  AC_CHECK_DECLS_ONCE([setenv])
+  if test $ac_cv_have_decl_setenv = no; then
+    HAVE_DECL_SETENV=0
+  fi
+  AC_CHECK_FUNCS_ONCE([setenv])
   gl_PREREQ_SETENV
 ])
 
 AC_DEFUN([gl_FUNC_UNSETENV],
 [
   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CHECK_DECLS_ONCE([unsetenv])
   if test $ac_cv_have_decl_unsetenv = no; then
     HAVE_DECL_UNSETENV=0
   fi
   AC_CHECK_FUNCS([unsetenv])
   if test $ac_cv_func_unsetenv = no; then
-    AC_LIBOBJ([unsetenv])
-    gl_PREREQ_UNSETENV
+    HAVE_UNSETENV=0
   else
+    HAVE_UNSETENV=1
     dnl Some BSDs return void, failing to do error checking.
     AC_CACHE_CHECK([for unsetenv() return type], [gt_cv_func_unsetenv_ret],
       [AC_COMPILE_IFELSE(
@@ -80,11 +88,7 @@ extern
 #ifdef __cplusplus
 "C"
 #endif
-#if defined(__STDC__) || defined(__cplusplus)
 int unsetenv (const char *name);
-#else
-int unsetenv();
-#endif
             ]],
             [[]])],
          [gt_cv_func_unsetenv_ret='int'],
@@ -93,7 +97,6 @@ int unsetenv();
       AC_DEFINE([VOID_UNSETENV], [1], [Define to 1 if unsetenv returns void
        instead of int.])
       REPLACE_UNSETENV=1
-      AC_LIBOBJ([unsetenv])
     fi
 
     dnl Solaris 10 unsetenv does not remove all copies of a name.
@@ -123,11 +126,19 @@ int unsetenv();
        if (getenv ("a")) return 6;
       ]])],
       [gl_cv_func_unsetenv_works=yes], [gl_cv_func_unsetenv_works=no],
-      [gl_cv_func_unsetenv_works="guessing no"])])
-    if test "$gl_cv_func_unsetenv_works" != yes; then
-      REPLACE_UNSETENV=1
-      AC_LIBOBJ([unsetenv])
-    fi
+      [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
+      ])])
+    case "$gl_cv_func_unsetenv_works" in
+      *yes) ;;
+      *)
+        REPLACE_UNSETENV=1
+        ;;
+    esac
   fi
 ])
 
index 6672c34..c605241 100644 (file)
@@ -1,5 +1,5 @@
-# setlocale.m4 serial 1
-dnl Copyright (C) 2011 Free Software Foundation, Inc.
+# setlocale.m4 serial 4
+dnl Copyright (C) 2011-2012 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,12 +12,14 @@ AC_DEFUN([gl_FUNC_SETLOCALE],
     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 ;;
+    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 ;;
+      esac
+      ;;
   esac
-  if test $REPLACE_SETLOCALE = 1; then
-    gl_REPLACE_LOCALE_H
-    AC_LIBOBJ([setlocale])
-    gl_PREREQ_SETLOCALE
-  fi
 ])
 
 # Prerequisites of lib/setlocale.c.
index e807098..5a8162b 100644 (file)
@@ -1,5 +1,5 @@
 # size_max.m4 serial 10
-dnl Copyright (C) 2003, 2005-2006, 2008-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2006, 2008-2012 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 d712752..209d64c 100644 (file)
@@ -1,5 +1,5 @@
 # ssize_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2001-2003, 2006, 2010-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2003, 2006, 2010-2012 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 27f82d5..a8b79f5 100644 (file)
@@ -1,6 +1,6 @@
-# serial 7
+# serial 10
 
-# Copyright (C) 2009-2011 Free Software Foundation, Inc.
+# Copyright (C) 2009-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -23,8 +23,9 @@ AC_DEFUN([gl_FUNC_STAT],
             mingw*) gl_cv_func_stat_dir_slash="guessing no";;
             *) gl_cv_func_stat_dir_slash="guessing yes";;
           esac])])
-  dnl AIX 7.1, Solaris 9 mistakenly succeed on stat("file/")
-  dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/")
+  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
@@ -46,7 +47,13 @@ AC_DEFUN([gl_FUNC_STAT],
       return result;
            ]])],
          [gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no],
-         [gl_cv_func_stat_file_slash="guessing 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
@@ -58,9 +65,11 @@ AC_DEFUN([gl_FUNC_STAT],
       AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs
         help when passed a file name with a trailing slash]);;
   esac
-  if test $REPLACE_STAT = 1; then
-    AC_LIBOBJ([stat])
-    dnl Prerequisites of lib/stat.c.
-    AC_REQUIRE([AC_C_INLINE])
-  fi
+])
+
+# Prerequisites of lib/stat.c.
+AC_DEFUN([gl_PREREQ_STAT],
+[
+  AC_REQUIRE([AC_C_INLINE])
+  :
 ])
index 838cf0f..eabfa64 100644 (file)
@@ -1,11 +1,11 @@
 # Check for stdbool.h that conforms to C99.
 
-dnl Copyright (C) 2002-2006, 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2012 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 4
+#serial 5
 
 # Prepare for substituting <stdbool.h> if it is not supported.
 
@@ -21,6 +21,7 @@ AC_DEFUN([AM_STDBOOL_H],
     STDBOOL_H='stdbool.h'
   fi
   AC_SUBST([STDBOOL_H])
+  AM_CONDITIONAL([GL_GENERATE_STDBOOL_H], [test -n "$STDBOOL_H"])
 
   if test "$ac_cv_type__Bool" = yes; then
     HAVE__BOOL=1
index 1942b6a..cc11609 100644 (file)
@@ -1,6 +1,6 @@
 dnl A placeholder for POSIX 2008 <stddef.h>, for platforms that have issues.
-# stddef_h.m4 serial 3
-dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
+# stddef_h.m4 serial 4
+dnl Copyright (C) 2009-2012 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,6 +9,7 @@ AC_DEFUN([gl_STDDEF_H],
 [
   AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
   AC_REQUIRE([gt_TYPE_WCHAR_T])
+  STDDEF_H=
   if test $gt_cv_c_wchar_t = no; then
     HAVE_WCHAR_T=0
     STDDEF_H=stddef.h
@@ -24,6 +25,8 @@ 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
     gl_NEXT_HEADERS([stddef.h])
   fi
@@ -41,5 +44,4 @@ AC_DEFUN([gl_STDDEF_H_DEFAULTS],
   dnl Assume proper GNU behavior unless another module says otherwise.
   REPLACE_NULL=0;                AC_SUBST([REPLACE_NULL])
   HAVE_WCHAR_T=1;                AC_SUBST([HAVE_WCHAR_T])
-  STDDEF_H='';                   AC_SUBST([STDDEF_H])
 ])
index e7d0d07..28d342e 100644 (file)
@@ -1,5 +1,5 @@
-# stdint.m4 serial 39
-dnl Copyright (C) 2001-2011 Free Software Foundation, Inc.
+# stdint.m4 serial 43
+dnl Copyright (C) 2001-2012 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 Paul Eggert and Bruno Haible.
 dnl Test whether <stdint.h> is supported or must be substituted.
 
-AC_DEFUN([gl_STDINT_H],
+AC_DEFUN_ONCE([gl_STDINT_H],
 [
   AC_PREREQ([2.59])dnl
 
@@ -69,8 +69,6 @@ AC_DEFUN([gl_STDINT_H],
       [gl_cv_header_working_stdint_h=no
        AC_COMPILE_IFELSE([
          AC_LANG_PROGRAM([[
-#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
-#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
 #include <stdint.h>
 /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>.  */
@@ -219,8 +217,6 @@ struct s {
           dnl This detects a bug on HP-UX 11.23/ia64.
           AC_RUN_IFELSE([
             AC_LANG_PROGRAM([[
-#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
-#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
 #include <stdint.h>
 ]
@@ -305,6 +301,7 @@ static const char *macro_values[] =
     STDINT_H=stdint.h
   fi
   AC_SUBST([STDINT_H])
+  AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"])
 ])
 
 dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES)
@@ -465,6 +462,14 @@ AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
   fi
   gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t],
     [gl_STDINT_INCLUDES])
+
+  dnl If wint_t is smaller than 'int', it cannot satisfy the ISO C 99
+  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 $BITSIZEOF_WINT_T -lt 32; then
+    BITSIZEOF_WINT_T=32
+  fi
 ])
 
 dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
index 356b14e..581de96 100644 (file)
@@ -1,5 +1,5 @@
 # stdint_h.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006, 2008-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2012 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 7f3ae56..5298dd6 100644 (file)
@@ -1,5 +1,5 @@
-# stdio_h.m4 serial 33
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# stdio_h.m4 serial 42
+dnl Copyright (C) 2007-2012 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,6 +9,31 @@ AC_DEFUN([gl_STDIO_H],
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   AC_REQUIRE([AC_C_INLINE])
   gl_NEXT_HEADERS([stdio.h])
+
+  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
+  dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING
+  dnl or GNULIB_NONBLOCKING redundant.
+  m4_ifdef([gl_NONBLOCKING_IO], [
+    gl_NONBLOCKING_IO
+    if test $gl_cv_have_nonblocking != yes; then
+      REPLACE_STDIO_READ_FUNCS=1
+      AC_LIBOBJ([stdio-read])
+    fi
+  ])
+
   dnl No need to create extra modules for these functions. Everyone who uses
   dnl <stdio.h> likely needs them.
   GNULIB_FPRINTF=1
@@ -21,9 +46,11 @@ AC_DEFUN([gl_STDIO_H],
   GNULIB_FPUTS=1
   GNULIB_PUTS=1
   GNULIB_FWRITE=1
-  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_STDIO_H_SIGPIPE or GNULIB_SIGPIPE redundant.
+  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
+  dnl is not used. But it does not make the test of GNULIB_STDIO_H_SIGPIPE or
+  dnl GNULIB_SIGPIPE redundant.
   m4_ifdef([gl_SIGNAL_SIGPIPE], [
     gl_SIGNAL_SIGPIPE
     if test $gl_cv_header_signal_h_SIGPIPE != yes; then
@@ -31,13 +58,25 @@ AC_DEFUN([gl_STDIO_H],
       AC_LIBOBJ([stdio-write])
     fi
   ])
+  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
+  dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING
+  dnl or GNULIB_NONBLOCKING redundant.
+  m4_ifdef([gl_NONBLOCKING_IO], [
+    gl_NONBLOCKING_IO
+    if test $gl_cv_have_nonblocking != yes; then
+      REPLACE_STDIO_WRITE_FUNCS=1
+      AC_LIBOBJ([stdio-write])
+    fi
+  ])
 
   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.
+  dnl guaranteed by both C89 and C11.
   gl_WARN_ON_USE_PREPARE([[#include <stdio.h>
-    ]], [dprintf fpurge fseeko ftello getdelim getline popen renameat
-    snprintf tmpfile vdprintf vsnprintf])
+    ]], [dprintf fpurge fseeko ftello getdelim getline gets pclose popen
+    renameat snprintf tmpfile vdprintf vsnprintf])
 ])
 
 AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
@@ -53,23 +92,31 @@ 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])
@@ -80,11 +127,15 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
   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])
@@ -104,11 +155,14 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
   HAVE_DPRINTF=1;                AC_SUBST([HAVE_DPRINTF])
   HAVE_FSEEKO=1;                 AC_SUBST([HAVE_FSEEKO])
   HAVE_FTELLO=1;                 AC_SUBST([HAVE_FTELLO])
+  HAVE_PCLOSE=1;                 AC_SUBST([HAVE_PCLOSE])
+  HAVE_POPEN=1;                  AC_SUBST([HAVE_POPEN])
   HAVE_RENAMEAT=1;               AC_SUBST([HAVE_RENAMEAT])
   HAVE_VASPRINTF=1;              AC_SUBST([HAVE_VASPRINTF])
   HAVE_VDPRINTF=1;               AC_SUBST([HAVE_VDPRINTF])
   REPLACE_DPRINTF=0;             AC_SUBST([REPLACE_DPRINTF])
   REPLACE_FCLOSE=0;              AC_SUBST([REPLACE_FCLOSE])
+  REPLACE_FDOPEN=0;              AC_SUBST([REPLACE_FDOPEN])
   REPLACE_FFLUSH=0;              AC_SUBST([REPLACE_FFLUSH])
   REPLACE_FOPEN=0;               AC_SUBST([REPLACE_FOPEN])
   REPLACE_FPRINTF=0;             AC_SUBST([REPLACE_FPRINTF])
@@ -129,6 +183,7 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
   REPLACE_RENAMEAT=0;            AC_SUBST([REPLACE_RENAMEAT])
   REPLACE_SNPRINTF=0;            AC_SUBST([REPLACE_SNPRINTF])
   REPLACE_SPRINTF=0;             AC_SUBST([REPLACE_SPRINTF])
+  REPLACE_STDIO_READ_FUNCS=0;    AC_SUBST([REPLACE_STDIO_READ_FUNCS])
   REPLACE_STDIO_WRITE_FUNCS=0;   AC_SUBST([REPLACE_STDIO_WRITE_FUNCS])
   REPLACE_TMPFILE=0;             AC_SUBST([REPLACE_TMPFILE])
   REPLACE_VASPRINTF=0;           AC_SUBST([REPLACE_VASPRINTF])
index 25fdada..ab43728 100644 (file)
@@ -1,5 +1,5 @@
-# stdlib_h.m4 serial 37
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# stdlib_h.m4 serial 41
+dnl Copyright (C) 2007-2012 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.
@@ -19,10 +19,11 @@ AC_DEFUN([gl_STDLIB_H],
 #if HAVE_RANDOM_H
 # include <random.h>
 #endif
-    ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt mkdtemp
-    mkostemp mkostemps mkstemp mkstemps ptsname random_r initstat_r srandom_r
-    setstate_r realpath rpmatch setenv strtod strtoll strtoull unlockpt
-    unsetenv])
+    ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt
+    initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps
+    posix_openpt ptsname ptsname_r random random_r realpath rpmatch
+    setenv setstate setstate_r srandom srandom_r
+    strtod strtoll strtoull unlockpt unsetenv])
 ])
 
 AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
@@ -50,8 +51,11 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
   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_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])
@@ -76,7 +80,10 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
   HAVE_MKOSTEMPS=1;          AC_SUBST([HAVE_MKOSTEMPS])
   HAVE_MKSTEMP=1;            AC_SUBST([HAVE_MKSTEMP])
   HAVE_MKSTEMPS=1;           AC_SUBST([HAVE_MKSTEMPS])
+  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])
+  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_REALPATH=1;           AC_SUBST([HAVE_REALPATH])
@@ -95,7 +102,9 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
   REPLACE_MALLOC=0;          AC_SUBST([REPLACE_MALLOC])
   REPLACE_MBTOWC=0;          AC_SUBST([REPLACE_MBTOWC])
   REPLACE_MKSTEMP=0;         AC_SUBST([REPLACE_MKSTEMP])
+  REPLACE_PTSNAME_R=0;       AC_SUBST([REPLACE_PTSNAME_R])
   REPLACE_PUTENV=0;          AC_SUBST([REPLACE_PUTENV])
+  REPLACE_RANDOM_R=0;        AC_SUBST([REPLACE_RANDOM_R])
   REPLACE_REALLOC=0;         AC_SUBST([REPLACE_REALLOC])
   REPLACE_REALPATH=0;        AC_SUBST([REPLACE_REALPATH])
   REPLACE_SETENV=0;          AC_SUBST([REPLACE_SETENV])
index c321d49..8e95457 100644 (file)
@@ -1,5 +1,5 @@
-# stpcpy.m4 serial 7
-dnl Copyright (C) 2002, 2007, 2009-2011 Free Software Foundation, Inc.
+# stpcpy.m4 serial 8
+dnl Copyright (C) 2002, 2007, 2009-2012 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,10 +13,9 @@ AC_DEFUN([gl_FUNC_STPCPY],
   AC_REQUIRE([AC_C_RESTRICT])
 
   AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
-  AC_REPLACE_FUNCS([stpcpy])
+  AC_CHECK_FUNCS([stpcpy])
   if test $ac_cv_func_stpcpy = no; then
     HAVE_STPCPY=0
-    gl_PREREQ_STPCPY
   fi
 ])
 
index cc7796a..90ae53b 100644 (file)
@@ -1,5 +1,5 @@
-# stpncpy.m4 serial 13
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2011 Free Software Foundation,
+# stpncpy.m4 serial 16
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2012 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,
@@ -35,7 +35,11 @@ AC_DEFUN([gl_FUNC_STPNCPY],
 #include <string.h> /* for strcpy */
 /* The stpncpy prototype is missing in <string.h> on AIX 4.  */
 #if !HAVE_DECL_STPNCPY
-extern char *stpncpy (char *dest, const char *src, size_t n);
+extern
+# ifdef __cplusplus
+"C"
+# endif
+char *stpncpy (char *dest, const char *src, size_t n);
 #endif
 int main ()
 {
@@ -70,21 +74,20 @@ int main ()
 #ifdef __GNU_LIBRARY__
   Thanks for using GNU
 #endif
-], [gl_cv_func_stpncpy=yes], [gl_cv_func_stpncpy=no])
+], [gl_cv_func_stpncpy="guessing yes"], [gl_cv_func_stpncpy="guessing no"])
         ])
     ])
-    if test $gl_cv_func_stpncpy = yes; then
-      AC_DEFINE([HAVE_STPNCPY], [1],
-        [Define if you have the stpncpy() function and it works.])
-    else
-      REPLACE_STPNCPY=1
-      AC_LIBOBJ([stpncpy])
-      gl_PREREQ_STPNCPY
-    fi
+    case "$gl_cv_func_stpncpy" in
+      *yes)
+        AC_DEFINE([HAVE_STPNCPY], [1],
+          [Define if you have the stpncpy() function and it works.])
+        ;;
+      *)
+        REPLACE_STPNCPY=1
+        ;;
+    esac
   else
     HAVE_STPNCPY=0
-    AC_LIBOBJ([stpncpy])
-    gl_PREREQ_STPNCPY
   fi
 ])
 
diff --git a/gnulib/m4/strchrnul.m4 b/gnulib/m4/strchrnul.m4
new file mode 100644 (file)
index 0000000..d3dfb9a
--- /dev/null
@@ -0,0 +1,50 @@
+# strchrnul.m4 serial 9
+dnl Copyright (C) 2003, 2007, 2009-2012 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_STRCHRNUL],
+[
+  dnl Persuade glibc <string.h> to declare strchrnul().
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  AC_CHECK_FUNCS([strchrnul])
+  if test $ac_cv_func_strchrnul = no; then
+    HAVE_STRCHRNUL=0
+  else
+    AC_CACHE_CHECK([whether strchrnul works],
+      [gl_cv_func_strchrnul_works],
+      [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <string.h> /* for strchrnul */
+]], [[const char *buf = "a";
+      return strchrnul (buf, 'b') != buf + 1;
+    ]])],
+        [gl_cv_func_strchrnul_works=yes],
+        [gl_cv_func_strchrnul_works=no],
+        [dnl Cygwin 1.7.9 introduced strchrnul, but it was broken until 1.7.10
+         AC_EGREP_CPP([Lucky user],
+           [
+#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
+           ],
+           [gl_cv_func_strchrnul_works="guessing yes"],
+           [gl_cv_func_strchrnul_works="guessing no"])
+        ])
+      ])
+    case "$gl_cv_func_strchrnul_works" in
+      *yes) ;;
+      *) REPLACE_STRCHRNUL=1 ;;
+    esac
+  fi
+])
+
+# Prerequisites of lib/strchrnul.c.
+AC_DEFUN([gl_PREREQ_STRCHRNUL], [:])
index 30ddfbc..5677e09 100644 (file)
@@ -1,11 +1,11 @@
 # Configure a GNU-like replacement for <string.h>.
 
-# Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# Copyright (C) 2007-2012 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 19
+# serial 21
 
 # Written by Paul Eggert.
 
@@ -27,9 +27,9 @@ AC_DEFUN([gl_HEADER_STRING_H_BODY],
   dnl guaranteed by C89.
   gl_WARN_ON_USE_PREPARE([[#include <string.h>
     ]],
-    [memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup
-     strncat strndup strnlen strpbrk strsep strcasestr strtok_r strerror_r
-     strsignal strverscmp])
+    [ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul
+     strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r
+     strerror_r strsignal strverscmp])
 ])
 
 AC_DEFUN([gl_STRING_MODULE_INDICATOR],
@@ -43,6 +43,8 @@ AC_DEFUN([gl_STRING_MODULE_INDICATOR],
 
 AC_DEFUN([gl_HEADER_STRING_H_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])
@@ -80,6 +82,8 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
   GNULIB_STRVERSCMP=0;  AC_SUBST([GNULIB_STRVERSCMP])
   HAVE_MBSLEN=0;        AC_SUBST([HAVE_MBSLEN])
   dnl Assume proper GNU behavior unless another module says otherwise.
+  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])
@@ -104,6 +108,7 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
   REPLACE_STRDUP=0;             AC_SUBST([REPLACE_STRDUP])
   REPLACE_STRSTR=0;             AC_SUBST([REPLACE_STRSTR])
   REPLACE_STRCASESTR=0;         AC_SUBST([REPLACE_STRCASESTR])
+  REPLACE_STRCHRNUL=0;          AC_SUBST([REPLACE_STRCHRNUL])
   REPLACE_STRERROR=0;           AC_SUBST([REPLACE_STRERROR])
   REPLACE_STRERROR_R=0;         AC_SUBST([REPLACE_STRERROR_R])
   REPLACE_STRNCAT=0;            AC_SUBST([REPLACE_STRNCAT])
index d8f00ca..cef6889 100644 (file)
@@ -1,5 +1,5 @@
-# strndup.m4 serial 18
-dnl Copyright (C) 2002-2003, 2005-2011 Free Software Foundation, Inc.
+# strndup.m4 serial 21
+dnl Copyright (C) 2002-2003, 2005-2012 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.
@@ -18,13 +18,18 @@ AC_DEFUN([gl_FUNC_STRNDUP],
   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'.
     AC_CACHE_CHECK([for working strndup], [gl_cv_func_strndup_works],
       [AC_RUN_IFELSE([
          AC_LANG_PROGRAM([[#include <string.h>
                            #include <stdlib.h>]], [[
-#ifndef HAVE_DECL_STRNDUP
-  extern char *strndup (const char *, size_t);
+#if !HAVE_DECL_STRNDUP
+  extern
+  #ifdef __cplusplus
+  "C"
+  #endif
+  char *strndup (const char *, size_t);
 #endif
   char *s;
   s = strndup ("some longer string", 15);
@@ -42,12 +47,9 @@ changequote(,)dnl
 changequote([,])dnl
          ])])
     case $gl_cv_func_strndup_works in
-      *no)
-        REPLACE_STRNDUP=1
-        AC_LIBOBJ([strndup])
-        ;;
+      *no) REPLACE_STRNDUP=1 ;;
     esac
   else
-    AC_LIBOBJ([strndup])
+    HAVE_STRNDUP=0
   fi
 ])
index a1c59ac..d97e307 100644 (file)
@@ -1,5 +1,5 @@
-# strnlen.m4 serial 12
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2011 Free Software Foundation,
+# strnlen.m4 serial 13
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2012 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,
@@ -16,16 +16,14 @@ AC_DEFUN([gl_FUNC_STRNLEN],
   if test $ac_cv_have_decl_strnlen = no; then
     HAVE_DECL_STRNLEN=0
   else
-    AC_FUNC_STRNLEN
+    m4_pushdef([AC_LIBOBJ], [:])
     dnl Note: AC_FUNC_STRNLEN does AC_LIBOBJ([strnlen]).
+    AC_FUNC_STRNLEN
+    m4_popdef([AC_LIBOBJ])
     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
-    AC_LIBOBJ([strnlen])
-    gl_PREREQ_STRNLEN
-  fi
 ])
 
 # Prerequisites of lib/strnlen.c.
index a42a1db..b8f94bf 100644 (file)
@@ -1,5 +1,5 @@
-# strstr.m4 serial 13
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# strstr.m4 serial 16
+dnl Copyright (C) 2008-2012 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,6 @@ AC_DEFUN([gl_FUNC_STRSTR_SIMPLE],
   AC_REQUIRE([gl_FUNC_MEMCHR])
   if test "$gl_cv_func_memchr_works" != yes; then
     REPLACE_STRSTR=1
-    AC_LIBOBJ([strstr])
   else
     dnl Detect http://sourceware.org/bugzilla/show_bug.cgi?id=12092.
     AC_CACHE_CHECK([whether strstr works],
@@ -47,14 +46,16 @@ AC_DEFUN([gl_FUNC_STRSTR_SIMPLE],
   Lucky user
 #endif
            ],
-           [gl_cv_func_strstr_works_always=yes],
+           [gl_cv_func_strstr_works_always="guessing yes"],
            [gl_cv_func_strstr_works_always="guessing no"])
         ])
       ])
-    if test "$gl_cv_func_strstr_works_always" != yes; then
-      REPLACE_STRSTR=1
-      AC_LIBOBJ([strstr])
-    fi
+    case "$gl_cv_func_strstr_works_always" in
+      *yes) ;;
+      *)
+        REPLACE_STRSTR=1
+        ;;
+    esac
   fi
 ]) # gl_FUNC_STRSTR_SIMPLE
 
@@ -95,13 +96,15 @@ static void quit (int sig) { exit (sig + 128); }
     return result;
     ]])],
         [gl_cv_func_strstr_linear=yes], [gl_cv_func_strstr_linear=no],
-        [dnl Only glibc > 2.12 and cygwin > 1.7.7 are known to have a
-         dnl bug-free strstr that works in linear time.
+        [dnl Only glibc > 2.12 on processors without SSE 4.2 instructions and
+         dnl cygwin > 1.7.7 are known to have a bug-free strstr that works in
+         dnl linear time.
          AC_EGREP_CPP([Lucky user],
            [
 #include <features.h>
 #ifdef __GNU_LIBRARY__
  #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+     && !(defined __i386__ || defined __x86_64__) \
      && !defined __UCLIBC__
   Lucky user
  #endif
@@ -113,15 +116,15 @@ static void quit (int sig) { exit (sig + 128); }
  #endif
 #endif
            ],
-           [gl_cv_func_strstr_linear=yes],
+           [gl_cv_func_strstr_linear="guessing yes"],
            [gl_cv_func_strstr_linear="guessing no"])
         ])
       ])
-    if test "$gl_cv_func_strstr_linear" != yes; then
-      REPLACE_STRSTR=1
-    fi
-  fi
-  if test $REPLACE_STRSTR = 1; then
-    AC_LIBOBJ([strstr])
+    case "$gl_cv_func_strstr_linear" in
+      *yes) ;;
+      *)
+        REPLACE_STRSTR=1
+        ;;
+    esac
   fi
 ]) # gl_FUNC_STRSTR
index 917d5f0..cfd90ec 100644 (file)
@@ -1,7 +1,7 @@
-# serial 4
+# serial 6
 # See if we need to provide symlink replacement.
 
-dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2012 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,13 +11,13 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_SYMLINK],
 [
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CHECK_FUNCS_ONCE([symlink])
   dnl The best we can do on mingw is provide a dummy that always fails, so
   dnl that compilation can proceed with fewer ifdefs.  On FreeBSD 7.2, AIX 7.1,
   dnl and Solaris 9, we want to fix a bug with trailing slash handling.
   if test $ac_cv_func_symlink = no; then
     HAVE_SYMLINK=0
-    AC_LIBOBJ([symlink])
   else
     AC_CACHE_CHECK([whether symlink handles trailing slash correctly],
       [gl_cv_func_symlink_works],
@@ -35,11 +35,19 @@ AC_DEFUN([gl_FUNC_SYMLINK],
              return result;
            ]])],
          [gl_cv_func_symlink_works=yes], [gl_cv_func_symlink_works=no],
-         [gl_cv_func_symlink_works="guessing 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" ;;
+          esac
+         ])
       rm -f conftest.f conftest.link conftest.lnk2])
-    if test "$gl_cv_func_symlink_works" != yes; then
-      REPLACE_SYMLINK=1
-      AC_LIBOBJ([symlink])
-    fi
+    case "$gl_cv_func_symlink_works" in
+      *yes) ;;
+      *)
+        REPLACE_SYMLINK=1
+        ;;
+    esac
   fi
 ])
diff --git a/gnulib/m4/sys_socket_h.m4 b/gnulib/m4/sys_socket_h.m4
new file mode 100644 (file)
index 0000000..8d4e7e1
--- /dev/null
@@ -0,0 +1,177 @@
+# sys_socket_h.m4 serial 22
+dnl Copyright (C) 2005-2012 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_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([AC_C_INLINE])
+
+  dnl On OSF/1, the functions recv(), send(), recvfrom(), sendto() have
+  dnl old-style declarations (with return type 'int' instead of 'ssize_t')
+  dnl unless _POSIX_PII_SOCKET is defined.
+  case "$host_os" in
+    osf*)
+      AC_DEFINE([_POSIX_PII_SOCKET], [1],
+        [Define to 1 in order to get the POSIX compatible declarations
+         of socket functions.])
+      ;;
+  esac
+
+  AC_CACHE_CHECK([whether <sys/socket.h> is self-contained],
+    [gl_cv_header_sys_socket_h_selfcontained],
+    [
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[]])],
+        [gl_cv_header_sys_socket_h_selfcontained=yes],
+        [gl_cv_header_sys_socket_h_selfcontained=no])
+    ])
+  if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
+    dnl If the shutdown function exists, <sys/socket.h> should define
+    dnl SHUT_RD, SHUT_WR, SHUT_RDWR.
+    AC_CHECK_FUNCS([shutdown])
+    if test $ac_cv_func_shutdown = yes; then
+      AC_CACHE_CHECK([whether <sys/socket.h> defines the SHUT_* macros],
+        [gl_cv_header_sys_socket_h_shut],
+        [
+          AC_COMPILE_IFELSE(
+            [AC_LANG_PROGRAM([[#include <sys/socket.h>]],
+               [[int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };]])],
+            [gl_cv_header_sys_socket_h_shut=yes],
+            [gl_cv_header_sys_socket_h_shut=no])
+        ])
+      if test $gl_cv_header_sys_socket_h_shut = no; then
+        SYS_SOCKET_H='sys/socket.h'
+      fi
+    fi
+  fi
+  # We need to check for ws2tcpip.h now.
+  gl_PREREQ_SYS_H_SOCKET
+  AC_CHECK_TYPES([struct sockaddr_storage, 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 $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_CHECK_MEMBERS([struct sockaddr_storage.ss_family],
+      [],
+      [HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0],
+      [#include <sys/types.h>
+       #ifdef HAVE_SYS_SOCKET_H
+       #include <sys/socket.h>
+       #endif
+       #ifdef HAVE_WS2TCPIP_H
+       #include <ws2tcpip.h>
+       #endif
+      ])
+  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
+  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>
+#include <sys/socket.h>
+    ]], [socket connect accept bind getpeername getsockname getsockopt
+    listen recv send recvfrom sendto setsockopt shutdown accept4])
+])
+
+AC_DEFUN([gl_PREREQ_SYS_H_SOCKET],
+[
+  dnl Check prerequisites of the <sys/socket.h> replacement.
+  AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])
+  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])
+])
+
+# Common prerequisites of the <sys/socket.h> replacement and of the
+# <sys/select.h> replacement.
+# Sets and substitutes HAVE_WINSOCK2_H.
+AC_DEFUN([gl_PREREQ_SYS_H_WINSOCK2],
+[
+  m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])])
+  m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])])
+  AC_CHECK_HEADERS_ONCE([sys/socket.h])
+  if test $ac_cv_header_sys_socket_h != yes; 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([winsock2.h])
+  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
+  AC_SUBST([HAVE_WINSOCK2_H])
+])
+
+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])
+  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_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])
+  HAVE_SA_FAMILY_T=1;   AC_SUBST([HAVE_SA_FAMILY_T])
+  HAVE_ACCEPT4=1;       AC_SUBST([HAVE_ACCEPT4])
+])
index fc41912..f45dee1 100644 (file)
@@ -1,5 +1,5 @@
-# sys_stat_h.m4 serial 24   -*- Autoconf -*-
-dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
+# sys_stat_h.m4 serial 27   -*- Autoconf -*-
+dnl Copyright (C) 2006-2012 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.
@@ -19,6 +19,22 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H],
 
   gl_CHECK_NEXT_HEADERS([sys/stat.h])
 
+  dnl Ensure the type mode_t gets defined.
+  AC_REQUIRE([AC_TYPE_MODE_T])
+
+  dnl Whether to override 'struct stat'.
+  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>.
   AC_CHECK_TYPE([nlink_t], [],
@@ -30,7 +46,7 @@ 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 fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat
+    ]], [fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat
     mknod mknodat stat utimensat])
 ]) # gl_HEADER_SYS_STAT_H
 
@@ -47,6 +63,7 @@ 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])
diff --git a/gnulib/m4/sys_time_h.m4 b/gnulib/m4/sys_time_h.m4
new file mode 100644 (file)
index 0000000..c4a30cd
--- /dev/null
@@ -0,0 +1,110 @@
+# Configure a replacement for <sys/time.h>.
+# serial 8
+
+# Copyright (C) 2007, 2009-2012 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],
+[
+  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([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])
+
+  if test $ac_cv_header_sys_time_h != yes; then
+    HAVE_SYS_TIME_H=0
+  fi
+
+  dnl On native Windows with MSVC, 'struct timeval' is defined in <winsock2.h>
+  dnl only. So include that header in the list.
+  gl_PREREQ_SYS_H_WINSOCK2
+  AC_CACHE_CHECK([for struct timeval], [gl_cv_sys_struct_timeval],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#if HAVE_SYS_TIME_H
+             #include <sys/time.h>
+            #endif
+            #include <time.h>
+            #if HAVE_WINSOCK2_H
+            # include <winsock2.h>
+            #endif
+          ]],
+          [[static struct timeval x; x.tv_sec = x.tv_usec;]])],
+       [gl_cv_sys_struct_timeval=yes],
+       [gl_cv_sys_struct_timeval=no])
+    ])
+  if test $gl_cv_sys_struct_timeval != yes; then
+    HAVE_STRUCT_TIMEVAL=0
+  else
+    dnl On native Windows with a 64-bit 'time_t', 'struct timeval' is defined
+    dnl (in <sys/time.h> and <winsock2.h> for mingw64, in <winsock2.h> only
+    dnl for MSVC) with a tv_sec field of type 'long' (32-bit!), which is
+    dnl smaller than the 'time_t' type mandated by POSIX.
+    dnl On OpenBSD 5.1 amd64, tv_sec is 64 bits and time_t 32 bits, but
+    dnl that is good enough.
+    AC_CACHE_CHECK([for wide-enough struct timeval.tv_sec member],
+      [gl_cv_sys_struct_timeval_tv_sec],
+      [AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM(
+            [[#if HAVE_SYS_TIME_H
+               #include <sys/time.h>
+              #endif
+              #include <time.h>
+              #if HAVE_WINSOCK2_H
+              # include <winsock2.h>
+              #endif
+            ]],
+            [[static struct timeval x;
+              typedef int verify_tv_sec_type[
+                sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
+              ];
+            ]])],
+         [gl_cv_sys_struct_timeval_tv_sec=yes],
+         [gl_cv_sys_struct_timeval_tv_sec=no])
+      ])
+    if test $gl_cv_sys_struct_timeval_tv_sec != yes; then
+      REPLACE_STRUCT_TIMEVAL=1
+    fi
+  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_TIME_H
+# include <sys/time.h>
+#endif
+#include <time.h>
+    ]], [gettimeofday])
+])
+
+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])
+  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],
+[
+  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])
+  REPLACE_GETTIMEOFDAY=0;    AC_SUBST([REPLACE_GETTIMEOFDAY])
+  REPLACE_STRUCT_TIMEVAL=0;  AC_SUBST([REPLACE_STRUCT_TIMEVAL])
+])
diff --git a/gnulib/m4/sys_types_h.m4 b/gnulib/m4/sys_types_h.m4
new file mode 100644 (file)
index 0000000..f11eef2
--- /dev/null
@@ -0,0 +1,24 @@
+# sys_types_h.m4 serial 4
+dnl Copyright (C) 2011-2012 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_TYPES_H],
+[
+  AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS])
+  gl_NEXT_HEADERS([sys/types.h])
+
+  dnl Ensure the type pid_t gets defined.
+  AC_REQUIRE([AC_TYPE_PID_T])
+
+  dnl Ensure the type mode_t gets defined.
+  AC_REQUIRE([AC_TYPE_MODE_T])
+
+  dnl Whether to override the 'off_t' type.
+  AC_REQUIRE([gl_TYPE_OFF_T])
+])
+
+AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
+[
+])
index e3b147c..c0bba86 100644 (file)
@@ -1,5 +1,5 @@
-# sys_wait_h.m4 serial 5
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# sys_wait_h.m4 serial 6
+dnl Copyright (C) 2008-2012 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,6 +11,9 @@ AC_DEFUN([gl_SYS_WAIT_H],
   dnl <sys/wait.h> is always overridden, because of GNULIB_POSIXCHECK.
   gl_CHECK_NEXT_HEADERS([sys/wait.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.
   gl_WARN_ON_USE_PREPARE([[#include <sys/wait.h>]],
diff --git a/gnulib/m4/tempname.m4 b/gnulib/m4/tempname.m4
new file mode 100644 (file)
index 0000000..20ad78b
--- /dev/null
@@ -0,0 +1,19 @@
+#serial 5
+
+# Copyright (C) 2006-2007, 2009-2012 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.
+
+# glibc provides __gen_tempname as a wrapper for mk[ds]temp.  Expose
+# it as a public API, and provide it on systems that are lacking.
+AC_DEFUN([gl_FUNC_GEN_TEMPNAME],
+[
+  gl_PREREQ_TEMPNAME
+])
+
+# Prerequisites of lib/tempname.c.
+AC_DEFUN([gl_PREREQ_TEMPNAME],
+[
+  :
+])
index 49a4bc7..cd66c3e 100644 (file)
@@ -1,5 +1,5 @@
 # thread.m4 serial 2
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2012 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 8a621fd..cb93391 100644 (file)
@@ -1,5 +1,5 @@
-# threadlib.m4 serial 8 (gettext-0.18.2)
-dnl Copyright (C) 2005-2011 Free Software Foundation, Inc.
+# threadlib.m4 serial 10 (gettext-0.18.2)
+dnl Copyright (C) 2005-2012 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,7 +15,7 @@ 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_WIN32_THREADS
+dnl USE_PTH_THREADS, USE_WINDOWS_THREADS
 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).
@@ -53,7 +53,7 @@ AC_DEFUN([gl_THREADLIB_EARLY_BODY],
     [m4_divert_text([DEFAULTS], [gl_use_threads_default=no])],
     [m4_divert_text([DEFAULTS], [gl_use_threads_default=])])
   AC_ARG_ENABLE([threads],
-AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
+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])]),
     [gl_use_threads=$enableval],
     [if test -n "$gl_use_threads_default"; then
@@ -276,17 +276,19 @@ int main ()
       fi
     fi
     if test -z "$gl_have_pthread"; then
-      if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then
-        if { case "$host_os" in
-               mingw*) true;;
-               *) false;;
-             esac
-           }; then
-          gl_threads_api=win32
-          AC_DEFINE([USE_WIN32_THREADS], [1],
-            [Define if the Win32 multithreading API can be used.])
-        fi
-      fi
+      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
+            AC_DEFINE([USE_WINDOWS_THREADS], [1],
+              [Define if the native Windows multithreading API can be used.])
+          fi
+          ;;
+      esac
     fi
   fi
   AC_MSG_CHECKING([for multithread API to use])
@@ -317,50 +319,50 @@ AC_DEFUN([gl_DISABLE_THREADS], [
 
 dnl Survey of platforms:
 dnl
-dnl Platform          Available   Compiler    Supports   test-lock
-dnl                   flavours    option      weak       result
-dnl ---------------   ---------   ---------   --------   ---------
-dnl Linux 2.4/glibc   posix       -lpthread       Y      OK
+dnl Platform           Available  Compiler    Supports   test-lock
+dnl                    flavours   option      weak       result
+dnl ---------------    ---------  ---------   --------   ---------
+dnl Linux 2.4/glibc    posix      -lpthread       Y      OK
 dnl
-dnl GNU Hurd/glibc    posix
+dnl GNU Hurd/glibc     posix
 dnl
-dnl FreeBSD 5.3       posix       -lc_r           Y
-dnl                   posix       -lkse ?         Y
-dnl                   posix       -lpthread ?     Y
-dnl                   posix       -lthr           Y
+dnl FreeBSD 5.3        posix      -lc_r           Y
+dnl                    posix      -lkse ?         Y
+dnl                    posix      -lpthread ?     Y
+dnl                    posix      -lthr           Y
 dnl
-dnl FreeBSD 5.2       posix       -lc_r           Y
-dnl                   posix       -lkse           Y
-dnl                   posix       -lthr           Y
+dnl FreeBSD 5.2        posix      -lc_r           Y
+dnl                    posix      -lkse           Y
+dnl                    posix      -lthr           Y
 dnl
-dnl FreeBSD 4.0,4.10  posix       -lc_r           Y      OK
+dnl FreeBSD 4.0,4.10   posix      -lc_r           Y      OK
 dnl
-dnl NetBSD 1.6        --
+dnl NetBSD 1.6         --
 dnl
-dnl OpenBSD 3.4       posix       -lpthread       Y      OK
+dnl OpenBSD 3.4        posix      -lpthread       Y      OK
 dnl
-dnl MacOS X 10.[123]  posix       -lpthread       Y      OK
+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 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 HP-UX 11           posix      -lpthread       N (cc) OK
 dnl                                               Y (gcc)
 dnl
-dnl IRIX 6.5          posix       -lpthread       Y      0.5
+dnl IRIX 6.5           posix      -lpthread       Y      0.5
 dnl
-dnl AIX 4.3,5.1       posix       -lpthread       N      AIX 4: 0.5; AIX 5: OK
+dnl AIX 4.3,5.1        posix      -lpthread       N      AIX 4: 0.5; AIX 5: OK
 dnl
-dnl OSF/1 4.0,5.1     posix       -pthread (cc)   N      OK
+dnl OSF/1 4.0,5.1      posix      -pthread (cc)   N      OK
 dnl                               -lpthread (gcc) Y
 dnl
-dnl Cygwin            posix       -lpthread       Y      OK
+dnl Cygwin             posix      -lpthread       Y      OK
 dnl
-dnl Any of the above  pth         -lpth                  0.0
+dnl Any of the above   pth        -lpth                  0.0
 dnl
-dnl Mingw             win32                       N      OK
+dnl Mingw              windows                    N      OK
 dnl
-dnl BeOS 5            --
+dnl BeOS 5             --
 dnl
 dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
 dnl turned off:
index 615da1c..6415bfb 100644 (file)
@@ -1,8 +1,8 @@
 # Configure a more-standard replacement for <time.h>.
 
-# Copyright (C) 2000-2001, 2003-2007, 2009-2011 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2012 Free Software Foundation, Inc.
 
-# serial 4
+# serial 7
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -25,7 +25,7 @@ AC_DEFUN([gl_HEADER_TIME_H_BODY],
   AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
 ])
 
-dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared
+dnl Check whether 'struct timespec' is declared
 dnl in time.h, sys/time.h, or pthread.h.
 
 AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC],
index c81a113..7e7651b 100644 (file)
@@ -1,5 +1,5 @@
-# unistd_h.m4 serial 53
-dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
+# unistd_h.m4 serial 65
+dnl Copyright (C) 2006-2012 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,9 +21,18 @@ AC_DEFUN([gl_UNISTD_H],
   fi
   AC_SUBST([HAVE_UNISTD_H])
 
+  dnl Ensure the type pid_t gets defined.
+  AC_REQUIRE([AC_TYPE_PID_T])
+
+  dnl Determine WINDOWS_64_BIT_OFF_T.
+  AC_REQUIRE([gl_TYPE_OFF_T])
+
   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 <unistd.h>
+  gl_WARN_ON_USE_PREPARE([[
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
 /* Some systems declare various items in the wrong headers.  */
 #if !(defined __GLIBC__ && !defined __UCLIBC__)
 # include <fcntl.h>
@@ -33,12 +42,13 @@ AC_DEFUN([gl_UNISTD_H],
 #  include <io.h>
 # endif
 #endif
-    ]], [chown dup2 dup3 environ euidaccess faccessat fchdir fchownat
-    fsync ftruncate getcwd getdomainname getdtablesize getgroups
-    gethostname getlogin getlogin_r getpagesize getusershell setusershell
-    endusershell lchown link linkat lseek pipe pipe2 pread pwrite readlink
-    readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat
-    usleep])
+    ]], [chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat
+    fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups
+    gethostname getlogin getlogin_r getpagesize
+    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])
 ])
 
 AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
@@ -52,47 +62,54 @@ AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
 
 AC_DEFUN([gl_UNISTD_H_DEFAULTS],
 [
-  GNULIB_CHOWN=0;            AC_SUBST([GNULIB_CHOWN])
-  GNULIB_CLOSE=0;            AC_SUBST([GNULIB_CLOSE])
-  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_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_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_READLINK=0;         AC_SUBST([GNULIB_READLINK])
-  GNULIB_READLINKAT=0;       AC_SUBST([GNULIB_READLINKAT])
-  GNULIB_RMDIR=0;            AC_SUBST([GNULIB_RMDIR])
-  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_GETOPT=0;  AC_SUBST([GNULIB_UNISTD_H_GETOPT])
-  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])
+  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])
@@ -101,6 +118,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   HAVE_FACCESSAT=1;       AC_SUBST([HAVE_FACCESSAT])
   HAVE_FCHDIR=1;          AC_SUBST([HAVE_FCHDIR])
   HAVE_FCHOWNAT=1;        AC_SUBST([HAVE_FCHOWNAT])
+  HAVE_FDATASYNC=1;       AC_SUBST([HAVE_FDATASYNC])
   HAVE_FSYNC=1;           AC_SUBST([HAVE_FSYNC])
   HAVE_FTRUNCATE=1;       AC_SUBST([HAVE_FTRUNCATE])
   HAVE_GETDTABLESIZE=1;   AC_SUBST([HAVE_GETDTABLESIZE])
@@ -108,6 +126,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   HAVE_GETHOSTNAME=1;     AC_SUBST([HAVE_GETHOSTNAME])
   HAVE_GETLOGIN=1;        AC_SUBST([HAVE_GETLOGIN])
   HAVE_GETPAGESIZE=1;     AC_SUBST([HAVE_GETPAGESIZE])
+  HAVE_GROUP_MEMBER=1;    AC_SUBST([HAVE_GROUP_MEMBER])
   HAVE_LCHOWN=1;          AC_SUBST([HAVE_LCHOWN])
   HAVE_LINK=1;            AC_SUBST([HAVE_LINK])
   HAVE_LINKAT=1;          AC_SUBST([HAVE_LINKAT])
@@ -117,6 +136,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   HAVE_PWRITE=1;          AC_SUBST([HAVE_PWRITE])
   HAVE_READLINK=1;        AC_SUBST([HAVE_READLINK])
   HAVE_READLINKAT=1;      AC_SUBST([HAVE_READLINKAT])
+  HAVE_SETHOSTNAME=1;     AC_SUBST([HAVE_SETHOSTNAME])
   HAVE_SLEEP=1;           AC_SUBST([HAVE_SLEEP])
   HAVE_SYMLINK=1;         AC_SUBST([HAVE_SYMLINK])
   HAVE_SYMLINKAT=1;       AC_SUBST([HAVE_SYMLINKAT])
@@ -124,10 +144,12 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   HAVE_USLEEP=1;          AC_SUBST([HAVE_USLEEP])
   HAVE_DECL_ENVIRON=1;    AC_SUBST([HAVE_DECL_ENVIRON])
   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])
   HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
   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_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])
@@ -136,17 +158,20 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   REPLACE_DUP=0;          AC_SUBST([REPLACE_DUP])
   REPLACE_DUP2=0;         AC_SUBST([REPLACE_DUP2])
   REPLACE_FCHOWNAT=0;     AC_SUBST([REPLACE_FCHOWNAT])
+  REPLACE_FTRUNCATE=0;    AC_SUBST([REPLACE_FTRUNCATE])
   REPLACE_GETCWD=0;       AC_SUBST([REPLACE_GETCWD])
   REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME])
   REPLACE_GETLOGIN_R=0;   AC_SUBST([REPLACE_GETLOGIN_R])
   REPLACE_GETGROUPS=0;    AC_SUBST([REPLACE_GETGROUPS])
   REPLACE_GETPAGESIZE=0;  AC_SUBST([REPLACE_GETPAGESIZE])
+  REPLACE_ISATTY=0;       AC_SUBST([REPLACE_ISATTY])
   REPLACE_LCHOWN=0;       AC_SUBST([REPLACE_LCHOWN])
   REPLACE_LINK=0;         AC_SUBST([REPLACE_LINK])
   REPLACE_LINKAT=0;       AC_SUBST([REPLACE_LINKAT])
   REPLACE_LSEEK=0;        AC_SUBST([REPLACE_LSEEK])
   REPLACE_PREAD=0;        AC_SUBST([REPLACE_PREAD])
   REPLACE_PWRITE=0;       AC_SUBST([REPLACE_PWRITE])
+  REPLACE_READ=0;         AC_SUBST([REPLACE_READ])
   REPLACE_READLINK=0;     AC_SUBST([REPLACE_READLINK])
   REPLACE_RMDIR=0;        AC_SUBST([REPLACE_RMDIR])
   REPLACE_SLEEP=0;        AC_SUBST([REPLACE_SLEEP])
index 32ea985..0ce11da 100644 (file)
@@ -1,5 +1,5 @@
-# vasnprintf.m4 serial 32
-dnl Copyright (C) 2002-2004, 2006-2011 Free Software Foundation, Inc.
+# vasnprintf.m4 serial 35
+dnl Copyright (C) 2002-2004, 2006-2012 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,7 +29,7 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF],
   gl_PREREQ_ASNPRINTF
 ])
 
-# Prequisites of lib/printf-args.h, lib/printf-args.c.
+# Prerequisites of lib/printf-args.h, lib/printf-args.c.
 AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
 [
   AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
@@ -37,7 +37,7 @@ AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
   AC_REQUIRE([gt_TYPE_WINT_T])
 ])
 
-# Prequisites of lib/printf-parse.h, lib/printf-parse.c.
+# Prerequisites of lib/printf-parse.h, lib/printf-parse.c.
 AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
 [
   AC_REQUIRE([gl_FEATURES_H])
@@ -63,7 +63,10 @@ AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
   AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
   dnl Use the _snprintf function only if it is declared (because on NetBSD it
   dnl is defined as a weak alias of snprintf; we prefer to use the latter).
-  AC_CHECK_DECLS([_snprintf], , , [#include <stdio.h>])
+  AC_CHECK_DECLS([_snprintf], , , [[#include <stdio.h>]])
+  dnl Knowing DBL_EXPBIT0_WORD and DBL_EXPBIT0_BIT enables an optimization
+  dnl in the code for NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE.
+  AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION])
   dnl We can avoid a lot of code by assuming that snprintf's return value
   dnl conforms to ISO C99. So check that.
   AC_REQUIRE([gl_SNPRINTF_RETVAL_C99])
index 6db52b1..205ceea 100644 (file)
@@ -1,5 +1,5 @@
 # vasprintf.m4 serial 6
-dnl Copyright (C) 2002-2003, 2006-2007, 2009-2011 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2006-2007, 2009-2012 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 e0d0f27..a77802e 100644 (file)
@@ -1,5 +1,5 @@
-# warn-on-use.m4 serial 2
-dnl Copyright (C) 2010-2011 Free Software Foundation, Inc.
+# warn-on-use.m4 serial 5
+dnl Copyright (C) 2010-2012 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.
@@ -18,8 +18,8 @@ dnl with or without modifications, as long as this notice is preserved.
 # some systems declare functions in the wrong header, then INCLUDES
 # should do likewise.
 #
-# If you assume C89, then it is generally safe to assume declarations
-# for functions declared in that standard (such as gets) without
+# It is generally safe to assume declarations for functions declared
+# in the intersection of C89 and C11 (such as printf) without
 # needing gl_WARN_ON_USE_PREPARE.
 AC_DEFUN([gl_WARN_ON_USE_PREPARE],
 [
@@ -27,6 +27,8 @@ AC_DEFUN([gl_WARN_ON_USE_PREPARE],
     [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])),
       [Define to 1 if ]m4_defn([gl_decl])[ is declared even after
        undefining macros.])])dnl
+dnl FIXME: gl_Symbol must be used unquoted until we can assume
+dnl autoconf 2.64 or newer.
   for gl_func in m4_flatten([$2]); do
     AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl
     AC_CACHE_CHECK([whether $gl_func is declared without a macro],
@@ -35,8 +37,8 @@ AC_DEFUN([gl_WARN_ON_USE_PREPARE],
 [@%:@undef $gl_func
   (void) $gl_func;])],
         [AS_VAR_SET(gl_Symbol, [yes])], [AS_VAR_SET(gl_Symbol, [no])])])
-     AS_VAR_IF(gl_Symbol, [yes],
-       [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
+    AS_VAR_IF(gl_Symbol, [yes],
+      [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
        dnl shortcut - if the raw declaration exists, then set a cache
        dnl variable to allow skipping any later AC_CHECK_DECL efforts
        eval ac_cv_have_decl_$gl_func=yes])
index 6255ff3..c7a8b2d 100644 (file)
@@ -1,13 +1,13 @@
 dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
 
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2012 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 38
+# wchar_h.m4 serial 39
 
 AC_DEFUN([gl_WCHAR_H],
 [
@@ -119,13 +119,6 @@ Configuration aborted.])
   fi
 ])
 
-dnl Unconditionally enables the replacement of <wchar.h>.
-AC_DEFUN([gl_REPLACE_WCHAR_H],
-[
-  dnl This is a no-op, because <wchar.h> is always overridden.
-  :
-])
-
 AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
 [
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
index d2c03c4..534735d 100644 (file)
@@ -1,5 +1,5 @@
 # wchar_t.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2002-2003, 2008-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2008-2012 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 2905d9b..00d7302 100644 (file)
@@ -1,5 +1,5 @@
-# wcrtomb.m4 serial 8
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# wcrtomb.m4 serial 11
+dnl Copyright (C) 2008-2012 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,22 @@ AC_DEFUN([gl_FUNC_WCRTOMB],
   AC_CHECK_FUNCS_ONCE([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>
+]])
+    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
+      dnl replacement.
+      REPLACE_WCRTOMB=1
+    fi
   else
     if test $REPLACE_MBSTATE_T = 1; then
       REPLACE_WCRTOMB=1
@@ -88,11 +104,6 @@ int main ()
       esac
     fi
   fi
-  if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then
-    gl_REPLACE_WCHAR_H
-    AC_LIBOBJ([wcrtomb])
-    gl_PREREQ_WCRTOMB
-  fi
 ])
 
 # Prerequisites of lib/wcrtomb.c.
index 3b4633c..786c881 100644 (file)
@@ -1,5 +1,5 @@
-# wctob.m4 serial 7
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# wctob.m4 serial 10
+dnl Copyright (C) 2008-2012 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,11 +10,10 @@ AC_DEFUN([gl_FUNC_WCTOB],
 
   AC_CHECK_FUNCS_ONCE([wctob])
   if test $ac_cv_func_wctob = no; then
+    HAVE_WCTOB=0
     HAVE_DECL_WCTOB=0
-    gl_REPLACE_WCHAR_H
-    AC_LIBOBJ([wctob])
-    gl_PREREQ_WCTOB
   else
+    HAVE_WCTOB=1
 
     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
@@ -102,14 +101,10 @@ int main ()
       *yes) ;;
       *) REPLACE_WCTOB=1 ;;
     esac
-    if test $REPLACE_WCTOB = 1; then
-      gl_REPLACE_WCHAR_H
-      AC_LIBOBJ([wctob])
-      gl_PREREQ_WCTOB
-    else
+    if test $REPLACE_WCTOB = 0; then
 
       dnl IRIX 6.5 has the wctob() function but does not declare it.
-      AC_CHECK_DECLS([wctob], [], [], [
+      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
@@ -118,10 +113,9 @@ int main ()
 #include <stdio.h>
 #include <time.h>
 #include <wchar.h>
-])
+]])
       if test $ac_cv_have_decl_wctob != yes; then
         HAVE_DECL_WCTOB=0
-        gl_REPLACE_WCHAR_H
       fi
     fi
   fi
index bc21b5b..88fd6be 100644 (file)
@@ -1,5 +1,5 @@
-# wctomb.m4 serial 1
-dnl Copyright (C) 2011 Free Software Foundation, Inc.
+# wctomb.m4 serial 2
+dnl Copyright (C) 2011-2012 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,10 +11,6 @@ AC_DEFUN([gl_FUNC_WCTOMB],
   if false; then
     REPLACE_WCTOMB=1
   fi
-  if test $REPLACE_WCTOMB = 1; then
-    AC_LIBOBJ([wctomb])
-    gl_PREREQ_WCTOMB
-  fi
 ])
 
 # Prerequisites of lib/wctomb.c.
index ef9fb04..4b19f64 100644 (file)
@@ -1,8 +1,8 @@
-# wctype_h.m4 serial 14
+# wctype_h.m4 serial 17
 
 dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
 
-dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2012 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.
@@ -57,7 +57,8 @@ AC_DEFUN([gl_WCTYPE_H],
                           #if __GNU_LIBRARY__ == 1
                           Linux libc5 i18n is broken.
                           #endif]], [])],
-              [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no])
+              [gl_cv_func_iswcntrl_works="guessing yes"],
+              [gl_cv_func_iswcntrl_works="guessing no"])
             ])
         ])
     fi
@@ -67,15 +68,51 @@ AC_DEFUN([gl_WCTYPE_H],
   fi
   AC_SUBST([HAVE_WCTYPE_H])
 
-  if test "$gl_cv_func_iswcntrl_works" = no; then
-    REPLACE_ISWCNTRL=1
-  else
-    REPLACE_ISWCNTRL=0
-  fi
+  case "$gl_cv_func_iswcntrl_works" in
+    *yes) REPLACE_ISWCNTRL=0 ;;
+    *)    REPLACE_ISWCNTRL=1 ;;
+  esac
   AC_SUBST([REPLACE_ISWCNTRL])
 
   if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
-    dnl Redefine all of iswcntrl, ..., towupper in <wctype.h>.
+    dnl Redefine all of iswcntrl, ..., iswxdigit in <wctype.h>.
+    :
+  fi
+
+  if test $REPLACE_ISWCNTRL = 1; then
+    REPLACE_TOWLOWER=1
+  else
+    AC_CHECK_FUNCS([towlower])
+    if test $ac_cv_func_towlower = yes; then
+      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>
+          #if HAVE_WCTYPE_H
+          # include <wctype.h>
+          #endif
+        ]])
+      if test $ac_cv_have_decl_towlower = yes; then
+        dnl On Minix 3.1.8, the system's <wctype.h> declares towlower() and
+        dnl towupper() although it does not have the functions. Avoid a
+        dnl collision with gnulib's replacement.
+        REPLACE_TOWLOWER=1
+      else
+        REPLACE_TOWLOWER=0
+      fi
+    fi
+  fi
+  AC_SUBST([REPLACE_TOWLOWER])
+
+  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then
+    dnl Redefine towlower, towupper in <wctype.h>.
     :
   fi
 
index da1ce3d..3260cce 100644 (file)
@@ -1,5 +1,5 @@
 # wint_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2003, 2007-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007-2012 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 8c693bc..b3b7fee 100644 (file)
@@ -1,5 +1,5 @@
 # xsize.m4 serial 4
-dnl Copyright (C) 2003-2004, 2008-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2004, 2008-2012 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 15d5ac2..94e69c4 100644 (file)
@@ -1,5 +1,5 @@
 # yield.m4 serial 2
-dnl Copyright (C) 2005-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2012 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 3676a7d..34645eb 100644 (file)
@@ -1,11 +1,23 @@
 ## DO NOT EDIT! GENERATED AUTOMATICALLY!
 ## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2011 Free Software Foundation, Inc.
+# Copyright (C) 2002-2012 Free Software Foundation, Inc.
 #
-# This file is free software, distributed under the terms of the GNU
-# General Public License.  As a special exception to the GNU General
-# Public License, this file may be distributed as part of a program
-# that contains a configuration script generated by Autoconf, under
+# 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 this file.  If not, see <http://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
+# contains a configuration script generated by Autoconf, under
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
@@ -55,30 +67,6 @@ EXTRA_DIST += test-alloca-opt.c
 
 ## end   gnulib module alloca-opt-tests
 
-## begin gnulib module 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/arg-nonnull.h, except that it has the copyright header cut off.
-arg-nonnull.h: $(top_srcdir)/build/aux/arg-nonnull.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/GL_ARG_NONNULL/,$$p' \
-         < $(top_srcdir)/build/aux/arg-nonnull.h \
-         > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
-
-ARG_NONNULL_H=arg-nonnull.h
-
-EXTRA_DIST += $(top_srcdir)/build/aux/arg-nonnull.h
-
-## end   gnulib module arg-nonnull
-
 ## begin gnulib module binary-io
 
 libtests_a_SOURCES += binary-io.h
@@ -104,30 +92,6 @@ EXTRA_DIST += test-btowc1.sh test-btowc2.sh test-btowc.c signature.h macros.h
 
 ## end   gnulib module btowc-tests
 
-## begin gnulib module 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/c++defs.h, except that it has the copyright header cut off.
-c++defs.h: $(top_srcdir)/build/aux/c++defs.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/_GL_CXXDEFS/,$$p' \
-         < $(top_srcdir)/build/aux/c++defs.h \
-         > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += c++defs.h c++defs.h-t
-
-CXXDEFS_H=c++defs.h
-
-EXTRA_DIST += $(top_srcdir)/build/aux/c++defs.h
-
-## end   gnulib module c++defs
-
 ## begin gnulib module c-ctype
 
 libtests_a_SOURCES += c-ctype.h c-ctype.c
@@ -166,6 +130,23 @@ EXTRA_DIST += test-canonicalize-lgpl.c signature.h macros.h
 
 ## end   gnulib module canonicalize-lgpl-tests
 
+## begin gnulib module close
+
+
+EXTRA_DIST += close.c
+
+EXTRA_libtests_a_SOURCES += close.c
+
+## end   gnulib module close
+
+## begin gnulib module close-tests
+
+TESTS += test-close
+check_PROGRAMS += test-close
+EXTRA_DIST += test-close.c signature.h macros.h
+
+## end   gnulib module close-tests
+
 ## begin gnulib module ctype-tests
 
 TESTS += test-ctype
@@ -209,39 +190,6 @@ EXTRA_DIST += test-errno.c
 
 ## end   gnulib module errno-tests
 
-## begin gnulib module fcntl-h
-
-BUILT_SOURCES += fcntl.h
-
-# We need the following in order to create <fcntl.h> when the system
-# doesn't have one that works with the given compiler.
-fcntl.h: fcntl.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -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_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
-             -e 's|@''GNULIB_FCNTL''@|$(GNULIB_FCNTL)|g' \
-             -e 's|@''GNULIB_OPEN''@|$(GNULIB_OPEN)|g' \
-             -e 's|@''GNULIB_OPENAT''@|$(GNULIB_OPENAT)|g' \
-             -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
-             -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
-             -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \
-             -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
-             -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|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)/fcntl.in.h; \
-       } > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += fcntl.h fcntl.h-t
-
-EXTRA_DIST += fcntl.in.h
-
-## end   gnulib module fcntl-h
-
 ## begin gnulib module fcntl-h-tests
 
 TESTS += test-fcntl-h
@@ -250,6 +198,47 @@ EXTRA_DIST += test-fcntl-h.c
 
 ## end   gnulib module fcntl-h-tests
 
+## begin gnulib module fd-hook
+
+libtests_a_SOURCES += fd-hook.c
+
+EXTRA_DIST += fd-hook.h
+
+## end   gnulib module fd-hook
+
+## begin gnulib module fdopen
+
+
+EXTRA_DIST += fdopen.c
+
+EXTRA_libtests_a_SOURCES += fdopen.c
+
+## end   gnulib module fdopen
+
+## begin gnulib module fdopen-tests
+
+TESTS += test-fdopen
+check_PROGRAMS += test-fdopen
+EXTRA_DIST += test-fdopen.c signature.h macros.h
+
+## end   gnulib module fdopen-tests
+
+## begin gnulib module fgetc-tests
+
+TESTS += test-fgetc
+check_PROGRAMS += test-fgetc
+EXTRA_DIST += test-fgetc.c signature.h macros.h
+
+## end   gnulib module fgetc-tests
+
+## begin gnulib module float-tests
+
+TESTS += test-float
+check_PROGRAMS += test-float
+EXTRA_DIST += test-float.c macros.h
+
+## end   gnulib module float-tests
+
 ## begin gnulib module fnmatch-tests
 
 TESTS += test-fnmatch
@@ -258,6 +247,72 @@ EXTRA_DIST += test-fnmatch.c signature.h macros.h
 
 ## end   gnulib module fnmatch-tests
 
+## begin gnulib module fpucw
+
+
+EXTRA_DIST += fpucw.h
+
+## end   gnulib module fpucw
+
+## begin gnulib module fputc-tests
+
+TESTS += test-fputc
+check_PROGRAMS += test-fputc
+EXTRA_DIST += test-fputc.c signature.h macros.h
+
+## end   gnulib module fputc-tests
+
+## begin gnulib module fread-tests
+
+TESTS += test-fread
+check_PROGRAMS += test-fread
+EXTRA_DIST += test-fread.c signature.h macros.h
+
+## end   gnulib module fread-tests
+
+## begin gnulib module fstat
+
+
+EXTRA_DIST += fstat.c
+
+EXTRA_libtests_a_SOURCES += fstat.c
+
+## end   gnulib module fstat
+
+## begin gnulib module fstat-tests
+
+TESTS += test-fstat
+check_PROGRAMS += test-fstat
+EXTRA_DIST += test-fstat.c signature.h macros.h
+
+## end   gnulib module fstat-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 fwrite-tests
+
+## begin gnulib module getcwd-lgpl
+
+
+EXTRA_DIST += getcwd-lgpl.c
+
+EXTRA_libtests_a_SOURCES += getcwd-lgpl.c
+
+## end   gnulib module getcwd-lgpl
+
+## begin gnulib module getcwd-lgpl-tests
+
+TESTS += test-getcwd-lgpl
+check_PROGRAMS += test-getcwd-lgpl
+test_getcwd_lgpl_LDADD = $(LDADD) $(LIBINTL)
+EXTRA_DIST += test-getcwd-lgpl.c signature.h macros.h
+
+## end   gnulib module getcwd-lgpl-tests
+
 ## begin gnulib module getdelim-tests
 
 TESTS += test-getdelim
@@ -294,16 +349,26 @@ EXTRA_libtests_a_SOURCES += getpagesize.c
 
 ## end   gnulib module getpagesize
 
+## begin gnulib module gettimeofday-tests
+
+TESTS += test-gettimeofday
+check_PROGRAMS += test-gettimeofday
+
+EXTRA_DIST += signature.h test-gettimeofday.c
+
+## end   gnulib module gettimeofday-tests
+
 ## begin gnulib module havelib
 
 
-EXTRA_DIST += $(top_srcdir)/build/aux/config.rpath
+EXTRA_DIST += $(top_srcdir)/build/ac-aux/config.rpath
 
 ## end   gnulib module havelib
 
 ## begin gnulib module ignore-value
 
-libtests_a_SOURCES += ignore-value.h
+
+EXTRA_DIST += ignore-value.h
 
 ## end   gnulib module ignore-value
 
@@ -322,6 +387,66 @@ EXTRA_DIST += intprops.h
 
 ## end   gnulib module intprops
 
+## begin gnulib module intprops-tests
+
+TESTS += test-intprops
+check_PROGRAMS += test-intprops
+EXTRA_DIST += test-intprops.c macros.h
+
+## end   gnulib module intprops-tests
+
+## 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/@''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/@''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 inttypes-tests
+
+TESTS += test-inttypes
+check_PROGRAMS += test-inttypes
+EXTRA_DIST += test-inttypes.c
+
+## end   gnulib module inttypes-tests
+
 ## begin gnulib module isblank-tests
 
 TESTS += test-isblank
@@ -346,6 +471,14 @@ EXTRA_DIST += test-locale.c
 
 ## end   gnulib module locale-tests
 
+## begin gnulib module localeconv-tests
+
+TESTS += test-localeconv
+check_PROGRAMS += test-localeconv
+EXTRA_DIST += test-localeconv.c signature.h macros.h
+
+## end   gnulib module localeconv-tests
+
 ## begin gnulib module localename
 
 libtests_a_SOURCES += localename.c
@@ -358,7 +491,7 @@ EXTRA_DIST += localename.h
 
 TESTS += test-localename
 check_PROGRAMS += test-localename
-test_localename_LDADD = $(LDADD) @INTL_MACOSX_LIBS@
+test_localename_LDADD = $(LDADD) @INTL_MACOSX_LIBS@ $(LIBTHREAD)
 
 EXTRA_DIST += test-localename.c macros.h
 
@@ -453,6 +586,24 @@ EXTRA_DIST += test-memchr.c zerosize-ptr.h signature.h macros.h
 
 ## end   gnulib module memchr-tests
 
+## begin gnulib module msvc-inval
+
+
+EXTRA_DIST += msvc-inval.c msvc-inval.h
+
+EXTRA_libtests_a_SOURCES += msvc-inval.c
+
+## end   gnulib module msvc-inval
+
+## begin gnulib module msvc-nothrow
+
+
+EXTRA_DIST += msvc-nothrow.c msvc-nothrow.h
+
+EXTRA_libtests_a_SOURCES += msvc-nothrow.c
+
+## end   gnulib module msvc-nothrow
+
 ## begin gnulib module nl_langinfo-tests
 
 TESTS += test-nl_langinfo.sh
@@ -479,6 +630,14 @@ EXTRA_DIST += test-open.h test-open.c signature.h macros.h
 
 ## end   gnulib module open-tests
 
+## begin gnulib module pathmax-tests
+
+TESTS += test-pathmax
+check_PROGRAMS += test-pathmax
+EXTRA_DIST += test-pathmax.c
+
+## end   gnulib module pathmax-tests
+
 ## begin gnulib module putenv
 
 
@@ -488,6 +647,14 @@ EXTRA_libtests_a_SOURCES += putenv.c
 
 ## end   gnulib module putenv
 
+## begin gnulib module rawmemchr-tests
+
+TESTS += test-rawmemchr
+check_PROGRAMS += test-rawmemchr
+EXTRA_DIST += test-rawmemchr.c zerosize-ptr.h signature.h macros.h
+
+## end   gnulib module rawmemchr-tests
+
 ## begin gnulib module readlink-tests
 
 TESTS += test-readlink
@@ -550,10 +717,117 @@ EXTRA_DIST += test-setlocale1.sh test-setlocale1.c test-setlocale2.sh test-setlo
 
 ## end   gnulib module setlocale-tests
 
+## 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
+# need it. This is ensured by the applicability 'all' defined above.
+
+_NORETURN_H=$(top_srcdir)/build/ac-aux/snippet/_Noreturn.h
+
+EXTRA_DIST += $(top_srcdir)/build/ac-aux/snippet/_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/ac-aux/snippet/arg-nonnull.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/GL_ARG_NONNULL/,$$p' \
+         < $(top_srcdir)/build/ac-aux/snippet/arg-nonnull.h \
+         > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
+
+ARG_NONNULL_H=arg-nonnull.h
+
+EXTRA_DIST += $(top_srcdir)/build/ac-aux/snippet/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/ac-aux/snippet/c++defs.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/_GL_CXXDEFS/,$$p' \
+         < $(top_srcdir)/build/ac-aux/snippet/c++defs.h \
+         > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += c++defs.h c++defs.h-t
+
+CXXDEFS_H=c++defs.h
+
+EXTRA_DIST += $(top_srcdir)/build/ac-aux/snippet/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/ac-aux/snippet/unused-parameter.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/GL_UNUSED_PARAMETER/,$$p' \
+         < $(top_srcdir)/build/ac-aux/snippet/unused-parameter.h \
+         > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += unused-parameter.h unused-parameter.h-t
+
+UNUSED_PARAMETER_H=unused-parameter.h
+
+EXTRA_DIST += $(top_srcdir)/build/ac-aux/snippet/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/ac-aux/snippet/warn-on-use.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/^.ifndef/,$$p' \
+         < $(top_srcdir)/build/ac-aux/snippet/warn-on-use.h \
+         > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
+
+WARN_ON_USE_H=warn-on-use.h
+
+EXTRA_DIST += $(top_srcdir)/build/ac-aux/snippet/warn-on-use.h
+
+## end   gnulib module snippet/warn-on-use
+
 ## begin gnulib module stat-tests
 
 TESTS += test-stat
 check_PROGRAMS += test-stat
+test_stat_LDADD = $(LDADD) $(LIBINTL)
 EXTRA_DIST += test-stat.h test-stat.c signature.h macros.h
 
 ## end   gnulib module stat-tests
@@ -598,6 +872,14 @@ EXTRA_DIST += test-stdlib.c test-sys_wait.h
 
 ## end   gnulib module stdlib-tests
 
+## begin gnulib module strchrnul-tests
+
+TESTS += test-strchrnul
+check_PROGRAMS += test-strchrnul
+EXTRA_DIST += test-strchrnul.c signature.h macros.h
+
+## end   gnulib module strchrnul-tests
+
 ## begin gnulib module string-tests
 
 TESTS += test-string
@@ -647,6 +929,22 @@ EXTRA_DIST += test-sys_stat.c
 
 ## end   gnulib module sys_stat-tests
 
+## begin gnulib module sys_time-tests
+
+TESTS += test-sys_time
+check_PROGRAMS += test-sys_time
+EXTRA_DIST += test-sys_time.c
+
+## end   gnulib module sys_time-tests
+
+## begin gnulib module sys_types-tests
+
+TESTS += test-sys_types
+check_PROGRAMS += test-sys_types
+EXTRA_DIST += test-sys_types.c
+
+## end   gnulib module sys_types-tests
+
 ## begin gnulib module sys_wait-tests
 
 TESTS += test-sys_wait
@@ -655,17 +953,35 @@ EXTRA_DIST += test-sys_wait.c test-sys_wait.h
 
 ## end   gnulib module sys_wait-tests
 
+## begin gnulib module test-framework-sh-tests
+
+TESTS += test-init.sh
+EXTRA_DIST += init.sh
+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 threadlib
 
 libtests_a_SOURCES += glthread/threadlib.c
 
-EXTRA_DIST += $(top_srcdir)/build/aux/config.rpath
+EXTRA_DIST += $(top_srcdir)/build/ac-aux/config.rpath
 
 ## end   gnulib module threadlib
 
@@ -702,31 +1018,6 @@ EXTRA_DIST += test-unsetenv.c signature.h macros.h
 
 ## end   gnulib module unsetenv-tests
 
-## begin gnulib module 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/unused-parameter.h, except that it has the copyright header cut
-# off.
-unused-parameter.h: $(top_srcdir)/build/aux/unused-parameter.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/GL_UNUSED_PARAMETER/,$$p' \
-         < $(top_srcdir)/build/aux/unused-parameter.h \
-         > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += unused-parameter.h unused-parameter.h-t
-
-UNUSED_PARAMETER_H=unused-parameter.h
-
-EXTRA_DIST += $(top_srcdir)/build/aux/unused-parameter.h
-
-## end   gnulib module unused-parameter
-
 ## begin gnulib module vasnprintf-tests
 
 TESTS += test-vasnprintf
@@ -750,29 +1041,10 @@ EXTRA_DIST += test-vasprintf.c signature.h macros.h
 TESTS_ENVIRONMENT += MAKE='$(MAKE)'
 TESTS += test-verify test-verify.sh
 check_PROGRAMS += test-verify
-EXTRA_DIST += test-verify.c test-verify.sh init.sh
+EXTRA_DIST += test-verify.c test-verify.sh
 
 ## end   gnulib module verify-tests
 
-## begin gnulib module 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/warn-on-use.h, except that it has the copyright header cut off.
-warn-on-use.h: $(top_srcdir)/build/aux/warn-on-use.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/^.ifndef/,$$p' \
-         < $(top_srcdir)/build/aux/warn-on-use.h \
-         > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
-
-WARN_ON_USE_H=warn-on-use.h
-
-EXTRA_DIST += $(top_srcdir)/build/aux/warn-on-use.h
-
-## end   gnulib module warn-on-use
-
 ## begin gnulib module wchar-tests
 
 TESTS += test-wchar
index 2e36ff5..37b527a 100644 (file)
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in 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.
 
 @SET_MAKE@
 
-# Copyright (C) 2002-2011 Free Software Foundation, Inc.
+# Copyright (C) 2002-2012 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
+# 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 this file.  If not, see <http://www.gnu.org/licenses/>.
 #
-# This file is free software, distributed under the terms of the GNU
-# General Public License.  As a special exception to the GNU General
-# Public License, this file may be distributed as part of a program
-# that contains a configuration script generated by Autoconf, under
+# As a special exception to the GNU General Public License,
+# this file may be distributed as part of a program that
+# contains a configuration script generated by Autoconf, under
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
 
 
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -47,13 +103,18 @@ build_triplet = @build@
 host_triplet = @host@
 TESTS = test-alloca-opt$(EXEEXT) test-binary-io.sh test-btowc1.sh \
        test-btowc2.sh test-c-ctype$(EXEEXT) test-c-strcase.sh \
-       test-canonicalize-lgpl$(EXEEXT) test-ctype$(EXEEXT) \
-       test-dup2$(EXEEXT) test-environ$(EXEEXT) test-errno$(EXEEXT) \
-       test-fcntl-h$(EXEEXT) test-fnmatch$(EXEEXT) \
+       test-canonicalize-lgpl$(EXEEXT) test-close$(EXEEXT) \
+       test-ctype$(EXEEXT) test-dup2$(EXEEXT) test-environ$(EXEEXT) \
+       test-errno$(EXEEXT) test-fcntl-h$(EXEEXT) test-fdopen$(EXEEXT) \
+       test-fgetc$(EXEEXT) test-float$(EXEEXT) test-fnmatch$(EXEEXT) \
+       test-fputc$(EXEEXT) test-fread$(EXEEXT) test-fstat$(EXEEXT) \
+       test-fwrite$(EXEEXT) test-getcwd-lgpl$(EXEEXT) \
        test-getdelim$(EXEEXT) test-getline$(EXEEXT) \
-       test-getopt$(EXEEXT) test-ignore-value$(EXEEXT) \
-       test-isblank$(EXEEXT) test-langinfo$(EXEEXT) \
-       test-locale$(EXEEXT) test-localename$(EXEEXT) \
+       test-getopt$(EXEEXT) test-gettimeofday$(EXEEXT) \
+       test-ignore-value$(EXEEXT) test-intprops$(EXEEXT) \
+       test-inttypes$(EXEEXT) test-isblank$(EXEEXT) \
+       test-langinfo$(EXEEXT) test-locale$(EXEEXT) \
+       test-localeconv$(EXEEXT) test-localename$(EXEEXT) \
        test-lock$(EXEEXT) test-lstat$(EXEEXT) \
        test-malloc-gnu$(EXEEXT) test-malloca$(EXEEXT) \
        test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh \
@@ -62,14 +123,18 @@ TESTS = test-alloca-opt$(EXEEXT) test-binary-io.sh test-btowc1.sh \
        test-mbrtowc-w32-5.sh test-mbsinit.sh test-mbsrtowcs1.sh \
        test-mbsrtowcs2.sh test-mbsrtowcs3.sh test-mbsrtowcs4.sh \
        test-memchr$(EXEEXT) test-nl_langinfo.sh test-open$(EXEEXT) \
+       test-pathmax$(EXEEXT) test-rawmemchr$(EXEEXT) \
        test-readlink$(EXEEXT) test-safe-alloc$(EXEEXT) \
        test-setenv$(EXEEXT) test-setlocale1.sh test-setlocale2.sh \
        test-stat$(EXEEXT) test-stdbool$(EXEEXT) test-stddef$(EXEEXT) \
        test-stdint$(EXEEXT) test-stdio$(EXEEXT) test-stdlib$(EXEEXT) \
-       test-string$(EXEEXT) test-strnlen$(EXEEXT) \
-       test-strstr$(EXEEXT) test-symlink$(EXEEXT) \
-       test-sys_stat$(EXEEXT) test-sys_wait$(EXEEXT) \
-       test-time$(EXEEXT) test-unistd$(EXEEXT) test-unsetenv$(EXEEXT) \
+       test-strchrnul$(EXEEXT) test-string$(EXEEXT) \
+       test-strnlen$(EXEEXT) test-strstr$(EXEEXT) \
+       test-symlink$(EXEEXT) test-sys_stat$(EXEEXT) \
+       test-sys_time$(EXEEXT) test-sys_types$(EXEEXT) \
+       test-sys_wait$(EXEEXT) test-init.sh test-thread_self$(EXEEXT) \
+       test-thread_create$(EXEEXT) test-time$(EXEEXT) \
+       test-unistd$(EXEEXT) test-unsetenv$(EXEEXT) \
        test-vasnprintf$(EXEEXT) test-vasprintf$(EXEEXT) \
        test-verify$(EXEEXT) test-verify.sh test-wchar$(EXEEXT) \
        test-wcrtomb.sh test-wcrtomb-w32-1.sh test-wcrtomb-w32-2.sh \
@@ -80,39 +145,50 @@ noinst_PROGRAMS =
 check_PROGRAMS = test-alloca-opt$(EXEEXT) test-binary-io$(EXEEXT) \
        test-btowc$(EXEEXT) test-c-ctype$(EXEEXT) \
        test-c-strcasecmp$(EXEEXT) test-c-strncasecmp$(EXEEXT) \
-       test-canonicalize-lgpl$(EXEEXT) test-ctype$(EXEEXT) \
-       test-dup2$(EXEEXT) test-environ$(EXEEXT) test-errno$(EXEEXT) \
-       test-fcntl-h$(EXEEXT) test-fnmatch$(EXEEXT) \
+       test-canonicalize-lgpl$(EXEEXT) test-close$(EXEEXT) \
+       test-ctype$(EXEEXT) test-dup2$(EXEEXT) test-environ$(EXEEXT) \
+       test-errno$(EXEEXT) test-fcntl-h$(EXEEXT) test-fdopen$(EXEEXT) \
+       test-fgetc$(EXEEXT) test-float$(EXEEXT) test-fnmatch$(EXEEXT) \
+       test-fputc$(EXEEXT) test-fread$(EXEEXT) test-fstat$(EXEEXT) \
+       test-fwrite$(EXEEXT) test-getcwd-lgpl$(EXEEXT) \
        test-getdelim$(EXEEXT) test-getline$(EXEEXT) \
-       test-getopt$(EXEEXT) test-ignore-value$(EXEEXT) \
-       test-isblank$(EXEEXT) test-langinfo$(EXEEXT) \
-       test-locale$(EXEEXT) test-localename$(EXEEXT) \
+       test-getopt$(EXEEXT) test-gettimeofday$(EXEEXT) \
+       test-ignore-value$(EXEEXT) test-intprops$(EXEEXT) \
+       test-inttypes$(EXEEXT) test-isblank$(EXEEXT) \
+       test-langinfo$(EXEEXT) test-locale$(EXEEXT) \
+       test-localeconv$(EXEEXT) test-localename$(EXEEXT) \
        test-lock$(EXEEXT) test-lstat$(EXEEXT) \
        test-malloc-gnu$(EXEEXT) test-malloca$(EXEEXT) \
        test-mbrtowc$(EXEEXT) test-mbrtowc-w32$(EXEEXT) \
        test-mbsinit$(EXEEXT) test-mbsrtowcs$(EXEEXT) \
        test-memchr$(EXEEXT) test-nl_langinfo$(EXEEXT) \
-       test-open$(EXEEXT) test-readlink$(EXEEXT) \
+       test-open$(EXEEXT) test-pathmax$(EXEEXT) \
+       test-rawmemchr$(EXEEXT) test-readlink$(EXEEXT) \
        test-safe-alloc$(EXEEXT) test-setenv$(EXEEXT) \
        test-setlocale1$(EXEEXT) test-setlocale2$(EXEEXT) \
        test-stat$(EXEEXT) test-stdbool$(EXEEXT) test-stddef$(EXEEXT) \
        test-stdint$(EXEEXT) test-stdio$(EXEEXT) test-stdlib$(EXEEXT) \
-       test-string$(EXEEXT) test-strnlen$(EXEEXT) \
-       test-strstr$(EXEEXT) test-symlink$(EXEEXT) \
-       test-sys_stat$(EXEEXT) test-sys_wait$(EXEEXT) \
-       test-time$(EXEEXT) test-unistd$(EXEEXT) test-unsetenv$(EXEEXT) \
+       test-strchrnul$(EXEEXT) test-string$(EXEEXT) \
+       test-strnlen$(EXEEXT) test-strstr$(EXEEXT) \
+       test-symlink$(EXEEXT) test-sys_stat$(EXEEXT) \
+       test-sys_time$(EXEEXT) test-sys_types$(EXEEXT) \
+       test-sys_wait$(EXEEXT) test-thread_self$(EXEEXT) \
+       test-thread_create$(EXEEXT) test-time$(EXEEXT) \
+       test-unistd$(EXEEXT) test-unsetenv$(EXEEXT) \
        test-vasnprintf$(EXEEXT) test-vasprintf$(EXEEXT) \
        test-verify$(EXEEXT) test-wchar$(EXEEXT) test-wcrtomb$(EXEEXT) \
        test-wcrtomb-w32$(EXEEXT) test-wctype-h$(EXEEXT)
 subdir = gnulib/tests
-DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+       $(top_srcdir)/build/ac-aux/depcomp $(noinst_HEADERS) \
+       $(top_srcdir)/build/ac-aux/test-driver
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/alloca.m4 \
        $(top_srcdir)/gnulib/m4/argz.m4 \
        $(top_srcdir)/gnulib/m4/btowc.m4 \
        $(top_srcdir)/gnulib/m4/canonicalize.m4 \
+       $(top_srcdir)/gnulib/m4/close.m4 \
        $(top_srcdir)/gnulib/m4/codeset.m4 \
        $(top_srcdir)/gnulib/m4/configmake.m4 \
        $(top_srcdir)/gnulib/m4/ctype.m4 \
@@ -121,24 +197,33 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/eealloc.m4 \
        $(top_srcdir)/gnulib/m4/environ.m4 \
        $(top_srcdir)/gnulib/m4/errno_h.m4 \
+       $(top_srcdir)/gnulib/m4/exponentd.m4 \
        $(top_srcdir)/gnulib/m4/extensions.m4 \
        $(top_srcdir)/gnulib/m4/fcntl-o.m4 \
        $(top_srcdir)/gnulib/m4/fcntl_h.m4 \
+       $(top_srcdir)/gnulib/m4/fdopen.m4 \
        $(top_srcdir)/gnulib/m4/float_h.m4 \
        $(top_srcdir)/gnulib/m4/fnmatch.m4 \
+       $(top_srcdir)/gnulib/m4/fpieee.m4 \
+       $(top_srcdir)/gnulib/m4/fstat.m4 \
+       $(top_srcdir)/gnulib/m4/getcwd.m4 \
        $(top_srcdir)/gnulib/m4/getdelim.m4 \
        $(top_srcdir)/gnulib/m4/getline.m4 \
        $(top_srcdir)/gnulib/m4/getopt.m4 \
        $(top_srcdir)/gnulib/m4/getpagesize.m4 \
+       $(top_srcdir)/gnulib/m4/gettimeofday.m4 \
        $(top_srcdir)/gnulib/m4/glibc21.m4 \
        $(top_srcdir)/gnulib/m4/gnulib-common.m4 \
        $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \
        $(top_srcdir)/gnulib/m4/include_next.m4 \
        $(top_srcdir)/gnulib/m4/intlmacosx.m4 \
        $(top_srcdir)/gnulib/m4/intmax_t.m4 \
+       $(top_srcdir)/gnulib/m4/inttypes-pri.m4 \
+       $(top_srcdir)/gnulib/m4/inttypes.m4 \
        $(top_srcdir)/gnulib/m4/inttypes_h.m4 \
        $(top_srcdir)/gnulib/m4/isblank.m4 \
        $(top_srcdir)/gnulib/m4/langinfo_h.m4 \
+       $(top_srcdir)/gnulib/m4/largefile.m4 \
        $(top_srcdir)/gnulib/m4/lcmessage.m4 \
        $(top_srcdir)/gnulib/m4/lib-ld.m4 \
        $(top_srcdir)/gnulib/m4/lib-link.m4 \
@@ -150,6 +235,7 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/locale-tr.m4 \
        $(top_srcdir)/gnulib/m4/locale-zh.m4 \
        $(top_srcdir)/gnulib/m4/locale_h.m4 \
+       $(top_srcdir)/gnulib/m4/localeconv.m4 \
        $(top_srcdir)/gnulib/m4/localename.m4 \
        $(top_srcdir)/gnulib/m4/lock.m4 \
        $(top_srcdir)/gnulib/m4/longlong.m4 \
@@ -167,15 +253,21 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/mbtowc.m4 \
        $(top_srcdir)/gnulib/m4/memchr.m4 \
        $(top_srcdir)/gnulib/m4/mempcpy.m4 \
+       $(top_srcdir)/gnulib/m4/mkstemp.m4 \
        $(top_srcdir)/gnulib/m4/mmap-anon.m4 \
        $(top_srcdir)/gnulib/m4/mode_t.m4 \
+       $(top_srcdir)/gnulib/m4/msvc-inval.m4 \
+       $(top_srcdir)/gnulib/m4/msvc-nothrow.m4 \
        $(top_srcdir)/gnulib/m4/multiarch.m4 \
        $(top_srcdir)/gnulib/m4/nl_langinfo.m4 \
+       $(top_srcdir)/gnulib/m4/nocrash.m4 \
+       $(top_srcdir)/gnulib/m4/off_t.m4 \
        $(top_srcdir)/gnulib/m4/onceonly.m4 \
        $(top_srcdir)/gnulib/m4/open.m4 \
        $(top_srcdir)/gnulib/m4/pathmax.m4 \
        $(top_srcdir)/gnulib/m4/printf.m4 \
        $(top_srcdir)/gnulib/m4/putenv.m4 \
+       $(top_srcdir)/gnulib/m4/rawmemchr.m4 \
        $(top_srcdir)/gnulib/m4/readlink.m4 \
        $(top_srcdir)/gnulib/m4/realloc.m4 \
        $(top_srcdir)/gnulib/m4/regex.m4 \
@@ -195,13 +287,18 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/stdlib_h.m4 \
        $(top_srcdir)/gnulib/m4/stpcpy.m4 \
        $(top_srcdir)/gnulib/m4/stpncpy.m4 \
+       $(top_srcdir)/gnulib/m4/strchrnul.m4 \
        $(top_srcdir)/gnulib/m4/string_h.m4 \
        $(top_srcdir)/gnulib/m4/strndup.m4 \
        $(top_srcdir)/gnulib/m4/strnlen.m4 \
        $(top_srcdir)/gnulib/m4/strstr.m4 \
        $(top_srcdir)/gnulib/m4/symlink.m4 \
+       $(top_srcdir)/gnulib/m4/sys_socket_h.m4 \
        $(top_srcdir)/gnulib/m4/sys_stat_h.m4 \
+       $(top_srcdir)/gnulib/m4/sys_time_h.m4 \
+       $(top_srcdir)/gnulib/m4/sys_types_h.m4 \
        $(top_srcdir)/gnulib/m4/sys_wait_h.m4 \
+       $(top_srcdir)/gnulib/m4/tempname.m4 \
        $(top_srcdir)/gnulib/m4/thread.m4 \
        $(top_srcdir)/gnulib/m4/threadlib.m4 \
        $(top_srcdir)/gnulib/m4/time_h.m4 \
@@ -226,18 +323,15 @@ CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 LIBRARIES = $(noinst_LIBRARIES)
-ARFLAGS = cru
-AM_V_AR = $(am__v_AR_$(V))
-am__v_AR_ = $(am__v_AR_$(AM_DEFAULT_VERBOSITY))
-am__v_AR_0 = @echo "  AR    " $@;
-AM_V_at = $(am__v_at_$(V))
-am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
-am__v_at_0 = @
+AM_V_AR = $(am__v_AR_@AM_V@)
+am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
+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 = c-ctype.$(OBJEXT) c-strcasecmp.$(OBJEXT) \
-       c-strncasecmp.$(OBJEXT) localename.$(OBJEXT) \
+       c-strncasecmp.$(OBJEXT) fd-hook.$(OBJEXT) localename.$(OBJEXT) \
        glthread/lock.$(OBJEXT) glthread/thread.$(OBJEXT) \
        glthread/threadlib.$(OBJEXT)
 libtests_a_OBJECTS = $(am_libtests_a_OBJECTS)
@@ -247,9 +341,10 @@ test_alloca_opt_OBJECTS = test-alloca-opt.$(OBJEXT)
 test_alloca_opt_LDADD = $(LDADD)
 test_alloca_opt_DEPENDENCIES = libtests.a ../../gnulib/lib/libgnu.la \
        libtests.a $(am__DEPENDENCIES_1)
-AM_V_lt = $(am__v_lt_$(V))
-am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+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 = 
 test_binary_io_SOURCES = test-binary-io.c
 test_binary_io_OBJECTS = test-binary-io.$(OBJEXT)
 test_binary_io_LDADD = $(LDADD)
@@ -280,6 +375,11 @@ test_canonicalize_lgpl_OBJECTS = test-canonicalize-lgpl.$(OBJEXT)
 test_canonicalize_lgpl_LDADD = $(LDADD)
 test_canonicalize_lgpl_DEPENDENCIES = libtests.a \
        ../../gnulib/lib/libgnu.la 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 ../../gnulib/lib/libgnu.la \
+       libtests.a $(am__DEPENDENCIES_1)
 test_ctype_SOURCES = test-ctype.c
 test_ctype_OBJECTS = test-ctype.$(OBJEXT)
 test_ctype_LDADD = $(LDADD)
@@ -305,11 +405,52 @@ test_fcntl_h_OBJECTS = test-fcntl-h.$(OBJEXT)
 test_fcntl_h_LDADD = $(LDADD)
 test_fcntl_h_DEPENDENCIES = libtests.a ../../gnulib/lib/libgnu.la \
        libtests.a $(am__DEPENDENCIES_1)
+test_fdopen_SOURCES = test-fdopen.c
+test_fdopen_OBJECTS = test-fdopen.$(OBJEXT)
+test_fdopen_LDADD = $(LDADD)
+test_fdopen_DEPENDENCIES = libtests.a ../../gnulib/lib/libgnu.la \
+       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 ../../gnulib/lib/libgnu.la \
+       libtests.a $(am__DEPENDENCIES_1)
+test_float_SOURCES = test-float.c
+test_float_OBJECTS = test-float.$(OBJEXT)
+test_float_LDADD = $(LDADD)
+test_float_DEPENDENCIES = libtests.a ../../gnulib/lib/libgnu.la \
+       libtests.a $(am__DEPENDENCIES_1)
 test_fnmatch_SOURCES = test-fnmatch.c
 test_fnmatch_OBJECTS = test-fnmatch.$(OBJEXT)
 test_fnmatch_LDADD = $(LDADD)
 test_fnmatch_DEPENDENCIES = libtests.a ../../gnulib/lib/libgnu.la \
        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 ../../gnulib/lib/libgnu.la \
+       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 ../../gnulib/lib/libgnu.la \
+       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 ../../gnulib/lib/libgnu.la \
+       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 ../../gnulib/lib/libgnu.la \
+       libtests.a $(am__DEPENDENCIES_1)
+test_getcwd_lgpl_SOURCES = test-getcwd-lgpl.c
+test_getcwd_lgpl_OBJECTS = test-getcwd-lgpl.$(OBJEXT)
+am__DEPENDENCIES_2 = libtests.a ../../gnulib/lib/libgnu.la libtests.a \
+       $(am__DEPENDENCIES_1)
+test_getcwd_lgpl_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1)
 test_getdelim_SOURCES = test-getdelim.c
 test_getdelim_OBJECTS = test-getdelim.$(OBJEXT)
 test_getdelim_LDADD = $(LDADD)
@@ -322,14 +463,27 @@ test_getline_DEPENDENCIES = libtests.a ../../gnulib/lib/libgnu.la \
        libtests.a $(am__DEPENDENCIES_1)
 test_getopt_SOURCES = test-getopt.c
 test_getopt_OBJECTS = test-getopt.$(OBJEXT)
-am__DEPENDENCIES_2 = libtests.a ../../gnulib/lib/libgnu.la libtests.a \
-       $(am__DEPENDENCIES_1)
 test_getopt_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
+test_gettimeofday_SOURCES = test-gettimeofday.c
+test_gettimeofday_OBJECTS = test-gettimeofday.$(OBJEXT)
+test_gettimeofday_LDADD = $(LDADD)
+test_gettimeofday_DEPENDENCIES = libtests.a ../../gnulib/lib/libgnu.la \
+       libtests.a $(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 ../../gnulib/lib/libgnu.la \
        libtests.a $(am__DEPENDENCIES_1)
+test_intprops_SOURCES = test-intprops.c
+test_intprops_OBJECTS = test-intprops.$(OBJEXT)
+test_intprops_LDADD = $(LDADD)
+test_intprops_DEPENDENCIES = libtests.a ../../gnulib/lib/libgnu.la \
+       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 ../../gnulib/lib/libgnu.la \
+       libtests.a $(am__DEPENDENCIES_1)
 test_isblank_SOURCES = test-isblank.c
 test_isblank_OBJECTS = test-isblank.$(OBJEXT)
 test_isblank_LDADD = $(LDADD)
@@ -345,9 +499,15 @@ test_locale_OBJECTS = test-locale.$(OBJEXT)
 test_locale_LDADD = $(LDADD)
 test_locale_DEPENDENCIES = libtests.a ../../gnulib/lib/libgnu.la \
        libtests.a $(am__DEPENDENCIES_1)
+test_localeconv_SOURCES = test-localeconv.c
+test_localeconv_OBJECTS = test-localeconv.$(OBJEXT)
+test_localeconv_LDADD = $(LDADD)
+test_localeconv_DEPENDENCIES = libtests.a ../../gnulib/lib/libgnu.la \
+       libtests.a $(am__DEPENDENCIES_1)
 test_localename_SOURCES = test-localename.c
 test_localename_OBJECTS = test-localename.$(OBJEXT)
-test_localename_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_localename_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1)
 test_lock_SOURCES = test-lock.c
 test_lock_OBJECTS = test-lock.$(OBJEXT)
 test_lock_DEPENDENCIES = $(am__DEPENDENCIES_2)
@@ -401,6 +561,16 @@ test_open_OBJECTS = test-open.$(OBJEXT)
 test_open_LDADD = $(LDADD)
 test_open_DEPENDENCIES = libtests.a ../../gnulib/lib/libgnu.la \
        libtests.a $(am__DEPENDENCIES_1)
+test_pathmax_SOURCES = test-pathmax.c
+test_pathmax_OBJECTS = test-pathmax.$(OBJEXT)
+test_pathmax_LDADD = $(LDADD)
+test_pathmax_DEPENDENCIES = libtests.a ../../gnulib/lib/libgnu.la \
+       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 ../../gnulib/lib/libgnu.la \
+       libtests.a $(am__DEPENDENCIES_1)
 test_readlink_SOURCES = test-readlink.c
 test_readlink_OBJECTS = test-readlink.$(OBJEXT)
 test_readlink_LDADD = $(LDADD)
@@ -428,9 +598,7 @@ test_setlocale2_DEPENDENCIES = libtests.a ../../gnulib/lib/libgnu.la \
        libtests.a $(am__DEPENDENCIES_1)
 test_stat_SOURCES = test-stat.c
 test_stat_OBJECTS = test-stat.$(OBJEXT)
-test_stat_LDADD = $(LDADD)
-test_stat_DEPENDENCIES = libtests.a ../../gnulib/lib/libgnu.la \
-       libtests.a $(am__DEPENDENCIES_1)
+test_stat_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
 test_stdbool_SOURCES = test-stdbool.c
 test_stdbool_OBJECTS = test-stdbool.$(OBJEXT)
 test_stdbool_LDADD = $(LDADD)
@@ -456,6 +624,11 @@ test_stdlib_OBJECTS = test-stdlib.$(OBJEXT)
 test_stdlib_LDADD = $(LDADD)
 test_stdlib_DEPENDENCIES = libtests.a ../../gnulib/lib/libgnu.la \
        libtests.a $(am__DEPENDENCIES_1)
+test_strchrnul_SOURCES = test-strchrnul.c
+test_strchrnul_OBJECTS = test-strchrnul.$(OBJEXT)
+test_strchrnul_LDADD = $(LDADD)
+test_strchrnul_DEPENDENCIES = libtests.a ../../gnulib/lib/libgnu.la \
+       libtests.a $(am__DEPENDENCIES_1)
 test_string_SOURCES = test-string.c
 test_string_OBJECTS = test-string.$(OBJEXT)
 test_string_LDADD = $(LDADD)
@@ -481,11 +654,27 @@ test_sys_stat_OBJECTS = test-sys_stat.$(OBJEXT)
 test_sys_stat_LDADD = $(LDADD)
 test_sys_stat_DEPENDENCIES = libtests.a ../../gnulib/lib/libgnu.la \
        libtests.a $(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 ../../gnulib/lib/libgnu.la \
+       libtests.a $(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 ../../gnulib/lib/libgnu.la \
+       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 ../../gnulib/lib/libgnu.la \
        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)
@@ -536,8 +725,20 @@ test_wctype_h_OBJECTS = test-wctype-h.$(OBJEXT)
 test_wctype_h_LDADD = $(LDADD)
 test_wctype_h_DEPENDENCIES = libtests.a ../../gnulib/lib/libgnu.la \
        libtests.a $(am__DEPENDENCIES_1)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/build/aux/depcomp
+depcomp = $(SHELL) $(top_srcdir)/build/ac-aux/depcomp
 am__depfiles_maybe = depfiles
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -546,84 +747,126 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
        $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
        $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_$(V))
-am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
-am__v_CC_0 = @echo "  CC    " $@;
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_$(V))
-am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
-am__v_CCLD_0 = @echo "  CCLD  " $@;
-AM_V_GEN = $(am__v_GEN_$(V))
-am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
-am__v_GEN_0 = @echo "  GEN   " $@;
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
 SOURCES = $(libtests_a_SOURCES) $(EXTRA_libtests_a_SOURCES) \
        test-alloca-opt.c test-binary-io.c test-btowc.c test-c-ctype.c \
        test-c-strcasecmp.c test-c-strncasecmp.c \
-       test-canonicalize-lgpl.c test-ctype.c test-dup2.c \
-       test-environ.c test-errno.c test-fcntl-h.c test-fnmatch.c \
+       test-canonicalize-lgpl.c test-close.c test-ctype.c test-dup2.c \
+       test-environ.c test-errno.c test-fcntl-h.c test-fdopen.c \
+       test-fgetc.c test-float.c test-fnmatch.c test-fputc.c \
+       test-fread.c test-fstat.c test-fwrite.c test-getcwd-lgpl.c \
        test-getdelim.c test-getline.c test-getopt.c \
-       test-ignore-value.c test-isblank.c test-langinfo.c \
-       test-locale.c test-localename.c test-lock.c test-lstat.c \
+       test-gettimeofday.c test-ignore-value.c test-intprops.c \
+       test-inttypes.c test-isblank.c test-langinfo.c test-locale.c \
+       test-localeconv.c test-localename.c test-lock.c test-lstat.c \
        test-malloc-gnu.c test-malloca.c test-mbrtowc.c \
        test-mbrtowc-w32.c test-mbsinit.c test-mbsrtowcs.c \
-       test-memchr.c test-nl_langinfo.c test-open.c test-readlink.c \
-       test-safe-alloc.c test-setenv.c test-setlocale1.c \
-       test-setlocale2.c test-stat.c test-stdbool.c test-stddef.c \
-       test-stdint.c test-stdio.c test-stdlib.c test-string.c \
-       test-strnlen.c test-strstr.c test-symlink.c test-sys_stat.c \
-       test-sys_wait.c test-time.c test-unistd.c test-unsetenv.c \
+       test-memchr.c test-nl_langinfo.c test-open.c test-pathmax.c \
+       test-rawmemchr.c test-readlink.c test-safe-alloc.c \
+       test-setenv.c test-setlocale1.c test-setlocale2.c test-stat.c \
+       test-stdbool.c test-stddef.c test-stdint.c test-stdio.c \
+       test-stdlib.c test-strchrnul.c test-string.c test-strnlen.c \
+       test-strstr.c test-symlink.c test-sys_stat.c test-sys_time.c \
+       test-sys_types.c test-sys_wait.c test-thread_create.c \
+       test-thread_self.c test-time.c test-unistd.c test-unsetenv.c \
        test-vasnprintf.c test-vasprintf.c test-verify.c test-wchar.c \
        test-wcrtomb.c test-wcrtomb-w32.c test-wctype-h.c
 DIST_SOURCES = $(libtests_a_SOURCES) $(EXTRA_libtests_a_SOURCES) \
        test-alloca-opt.c test-binary-io.c test-btowc.c test-c-ctype.c \
        test-c-strcasecmp.c test-c-strncasecmp.c \
-       test-canonicalize-lgpl.c test-ctype.c test-dup2.c \
-       test-environ.c test-errno.c test-fcntl-h.c test-fnmatch.c \
+       test-canonicalize-lgpl.c test-close.c test-ctype.c test-dup2.c \
+       test-environ.c test-errno.c test-fcntl-h.c test-fdopen.c \
+       test-fgetc.c test-float.c test-fnmatch.c test-fputc.c \
+       test-fread.c test-fstat.c test-fwrite.c test-getcwd-lgpl.c \
        test-getdelim.c test-getline.c test-getopt.c \
-       test-ignore-value.c test-isblank.c test-langinfo.c \
-       test-locale.c test-localename.c test-lock.c test-lstat.c \
+       test-gettimeofday.c test-ignore-value.c test-intprops.c \
+       test-inttypes.c test-isblank.c test-langinfo.c test-locale.c \
+       test-localeconv.c test-localename.c test-lock.c test-lstat.c \
        test-malloc-gnu.c test-malloca.c test-mbrtowc.c \
        test-mbrtowc-w32.c test-mbsinit.c test-mbsrtowcs.c \
-       test-memchr.c test-nl_langinfo.c test-open.c test-readlink.c \
-       test-safe-alloc.c test-setenv.c test-setlocale1.c \
-       test-setlocale2.c test-stat.c test-stdbool.c test-stddef.c \
-       test-stdint.c test-stdio.c test-stdlib.c test-string.c \
-       test-strnlen.c test-strstr.c test-symlink.c test-sys_stat.c \
-       test-sys_wait.c test-time.c test-unistd.c test-unsetenv.c \
+       test-memchr.c test-nl_langinfo.c test-open.c test-pathmax.c \
+       test-rawmemchr.c test-readlink.c test-safe-alloc.c \
+       test-setenv.c test-setlocale1.c test-setlocale2.c test-stat.c \
+       test-stdbool.c test-stddef.c test-stdint.c test-stdio.c \
+       test-stdlib.c test-strchrnul.c test-string.c test-strnlen.c \
+       test-strstr.c test-symlink.c test-sys_stat.c test-sys_time.c \
+       test-sys_types.c test-sys_wait.c test-thread_create.c \
+       test-thread_self.c test-time.c test-unistd.c test-unsetenv.c \
        test-vasnprintf.c test-vasprintf.c test-verify.c test-wchar.c \
        test-wcrtomb.c test-wcrtomb-w32.c test-wctype-h.c
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-       html-recursive info-recursive install-data-recursive \
-       install-dvi-recursive install-exec-recursive \
-       install-html-recursive install-info-recursive \
-       install-pdf-recursive install-ps-recursive install-recursive \
-       installcheck-recursive installdirs-recursive pdf-recursive \
-       ps-recursive uninstall-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+       ctags-recursive dvi-recursive html-recursive info-recursive \
+       install-data-recursive install-dvi-recursive \
+       install-exec-recursive install-html-recursive \
+       install-info-recursive install-pdf-recursive \
+       install-ps-recursive install-recursive installcheck-recursive \
+       installdirs-recursive pdf-recursive ps-recursive \
+       tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 HEADERS = $(noinst_HEADERS)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
   distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-       $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-       check check-html recheck recheck-html distdir
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+       check recheck distdir
+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
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
-# If stdout is a non-dumb tty, use colors.  If test -t is not supported,
-# then this fails; a conservative approach.  Of course do not redirect
-# stdout here, just stderr.
-am__tty_colors = \
-red=; grn=; lgn=; blu=; std=; \
-test "X$(AM_COLOR_TESTS)" != Xno \
-&& test "X$$TERM" != Xdumb \
-&& { test "X$(AM_COLOR_TESTS)" = Xalways || test -t 1 2>/dev/null; } \
-&& { \
-  red='\e[0;31m'; \
-  grn='\e[0;32m'; \
-  lgn='\e[1;32m'; \
-  blu='\e[1;34m'; \
-  std='\e[m'; \
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+am__tty_colors = { \
+  $(am__tty_colors_dummy); \
+  if test "X$(AM_COLOR_TESTS)" = Xno; then \
+    am__color_tests=no; \
+  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+    am__color_tests=yes; \
+  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+    am__color_tests=yes; \
+  fi; \
+  if test $$am__color_tests = yes; then \
+    red='\e[0;31m'; \
+    grn='\e[0;32m'; \
+    lgn='\e[1;32m'; \
+    blu='\e[1;34m'; \
+    mgn='\e[0;35m'; \
+    brg='\e[1m'; \
+    std='\e[m'; \
+  fi; \
 }
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
@@ -646,54 +889,166 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-# Restructured Text title and section.
-am__rst_title = sed 's/.*/   &   /;h;s/./=/g;p;x;p;g;p;s/.*//'
-am__rst_section = sed 'p;s/./=/g;p;g'
-# Put stdin (possibly several lines separated by ".  ") in a box.
-am__text_box = $(AWK) '{                               \
-  n = split($$0, lines, "\\.  "); max = 0;             \
-  for (i = 1; i <= n; ++i)                             \
-    if (max < length(lines[i]))                                \
-      max = length(lines[i]);                          \
-  for (i = 0; i < max; ++i) line = line "=";           \
-  print line;                                          \
-  for (i = 1; i <= n; ++i) if (lines[i]) print lines[i];\
-  print line;                                          \
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__recheck_rx = ^[    ]*:recheck:[    ]*
+am__global_test_result_rx = ^[         ]*:global-test-result:[         ]*
+am__copy_in_global_log_rx = ^[         ]*:copy-in-global-log:[         ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+  recheck = 1; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+        { \
+          if ((getline line2 < ($$0 ".log")) < 0) \
+           recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+        { \
+          recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+        { \
+          break; \
+        } \
+    }; \
+  if (recheck) \
+    print $$0; \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+  print "fatal: making $@: " msg | "cat >&2"; \
+  exit 1; \
+} \
+function rst_section(header) \
+{ \
+  print header; \
+  len = length(header); \
+  for (i = 1; i <= len; i = i + 1) \
+    printf "="; \
+  printf "\n\n"; \
+} \
+{ \
+  copy_in_global_log = 1; \
+  global_test_result = "RUN"; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+         fatal("failed to read from " $$0 ".trs"); \
+      if (line ~ /$(am__global_test_result_rx)/) \
+        { \
+          sub("$(am__global_test_result_rx)", "", line); \
+          sub("[       ]*$$", "", line); \
+          global_test_result = line; \
+        } \
+      else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+        copy_in_global_log = 0; \
+    }; \
+  if (copy_in_global_log) \
+    { \
+      rst_section(global_test_result ": " $$0); \
+      while ((rc = (getline line < ($$0 ".log"))) != 0) \
+      { \
+        if (rc < 0) \
+          fatal("failed to read from " $$0 ".log"); \
+        print line; \
+      }; \
+      printf "\n"; \
+    }; \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
 }'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/   &   /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
 # Solaris 10 'make', and several other traditional 'make' implementations,
-# pass "-e" to $(SHELL).  This contradicts POSIX.  Work around the problem
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this.  Work around it
 # by disabling -e (using the XSI extension "set +e") if it's set.
 am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+  --color-tests "$$am__color_tests" \
+  --enable-hard-errors "$$am__enable_hard_errors" \
+  --expect-failure "$$am__expect_failure"
 # To be inserted before the command running the test.  Creates the
 # directory for the log if needed.  Stores in $dir the directory
-# containing $f, in $tst the test, in $log the log, and passes
-# TESTS_ENVIRONMENT.  Save and restore TERM around use of
-# TESTS_ENVIRONMENT, in case that unsets it.
+# containing $f, in $tst the test, in $log the log.  Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT.  Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
 am__check_pre = \
 $(am__sh_e_setup);                                     \
 $(am__vpath_adj_setup) $(am__vpath_adj)                        \
+$(am__tty_colors);                                     \
 srcdir=$(srcdir); export srcdir;                       \
-rm -f $@-t;                                            \
-trap 'st=$$?; rm -f '\''$(abs_builddir)/$@-t'\''; (exit $$st); exit $$st' \
-  1 2 13 15;                                           \
-am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;           \
-test "x$$am__odir" = x. || $(MKDIR_P) "$$am__odir" || exit $$?;        \
+case "$@" in                                           \
+  */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;;   \
+    *) am__odir=.;;                                    \
+esac;                                                  \
+test "x$$am__odir" = x"." || test -d "$$am__odir"      \
+  || $(MKDIR_P) "$$am__odir" || exit $$?;              \
 if test -f "./$$f"; then dir=./;                       \
 elif test -f "$$f"; then dir=;                         \
 else dir="$(srcdir)/"; fi;                             \
-tst=$$dir$$f; log='$@'; __SAVED_TERM=$$TERM;           \
-$(TESTS_ENVIRONMENT)
+tst=$$dir$$f; log='$@';                                \
+if test -n '$(DISABLE_HARD_ERRORS)'; then              \
+  am__enable_hard_errors=no;                           \
+else                                                   \
+  am__enable_hard_errors=yes;                          \
+fi;                                                    \
+case " $(XFAIL_TESTS) " in                             \
+  *[\ \        ]$$f[\ \        ]* | *[\ \      ]$$dir$$f[\ \   ]*) \
+    am__expect_failure=yes;;                           \
+  *)                                                   \
+    am__expect_failure=no;;                            \
+esac;                                                  \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed).  The result is saved in the shell variable
+# '$bases'.  This honors runtime overriding of TESTS and TEST_LOGS.  Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+  bases='$(TEST_LOGS)'; \
+  bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+  bases=`echo $$bases`
 RECHECK_LOGS = $(TEST_LOGS)
 TEST_SUITE_LOG = test-suite.log
-TEST_SUITE_HTML = $(TEST_SUITE_LOG:.log=.html)
 TEST_EXTENSIONS = @EXEEXT@ .test
+LOG_DRIVER = $(SHELL) $(top_srcdir)/build/ac-aux/test-driver
 LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
+am__set_b = \
+  case '$@' in \
+    */*) \
+      case '$*' in \
+        */*) b='$*';; \
+          *) b=`echo '$@' | sed 's/\.log$$//'`; \
+       esac;; \
+    *) \
+      b='$*';; \
+  esac
 am__test_logs1 = $(TESTS:=.log)
 am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
 TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build/ac-aux/test-driver
 TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
        $(TEST_LOG_FLAGS)
-TEST_LOGS_TMP = $(TEST_LOGS:.log=.log-t)
 DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
@@ -729,6 +1084,7 @@ AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 AR = @AR@
+ARFLAGS = @ARFLAGS@
 ARGZ_H = @ARGZ_H@
 AUGEAS_CFLAGS = @AUGEAS_CFLAGS@
 AUTOCONF = @AUTOCONF@
@@ -772,9 +1128,11 @@ GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
 GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
+GNULIB_CHDIR = @GNULIB_CHDIR@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
+GNULIB_DUP = @GNULIB_DUP@
 GNULIB_DUP2 = @GNULIB_DUP2@
 GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
@@ -786,16 +1144,25 @@ 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_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FFSL = @GNULIB_FFSL@
+GNULIB_FFSLL = @GNULIB_FFSLL@
+GNULIB_FGETC = @GNULIB_FGETC@
+GNULIB_FGETS = @GNULIB_FGETS@
 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_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@
@@ -803,6 +1170,8 @@ 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@
@@ -815,8 +1184,14 @@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
 GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
+GNULIB_IMAXABS = @GNULIB_IMAXABS@
+GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
+GNULIB_ISATTY = @GNULIB_ISATTY@
 GNULIB_ISBLANK = @GNULIB_ISBLANK@
 GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
 GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
@@ -824,6 +1199,7 @@ GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
 GNULIB_LINKAT = @GNULIB_LINKAT@
+GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
@@ -864,25 +1240,31 @@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
 GNULIB_MKTIME = @GNULIB_MKTIME@
 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_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_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
 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_RANDOM = @GNULIB_RANDOM@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
 GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
+GNULIB_READ = @GNULIB_READ@
 GNULIB_READLINK = @GNULIB_READLINK@
 GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
@@ -892,12 +1274,15 @@ GNULIB_RENAME = @GNULIB_RENAME@
 GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
 GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
+GNULIB_SCANF = @GNULIB_SCANF@
 GNULIB_SETENV = @GNULIB_SETENV@
+GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
 GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
 GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
 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@
@@ -915,9 +1300,11 @@ 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@
@@ -927,7 +1314,7 @@ GNULIB_TIME_R = @GNULIB_TIME_R@
 GNULIB_TMPFILE = @GNULIB_TMPFILE@
 GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
 GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
-GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
+GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
 GNULIB_UNLINK = @GNULIB_UNLINK@
 GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
@@ -939,8 +1326,10 @@ 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@
@@ -989,6 +1378,7 @@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
 HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
 HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
 HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
 HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
@@ -999,18 +1389,23 @@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 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_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
 HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
 HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
@@ -1026,7 +1421,10 @@ HAVE_FCHDIR = @HAVE_FCHDIR@
 HAVE_FCHMODAT = @HAVE_FCHMODAT@
 HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
 HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
 HAVE_FSEEKO = @HAVE_FSEEKO@
 HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
@@ -1040,7 +1438,9 @@ HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
 HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
 HAVE_ISBLANK = @HAVE_ISBLANK@
 HAVE_ISWBLANK = @HAVE_ISWBLANK@
@@ -1074,15 +1474,21 @@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
 HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
 HAVE_MKSTEMP = @HAVE_MKSTEMP@
 HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
 HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OPENAT = @HAVE_OPENAT@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
 HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
 HAVE_PREAD = @HAVE_PREAD@
 HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
 HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_RANDOM = @HAVE_RANDOM@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
 HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -1092,6 +1498,7 @@ HAVE_REALPATH = @HAVE_REALPATH@
 HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
 HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
@@ -1108,6 +1515,7 @@ HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
 HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
 HAVE_SYMLINK = @HAVE_SYMLINK@
 HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
@@ -1115,6 +1523,7 @@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
 HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
 HAVE_TIMEGM = @HAVE_TIMEGM@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
@@ -1156,6 +1565,7 @@ HAVE_WCSXFRM = @HAVE_WCSXFRM@
 HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
 HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
 HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WMEMCHR = @HAVE_WMEMCHR@
 HAVE_WMEMCMP = @HAVE_WMEMCMP@
@@ -1172,6 +1582,8 @@ INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 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@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
@@ -1217,6 +1629,7 @@ 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_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
 NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
 NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H = @NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H@
@@ -1226,6 +1639,8 @@ 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_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_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@
@@ -1236,6 +1651,7 @@ 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_INTTYPES_H = @NEXT_INTTYPES_H@
 NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_LOCALE_H = @NEXT_LOCALE_H@
 NEXT_SELINUX_SELINUX_H = @NEXT_SELINUX_SELINUX_H@
@@ -1245,6 +1661,8 @@ NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
 NEXT_STRING_H = @NEXT_STRING_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_WAIT_H = @NEXT_SYS_WAIT_H@
 NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
@@ -1271,6 +1689,8 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 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@
@@ -1287,6 +1707,7 @@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
 REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
@@ -1298,6 +1719,7 @@ REPLACE_FSTAT = @REPLACE_FSTAT@
 REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
 REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
 REPLACE_GETDELIM = @REPLACE_GETDELIM@
@@ -1306,11 +1728,15 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISATTY = @REPLACE_ISATTY@
 REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ITOLD = @REPLACE_ITOLD@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
 REPLACE_LINK = @REPLACE_LINK@
 REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALECONV = @REPLACE_LOCALECONV@
 REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
@@ -1339,8 +1765,11 @@ REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
 REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
 REPLACE_REALLOC = @REPLACE_REALLOC@
 REPLACE_REALPATH = @REPLACE_REALPATH@
@@ -1354,9 +1783,11 @@ REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
 REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
 REPLACE_STPNCPY = @REPLACE_STPNCPY@
 REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
 REPLACE_STRDUP = @REPLACE_STRDUP@
 REPLACE_STRERROR = @REPLACE_STRERROR@
 REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
@@ -1366,10 +1797,14 @@ REPLACE_STRNLEN = @REPLACE_STRNLEN@
 REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
 REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
 REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
+REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
 REPLACE_SYMLINK = @REPLACE_SYMLINK@
 REPLACE_TIMEGM = @REPLACE_TIMEGM@
 REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
 REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
 REPLACE_UNLINK = @REPLACE_UNLINK@
 REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
@@ -1402,6 +1837,8 @@ STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+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_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
@@ -1409,6 +1846,8 @@ VERSION = @VERSION@
 VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@
 WARN_CFLAGS = @WARN_CFLAGS@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 YACC = @YACC@
 YFLAGS = @YFLAGS@
@@ -1489,54 +1928,71 @@ TESTS_ENVIRONMENT = EXEEXT='@EXEEXT@' srcdir='$(srcdir)' \
 noinst_HEADERS = 
 noinst_LIBRARIES = 
 check_LIBRARIES = libtests.a
-EXTRA_DIST = test-alloca-opt.c $(top_srcdir)/build/aux/arg-nonnull.h \
-       test-binary-io.sh test-binary-io.c macros.h test-btowc1.sh \
-       test-btowc2.sh test-btowc.c signature.h macros.h \
-       $(top_srcdir)/build/aux/c++defs.h test-c-ctype.c 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-ctype.c dup2.c test-dup2.c signature.h macros.h \
-       test-environ.c test-errno.c fcntl.in.h test-fcntl-h.c \
-       test-fnmatch.c signature.h macros.h test-getdelim.c \
+EXTRA_DIST = test-alloca-opt.c 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-strcase.sh \
+       test-c-strcasecmp.c test-c-strncasecmp.c macros.h \
+       test-canonicalize-lgpl.c signature.h macros.h close.c \
+       test-close.c signature.h macros.h test-ctype.c dup2.c \
+       test-dup2.c signature.h macros.h test-environ.c test-errno.c \
+       test-fcntl-h.c fd-hook.h fdopen.c test-fdopen.c signature.h \
+       macros.h test-fgetc.c signature.h macros.h test-float.c \
+       macros.h test-fnmatch.c signature.h macros.h fpucw.h \
+       test-fputc.c signature.h macros.h test-fread.c signature.h \
+       macros.h fstat.c test-fstat.c signature.h macros.h \
+       test-fwrite.c signature.h macros.h getcwd-lgpl.c \
+       test-getcwd-lgpl.c signature.h macros.h test-getdelim.c \
        signature.h macros.h test-getline.c signature.h macros.h \
        macros.h signature.h test-getopt.c test-getopt.h \
-       test-getopt_long.h getpagesize.c \
-       $(top_srcdir)/build/aux/config.rpath test-ignore-value.c \
-       intprops.h test-isblank.c signature.h macros.h test-langinfo.c \
-       test-locale.c localename.h test-localename.c macros.h \
-       test-lock.c test-lstat.h test-lstat.c signature.h macros.h \
-       test-malloc-gnu.c test-malloca.c test-mbrtowc1.sh \
-       test-mbrtowc2.sh test-mbrtowc3.sh test-mbrtowc4.sh \
-       test-mbrtowc.c test-mbrtowc-w32-1.sh test-mbrtowc-w32-2.sh \
+       test-getopt_long.h getpagesize.c signature.h \
+       test-gettimeofday.c $(top_srcdir)/build/ac-aux/config.rpath \
+       ignore-value.h test-ignore-value.c intprops.h test-intprops.c \
+       macros.h inttypes.in.h test-inttypes.c test-isblank.c \
+       signature.h macros.h test-langinfo.c test-locale.c \
+       test-localeconv.c signature.h macros.h localename.h \
+       test-localename.c macros.h test-lock.c test-lstat.h \
+       test-lstat.c signature.h macros.h test-malloc-gnu.c \
+       test-malloca.c test-mbrtowc1.sh test-mbrtowc2.sh \
+       test-mbrtowc3.sh test-mbrtowc4.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-mbsinit.sh test-mbsinit.c signature.h macros.h \
        test-mbsrtowcs1.sh test-mbsrtowcs2.sh test-mbsrtowcs3.sh \
        test-mbsrtowcs4.sh test-mbsrtowcs.c signature.h macros.h \
-       test-memchr.c zerosize-ptr.h signature.h macros.h \
-       test-nl_langinfo.sh test-nl_langinfo.c signature.h macros.h \
-       open.c test-open.h test-open.c signature.h macros.h putenv.c \
+       test-memchr.c zerosize-ptr.h signature.h macros.h msvc-inval.c \
+       msvc-inval.h msvc-nothrow.c msvc-nothrow.h test-nl_langinfo.sh \
+       test-nl_langinfo.c signature.h macros.h open.c test-open.h \
+       test-open.c signature.h macros.h test-pathmax.c putenv.c \
+       test-rawmemchr.c zerosize-ptr.h signature.h macros.h \
        test-readlink.h test-readlink.c signature.h macros.h \
        test-safe-alloc.c macros.h same-inode.h setenv.c test-setenv.c \
        signature.h macros.h setlocale.c test-setlocale1.sh \
        test-setlocale1.c test-setlocale2.sh test-setlocale2.c \
-       signature.h macros.h test-stat.h test-stat.c signature.h \
-       macros.h test-stdbool.c test-stddef.c test-stdint.c \
-       test-stdio.c test-stdlib.c test-sys_wait.h test-string.c \
+       signature.h macros.h \
+       $(top_srcdir)/build/ac-aux/snippet/_Noreturn.h \
+       $(top_srcdir)/build/ac-aux/snippet/arg-nonnull.h \
+       $(top_srcdir)/build/ac-aux/snippet/c++defs.h \
+       $(top_srcdir)/build/ac-aux/snippet/unused-parameter.h \
+       $(top_srcdir)/build/ac-aux/snippet/warn-on-use.h test-stat.h \
+       test-stat.c signature.h macros.h test-stdbool.c test-stddef.c \
+       test-stdint.c test-stdio.c test-stdlib.c test-sys_wait.h \
+       test-strchrnul.c signature.h macros.h test-string.c \
        test-strnlen.c zerosize-ptr.h signature.h macros.h \
        test-strstr.c zerosize-ptr.h signature.h macros.h symlink.c \
        test-symlink.h test-symlink.c signature.h macros.h \
-       test-sys_stat.c test-sys_wait.c test-sys_wait.h \
-       $(top_srcdir)/build/aux/config.rpath test-time.c test-unistd.c \
-       unsetenv.c test-unsetenv.c signature.h macros.h \
-       $(top_srcdir)/build/aux/unused-parameter.h test-vasnprintf.c \
-       macros.h test-vasprintf.c signature.h macros.h test-verify.c \
-       test-verify.sh init.sh $(top_srcdir)/build/aux/warn-on-use.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 macros.h
+       test-sys_stat.c test-sys_time.c test-sys_types.c \
+       test-sys_wait.c test-sys_wait.h init.sh test-init.sh \
+       test-thread_self.c test-thread_create.c macros.h \
+       $(top_srcdir)/build/ac-aux/config.rpath test-time.c \
+       test-unistd.c unsetenv.c test-unsetenv.c signature.h macros.h \
+       test-vasnprintf.c macros.h test-vasprintf.c signature.h \
+       macros.h test-verify.c test-verify.sh 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 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
@@ -1552,12 +2008,12 @@ EXTRA_DIST = test-alloca-opt.c $(top_srcdir)/build/aux/arg-nonnull.h \
 # 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 c++defs.h fcntl.h unused-parameter.h \
+BUILT_SOURCES = inttypes.h arg-nonnull.h c++defs.h unused-parameter.h \
        warn-on-use.h
 SUFFIXES = 
-MOSTLYCLEANFILES = core *.stackdump arg-nonnull.h arg-nonnull.h-t \
-       c++defs.h c++defs.h-t fcntl.h fcntl.h-t test-getdelim.txt \
-       test-getline.txt unused-parameter.h unused-parameter.h-t \
+MOSTLYCLEANFILES = core *.stackdump test-getdelim.txt test-getline.txt \
+       inttypes.h inttypes.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
 MOSTLYCLEANDIRS = 
 CLEANFILES = 
@@ -1571,26 +2027,37 @@ AM_CPPFLAGS = \
 
 LDADD = libtests.a ../../gnulib/lib/libgnu.la libtests.a $(LIBTESTS_LIBDEPS)
 libtests_a_SOURCES = binary-io.h c-ctype.h c-ctype.c c-strcase.h \
-       c-strcasecmp.c c-strncasecmp.c ignore-value.h localename.c \
+       c-strcasecmp.c c-strncasecmp.c fd-hook.c localename.c \
        glthread/lock.h glthread/lock.c glthread/thread.h \
        glthread/thread.c glthread/threadlib.c glthread/yield.h
 libtests_a_LIBADD = $(gltests_LIBOBJS)
 libtests_a_DEPENDENCIES = $(gltests_LIBOBJS)
-EXTRA_libtests_a_SOURCES = dup2.c getpagesize.c open.c putenv.c \
-       setenv.c setlocale.c symlink.c unsetenv.c wctob.c wctomb.c
+EXTRA_libtests_a_SOURCES = close.c dup2.c fdopen.c fstat.c \
+       getcwd-lgpl.c getpagesize.c msvc-inval.c msvc-nothrow.c open.c \
+       putenv.c setenv.c setlocale.c symlink.c unsetenv.c wctob.c \
+       wctomb.c
 AM_LIBTOOLFLAGS = --preserve-dup-deps
-ARG_NONNULL_H = arg-nonnull.h
-CXXDEFS_H = c++defs.h
+test_getcwd_lgpl_LDADD = $(LDADD) $(LIBINTL)
 test_getopt_LDADD = $(LDADD) $(LIBINTL)
-test_localename_LDADD = $(LDADD) @INTL_MACOSX_LIBS@
+test_localename_LDADD = $(LDADD) @INTL_MACOSX_LIBS@ $(LIBTHREAD)
 test_lock_LDADD = $(LDADD) @LIBMULTITHREAD@ @YIELD_LIB@
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all Makefile.am that
+# need it. This is ensured by the applicability 'all' defined above.
+_NORETURN_H = $(top_srcdir)/build/ac-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
+test_stat_LDADD = $(LDADD) $(LIBINTL)
+test_thread_self_LDADD = $(LDADD) @LIBTHREAD@
+test_thread_create_LDADD = $(LDADD) @LIBMULTITHREAD@
 all: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) all-recursive
 
 .SUFFIXES:
-.SUFFIXES: .c .html .lo .log .o .obj .test .test$(EXEEXT)
+.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -1639,7 +2106,8 @@ glthread/thread.$(OBJEXT): glthread/$(am__dirstamp) \
        glthread/$(DEPDIR)/$(am__dirstamp)
 glthread/threadlib.$(OBJEXT): glthread/$(am__dirstamp) \
        glthread/$(DEPDIR)/$(am__dirstamp)
-libtests.a: $(libtests_a_OBJECTS) $(libtests_a_DEPENDENCIES) 
+
+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
@@ -1661,189 +2129,326 @@ clean-noinstPROGRAMS:
        list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
        echo " rm -f" $$list; \
        rm -f $$list
-test-alloca-opt$(EXEEXT): $(test_alloca_opt_OBJECTS) $(test_alloca_opt_DEPENDENCIES) 
+
+test-alloca-opt$(EXEEXT): $(test_alloca_opt_OBJECTS) $(test_alloca_opt_DEPENDENCIES) $(EXTRA_test_alloca_opt_DEPENDENCIES) 
        @rm -f test-alloca-opt$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_alloca_opt_OBJECTS) $(test_alloca_opt_LDADD) $(LIBS)
-test-binary-io$(EXEEXT): $(test_binary_io_OBJECTS) $(test_binary_io_DEPENDENCIES) 
+
+test-binary-io$(EXEEXT): $(test_binary_io_OBJECTS) $(test_binary_io_DEPENDENCIES) $(EXTRA_test_binary_io_DEPENDENCIES) 
        @rm -f test-binary-io$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_binary_io_OBJECTS) $(test_binary_io_LDADD) $(LIBS)
-test-btowc$(EXEEXT): $(test_btowc_OBJECTS) $(test_btowc_DEPENDENCIES) 
+
+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)
-test-c-ctype$(EXEEXT): $(test_c_ctype_OBJECTS) $(test_c_ctype_DEPENDENCIES) 
+
+test-c-ctype$(EXEEXT): $(test_c_ctype_OBJECTS) $(test_c_ctype_DEPENDENCIES) $(EXTRA_test_c_ctype_DEPENDENCIES) 
        @rm -f test-c-ctype$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_c_ctype_OBJECTS) $(test_c_ctype_LDADD) $(LIBS)
-test-c-strcasecmp$(EXEEXT): $(test_c_strcasecmp_OBJECTS) $(test_c_strcasecmp_DEPENDENCIES) 
+
+test-c-strcasecmp$(EXEEXT): $(test_c_strcasecmp_OBJECTS) $(test_c_strcasecmp_DEPENDENCIES) $(EXTRA_test_c_strcasecmp_DEPENDENCIES) 
        @rm -f test-c-strcasecmp$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_c_strcasecmp_OBJECTS) $(test_c_strcasecmp_LDADD) $(LIBS)
-test-c-strncasecmp$(EXEEXT): $(test_c_strncasecmp_OBJECTS) $(test_c_strncasecmp_DEPENDENCIES) 
+
+test-c-strncasecmp$(EXEEXT): $(test_c_strncasecmp_OBJECTS) $(test_c_strncasecmp_DEPENDENCIES) $(EXTRA_test_c_strncasecmp_DEPENDENCIES) 
        @rm -f test-c-strncasecmp$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_c_strncasecmp_OBJECTS) $(test_c_strncasecmp_LDADD) $(LIBS)
-test-canonicalize-lgpl$(EXEEXT): $(test_canonicalize_lgpl_OBJECTS) $(test_canonicalize_lgpl_DEPENDENCIES) 
+
+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)
-test-ctype$(EXEEXT): $(test_ctype_OBJECTS) $(test_ctype_DEPENDENCIES) 
+
+test-close$(EXEEXT): $(test_close_OBJECTS) $(test_close_DEPENDENCIES) $(EXTRA_test_close_DEPENDENCIES) 
+       @rm -f test-close$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_close_OBJECTS) $(test_close_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-dup2$(EXEEXT): $(test_dup2_OBJECTS) $(test_dup2_DEPENDENCIES) 
+
+test-dup2$(EXEEXT): $(test_dup2_OBJECTS) $(test_dup2_DEPENDENCIES) $(EXTRA_test_dup2_DEPENDENCIES) 
        @rm -f test-dup2$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_dup2_OBJECTS) $(test_dup2_LDADD) $(LIBS)
-test-environ$(EXEEXT): $(test_environ_OBJECTS) $(test_environ_DEPENDENCIES) 
+
+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)
-test-errno$(EXEEXT): $(test_errno_OBJECTS) $(test_errno_DEPENDENCIES) 
+
+test-errno$(EXEEXT): $(test_errno_OBJECTS) $(test_errno_DEPENDENCIES) $(EXTRA_test_errno_DEPENDENCIES) 
        @rm -f test-errno$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_errno_OBJECTS) $(test_errno_LDADD) $(LIBS)
-test-fcntl-h$(EXEEXT): $(test_fcntl_h_OBJECTS) $(test_fcntl_h_DEPENDENCIES) 
+
+test-fcntl-h$(EXEEXT): $(test_fcntl_h_OBJECTS) $(test_fcntl_h_DEPENDENCIES) $(EXTRA_test_fcntl_h_DEPENDENCIES) 
        @rm -f test-fcntl-h$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_fcntl_h_OBJECTS) $(test_fcntl_h_LDADD) $(LIBS)
-test-fnmatch$(EXEEXT): $(test_fnmatch_OBJECTS) $(test_fnmatch_DEPENDENCIES) 
+
+test-fdopen$(EXEEXT): $(test_fdopen_OBJECTS) $(test_fdopen_DEPENDENCIES) $(EXTRA_test_fdopen_DEPENDENCIES) 
+       @rm -f test-fdopen$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_fdopen_OBJECTS) $(test_fdopen_LDADD) $(LIBS)
+
+test-fgetc$(EXEEXT): $(test_fgetc_OBJECTS) $(test_fgetc_DEPENDENCIES) $(EXTRA_test_fgetc_DEPENDENCIES) 
+       @rm -f test-fgetc$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_fgetc_OBJECTS) $(test_fgetc_LDADD) $(LIBS)
+
+test-float$(EXEEXT): $(test_float_OBJECTS) $(test_float_DEPENDENCIES) $(EXTRA_test_float_DEPENDENCIES) 
+       @rm -f test-float$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_float_OBJECTS) $(test_float_LDADD) $(LIBS)
+
+test-fnmatch$(EXEEXT): $(test_fnmatch_OBJECTS) $(test_fnmatch_DEPENDENCIES) $(EXTRA_test_fnmatch_DEPENDENCIES) 
        @rm -f test-fnmatch$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_fnmatch_OBJECTS) $(test_fnmatch_LDADD) $(LIBS)
-test-getdelim$(EXEEXT): $(test_getdelim_OBJECTS) $(test_getdelim_DEPENDENCIES) 
+
+test-fputc$(EXEEXT): $(test_fputc_OBJECTS) $(test_fputc_DEPENDENCIES) $(EXTRA_test_fputc_DEPENDENCIES) 
+       @rm -f test-fputc$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_fputc_OBJECTS) $(test_fputc_LDADD) $(LIBS)
+
+test-fread$(EXEEXT): $(test_fread_OBJECTS) $(test_fread_DEPENDENCIES) $(EXTRA_test_fread_DEPENDENCIES) 
+       @rm -f test-fread$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_fread_OBJECTS) $(test_fread_LDADD) $(LIBS)
+
+test-fstat$(EXEEXT): $(test_fstat_OBJECTS) $(test_fstat_DEPENDENCIES) $(EXTRA_test_fstat_DEPENDENCIES) 
+       @rm -f test-fstat$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_fstat_OBJECTS) $(test_fstat_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-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)
+
+test-getdelim$(EXEEXT): $(test_getdelim_OBJECTS) $(test_getdelim_DEPENDENCIES) $(EXTRA_test_getdelim_DEPENDENCIES) 
        @rm -f test-getdelim$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_getdelim_OBJECTS) $(test_getdelim_LDADD) $(LIBS)
-test-getline$(EXEEXT): $(test_getline_OBJECTS) $(test_getline_DEPENDENCIES) 
+
+test-getline$(EXEEXT): $(test_getline_OBJECTS) $(test_getline_DEPENDENCIES) $(EXTRA_test_getline_DEPENDENCIES) 
        @rm -f test-getline$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_getline_OBJECTS) $(test_getline_LDADD) $(LIBS)
-test-getopt$(EXEEXT): $(test_getopt_OBJECTS) $(test_getopt_DEPENDENCIES) 
+
+test-getopt$(EXEEXT): $(test_getopt_OBJECTS) $(test_getopt_DEPENDENCIES) $(EXTRA_test_getopt_DEPENDENCIES) 
        @rm -f test-getopt$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_getopt_OBJECTS) $(test_getopt_LDADD) $(LIBS)
-test-ignore-value$(EXEEXT): $(test_ignore_value_OBJECTS) $(test_ignore_value_DEPENDENCIES) 
+
+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-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-isblank$(EXEEXT): $(test_isblank_OBJECTS) $(test_isblank_DEPENDENCIES) 
+
+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-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-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)
-test-langinfo$(EXEEXT): $(test_langinfo_OBJECTS) $(test_langinfo_DEPENDENCIES) 
+
+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)
-test-locale$(EXEEXT): $(test_locale_OBJECTS) $(test_locale_DEPENDENCIES) 
+
+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)
-test-localename$(EXEEXT): $(test_localename_OBJECTS) $(test_localename_DEPENDENCIES) 
+
+test-localeconv$(EXEEXT): $(test_localeconv_OBJECTS) $(test_localeconv_DEPENDENCIES) $(EXTRA_test_localeconv_DEPENDENCIES) 
+       @rm -f test-localeconv$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_localeconv_OBJECTS) $(test_localeconv_LDADD) $(LIBS)
+
+test-localename$(EXEEXT): $(test_localename_OBJECTS) $(test_localename_DEPENDENCIES) $(EXTRA_test_localename_DEPENDENCIES) 
        @rm -f test-localename$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_localename_OBJECTS) $(test_localename_LDADD) $(LIBS)
-test-lock$(EXEEXT): $(test_lock_OBJECTS) $(test_lock_DEPENDENCIES) 
+
+test-lock$(EXEEXT): $(test_lock_OBJECTS) $(test_lock_DEPENDENCIES) $(EXTRA_test_lock_DEPENDENCIES) 
        @rm -f test-lock$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_lock_OBJECTS) $(test_lock_LDADD) $(LIBS)
-test-lstat$(EXEEXT): $(test_lstat_OBJECTS) $(test_lstat_DEPENDENCIES) 
+
+test-lstat$(EXEEXT): $(test_lstat_OBJECTS) $(test_lstat_DEPENDENCIES) $(EXTRA_test_lstat_DEPENDENCIES) 
        @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) 
+
+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) 
+
+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)
-test-mbrtowc$(EXEEXT): $(test_mbrtowc_OBJECTS) $(test_mbrtowc_DEPENDENCIES) 
+
+test-mbrtowc$(EXEEXT): $(test_mbrtowc_OBJECTS) $(test_mbrtowc_DEPENDENCIES) $(EXTRA_test_mbrtowc_DEPENDENCIES) 
        @rm -f test-mbrtowc$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_mbrtowc_OBJECTS) $(test_mbrtowc_LDADD) $(LIBS)
-test-mbrtowc-w32$(EXEEXT): $(test_mbrtowc_w32_OBJECTS) $(test_mbrtowc_w32_DEPENDENCIES) 
+
+test-mbrtowc-w32$(EXEEXT): $(test_mbrtowc_w32_OBJECTS) $(test_mbrtowc_w32_DEPENDENCIES) $(EXTRA_test_mbrtowc_w32_DEPENDENCIES) 
        @rm -f test-mbrtowc-w32$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_mbrtowc_w32_OBJECTS) $(test_mbrtowc_w32_LDADD) $(LIBS)
-test-mbsinit$(EXEEXT): $(test_mbsinit_OBJECTS) $(test_mbsinit_DEPENDENCIES) 
+
+test-mbsinit$(EXEEXT): $(test_mbsinit_OBJECTS) $(test_mbsinit_DEPENDENCIES) $(EXTRA_test_mbsinit_DEPENDENCIES) 
        @rm -f test-mbsinit$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_mbsinit_OBJECTS) $(test_mbsinit_LDADD) $(LIBS)
-test-mbsrtowcs$(EXEEXT): $(test_mbsrtowcs_OBJECTS) $(test_mbsrtowcs_DEPENDENCIES) 
+
+test-mbsrtowcs$(EXEEXT): $(test_mbsrtowcs_OBJECTS) $(test_mbsrtowcs_DEPENDENCIES) $(EXTRA_test_mbsrtowcs_DEPENDENCIES) 
        @rm -f test-mbsrtowcs$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_mbsrtowcs_OBJECTS) $(test_mbsrtowcs_LDADD) $(LIBS)
-test-memchr$(EXEEXT): $(test_memchr_OBJECTS) $(test_memchr_DEPENDENCIES) 
+
+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)
-test-nl_langinfo$(EXEEXT): $(test_nl_langinfo_OBJECTS) $(test_nl_langinfo_DEPENDENCIES) 
+
+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-open$(EXEEXT): $(test_open_OBJECTS) $(test_open_DEPENDENCIES) 
+
+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-readlink$(EXEEXT): $(test_readlink_OBJECTS) $(test_readlink_DEPENDENCIES) 
+
+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-rawmemchr$(EXEEXT): $(test_rawmemchr_OBJECTS) $(test_rawmemchr_DEPENDENCIES) $(EXTRA_test_rawmemchr_DEPENDENCIES) 
+       @rm -f test-rawmemchr$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_rawmemchr_OBJECTS) $(test_rawmemchr_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-safe-alloc$(EXEEXT): $(test_safe_alloc_OBJECTS) $(test_safe_alloc_DEPENDENCIES) 
+
+test-safe-alloc$(EXEEXT): $(test_safe_alloc_OBJECTS) $(test_safe_alloc_DEPENDENCIES) $(EXTRA_test_safe_alloc_DEPENDENCIES) 
        @rm -f test-safe-alloc$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_safe_alloc_OBJECTS) $(test_safe_alloc_LDADD) $(LIBS)
-test-setenv$(EXEEXT): $(test_setenv_OBJECTS) $(test_setenv_DEPENDENCIES) 
+
+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)
-test-setlocale1$(EXEEXT): $(test_setlocale1_OBJECTS) $(test_setlocale1_DEPENDENCIES) 
+
+test-setlocale1$(EXEEXT): $(test_setlocale1_OBJECTS) $(test_setlocale1_DEPENDENCIES) $(EXTRA_test_setlocale1_DEPENDENCIES) 
        @rm -f test-setlocale1$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_setlocale1_OBJECTS) $(test_setlocale1_LDADD) $(LIBS)
-test-setlocale2$(EXEEXT): $(test_setlocale2_OBJECTS) $(test_setlocale2_DEPENDENCIES) 
+
+test-setlocale2$(EXEEXT): $(test_setlocale2_OBJECTS) $(test_setlocale2_DEPENDENCIES) $(EXTRA_test_setlocale2_DEPENDENCIES) 
        @rm -f test-setlocale2$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_setlocale2_OBJECTS) $(test_setlocale2_LDADD) $(LIBS)
-test-stat$(EXEEXT): $(test_stat_OBJECTS) $(test_stat_DEPENDENCIES) 
+
+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-stdbool$(EXEEXT): $(test_stdbool_OBJECTS) $(test_stdbool_DEPENDENCIES) 
+
+test-stdbool$(EXEEXT): $(test_stdbool_OBJECTS) $(test_stdbool_DEPENDENCIES) $(EXTRA_test_stdbool_DEPENDENCIES) 
        @rm -f test-stdbool$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_stdbool_OBJECTS) $(test_stdbool_LDADD) $(LIBS)
-test-stddef$(EXEEXT): $(test_stddef_OBJECTS) $(test_stddef_DEPENDENCIES) 
+
+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-stdint$(EXEEXT): $(test_stdint_OBJECTS) $(test_stdint_DEPENDENCIES) 
+
+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-stdio$(EXEEXT): $(test_stdio_OBJECTS) $(test_stdio_DEPENDENCIES) 
+
+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)
-test-stdlib$(EXEEXT): $(test_stdlib_OBJECTS) $(test_stdlib_DEPENDENCIES) 
+
+test-stdlib$(EXEEXT): $(test_stdlib_OBJECTS) $(test_stdlib_DEPENDENCIES) $(EXTRA_test_stdlib_DEPENDENCIES) 
        @rm -f test-stdlib$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_stdlib_OBJECTS) $(test_stdlib_LDADD) $(LIBS)
-test-string$(EXEEXT): $(test_string_OBJECTS) $(test_string_DEPENDENCIES) 
+
+test-strchrnul$(EXEEXT): $(test_strchrnul_OBJECTS) $(test_strchrnul_DEPENDENCIES) $(EXTRA_test_strchrnul_DEPENDENCIES) 
+       @rm -f test-strchrnul$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_strchrnul_OBJECTS) $(test_strchrnul_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)
-test-strnlen$(EXEEXT): $(test_strnlen_OBJECTS) $(test_strnlen_DEPENDENCIES) 
+
+test-strnlen$(EXEEXT): $(test_strnlen_OBJECTS) $(test_strnlen_DEPENDENCIES) $(EXTRA_test_strnlen_DEPENDENCIES) 
        @rm -f test-strnlen$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_strnlen_OBJECTS) $(test_strnlen_LDADD) $(LIBS)
-test-strstr$(EXEEXT): $(test_strstr_OBJECTS) $(test_strstr_DEPENDENCIES) 
+
+test-strstr$(EXEEXT): $(test_strstr_OBJECTS) $(test_strstr_DEPENDENCIES) $(EXTRA_test_strstr_DEPENDENCIES) 
        @rm -f test-strstr$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_strstr_OBJECTS) $(test_strstr_LDADD) $(LIBS)
-test-symlink$(EXEEXT): $(test_symlink_OBJECTS) $(test_symlink_DEPENDENCIES) 
+
+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_stat$(EXEEXT): $(test_sys_stat_OBJECTS) $(test_sys_stat_DEPENDENCIES) 
+
+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)
-test-sys_wait$(EXEEXT): $(test_sys_wait_OBJECTS) $(test_sys_wait_DEPENDENCIES) 
+
+test-sys_time$(EXEEXT): $(test_sys_time_OBJECTS) $(test_sys_time_DEPENDENCIES) $(EXTRA_test_sys_time_DEPENDENCIES) 
+       @rm -f test-sys_time$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_sys_time_OBJECTS) $(test_sys_time_LDADD) $(LIBS)
+
+test-sys_types$(EXEEXT): $(test_sys_types_OBJECTS) $(test_sys_types_DEPENDENCIES) $(EXTRA_test_sys_types_DEPENDENCIES) 
+       @rm -f test-sys_types$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_sys_types_OBJECTS) $(test_sys_types_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)
-test-time$(EXEEXT): $(test_time_OBJECTS) $(test_time_DEPENDENCIES) 
+
+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)
-test-unistd$(EXEEXT): $(test_unistd_OBJECTS) $(test_unistd_DEPENDENCIES) 
+
+test-unistd$(EXEEXT): $(test_unistd_OBJECTS) $(test_unistd_DEPENDENCIES) $(EXTRA_test_unistd_DEPENDENCIES) 
        @rm -f test-unistd$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_unistd_OBJECTS) $(test_unistd_LDADD) $(LIBS)
-test-unsetenv$(EXEEXT): $(test_unsetenv_OBJECTS) $(test_unsetenv_DEPENDENCIES) 
+
+test-unsetenv$(EXEEXT): $(test_unsetenv_OBJECTS) $(test_unsetenv_DEPENDENCIES) $(EXTRA_test_unsetenv_DEPENDENCIES) 
        @rm -f test-unsetenv$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_unsetenv_OBJECTS) $(test_unsetenv_LDADD) $(LIBS)
-test-vasnprintf$(EXEEXT): $(test_vasnprintf_OBJECTS) $(test_vasnprintf_DEPENDENCIES) 
+
+test-vasnprintf$(EXEEXT): $(test_vasnprintf_OBJECTS) $(test_vasnprintf_DEPENDENCIES) $(EXTRA_test_vasnprintf_DEPENDENCIES) 
        @rm -f test-vasnprintf$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_vasnprintf_OBJECTS) $(test_vasnprintf_LDADD) $(LIBS)
-test-vasprintf$(EXEEXT): $(test_vasprintf_OBJECTS) $(test_vasprintf_DEPENDENCIES) 
+
+test-vasprintf$(EXEEXT): $(test_vasprintf_OBJECTS) $(test_vasprintf_DEPENDENCIES) $(EXTRA_test_vasprintf_DEPENDENCIES) 
        @rm -f test-vasprintf$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_vasprintf_OBJECTS) $(test_vasprintf_LDADD) $(LIBS)
-test-verify$(EXEEXT): $(test_verify_OBJECTS) $(test_verify_DEPENDENCIES) 
+
+test-verify$(EXEEXT): $(test_verify_OBJECTS) $(test_verify_DEPENDENCIES) $(EXTRA_test_verify_DEPENDENCIES) 
        @rm -f test-verify$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_verify_OBJECTS) $(test_verify_LDADD) $(LIBS)
-test-wchar$(EXEEXT): $(test_wchar_OBJECTS) $(test_wchar_DEPENDENCIES) 
+
+test-wchar$(EXEEXT): $(test_wchar_OBJECTS) $(test_wchar_DEPENDENCIES) $(EXTRA_test_wchar_DEPENDENCIES) 
        @rm -f test-wchar$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_wchar_OBJECTS) $(test_wchar_LDADD) $(LIBS)
-test-wcrtomb$(EXEEXT): $(test_wcrtomb_OBJECTS) $(test_wcrtomb_DEPENDENCIES) 
+
+test-wcrtomb$(EXEEXT): $(test_wcrtomb_OBJECTS) $(test_wcrtomb_DEPENDENCIES) $(EXTRA_test_wcrtomb_DEPENDENCIES) 
        @rm -f test-wcrtomb$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_wcrtomb_OBJECTS) $(test_wcrtomb_LDADD) $(LIBS)
-test-wcrtomb-w32$(EXEEXT): $(test_wcrtomb_w32_OBJECTS) $(test_wcrtomb_w32_DEPENDENCIES) 
+
+test-wcrtomb-w32$(EXEEXT): $(test_wcrtomb_w32_OBJECTS) $(test_wcrtomb_w32_DEPENDENCIES) $(EXTRA_test_wcrtomb_w32_DEPENDENCIES) 
        @rm -f test-wcrtomb-w32$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_wcrtomb_w32_OBJECTS) $(test_wcrtomb_w32_LDADD) $(LIBS)
-test-wctype-h$(EXEEXT): $(test_wctype_h_OBJECTS) $(test_wctype_h_DEPENDENCIES) 
+
+test-wctype-h$(EXEEXT): $(test_wctype_h_OBJECTS) $(test_wctype_h_DEPENDENCIES) $(EXTRA_test_wctype_h_DEPENDENCIES) 
        @rm -f test-wctype-h$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_wctype_h_OBJECTS) $(test_wctype_h_LDADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
-       -rm -f glthread/lock.$(OBJEXT)
-       -rm -f glthread/thread.$(OBJEXT)
-       -rm -f glthread/threadlib.$(OBJEXT)
+       -rm -f glthread/*.$(OBJEXT)
 
 distclean-compile:
        -rm -f *.tab.c
@@ -1851,9 +2456,16 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-ctype.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)/close.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd-hook.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdopen.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat.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)/localename.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)/open.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/putenv.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setenv.Po@am__quote@
@@ -1866,19 +2478,32 @@ distclean-compile:
 @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-close.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ctype.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-fcntl-h.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fdopen.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fgetc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-float.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fnmatch.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-fstat.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-getdelim.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getline.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getopt.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-langinfo.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-lock.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-lstat.Po@am__quote@
@@ -1891,6 +2516,8 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-memchr.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-rawmemchr.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-readlink.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-safe-alloc.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setenv.Po@am__quote@
@@ -1902,12 +2529,17 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdint.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdio.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-string.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strnlen.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strstr.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.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.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_wait.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-thread_create.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-thread_self.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-time.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@
@@ -1929,28 +2561,25 @@ distclean-compile:
 @am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
 @am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
 @am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c -o $@ $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
 
 .c.obj:
 @am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
 @am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
 @am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
 .c.lo:
 @am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
 @am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
 @am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
 
 mostlyclean-libtool:
        -rm -f *.lo
@@ -1959,22 +2588,25 @@ clean-libtool:
        -rm -rf .libs _libs
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-       @fail= failcom='exit 1'; \
-       for f in x $$MAKEFLAGS; do \
-         case $$f in \
-           *=* | --[!k]*);; \
-           *k*) failcom='fail=yes';; \
-         esac; \
-       done; \
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+       @fail=; \
+       if $(am__make_keepgoing); then \
+         failcom='fail=yes'; \
+       else \
+         failcom='exit 1'; \
+       fi; \
        dot_seen=no; \
        target=`echo $@ | sed s/-recursive//`; \
-       list='$(SUBDIRS)'; for subdir in $$list; do \
+       case "$@" in \
+         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+         *) list='$(SUBDIRS)' ;; \
+       esac; \
+       for subdir in $$list; do \
          echo "Making $$target in $$subdir"; \
          if test "$$subdir" = "."; then \
            dot_seen=yes; \
@@ -1989,57 +2621,12 @@ $(RECURSIVE_TARGETS):
          $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
        fi; test -z "$$fail"
 
-$(RECURSIVE_CLEAN_TARGETS):
-       @fail= failcom='exit 1'; \
-       for f in x $$MAKEFLAGS; do \
-         case $$f in \
-           *=* | --[!k]*);; \
-           *k*) failcom='fail=yes';; \
-         esac; \
-       done; \
-       dot_seen=no; \
-       case "$@" in \
-         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-         *) list='$(SUBDIRS)' ;; \
-       esac; \
-       rev=''; for subdir in $$list; do \
-         if test "$$subdir" = "."; then :; else \
-           rev="$$subdir $$rev"; \
-         fi; \
-       done; \
-       rev="$$rev ."; \
-       target=`echo $@ | sed s/-recursive//`; \
-       for subdir in $$rev; do \
-         echo "Making $$target in $$subdir"; \
-         if test "$$subdir" = "."; then \
-           local_target="$$target-am"; \
-         else \
-           local_target="$$target"; \
-         fi; \
-         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-         || eval $$failcom; \
-       done && test -z "$$fail"
-tags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-       done
-ctags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-       done
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
        if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -2055,12 +2642,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
          fi; \
        done; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -2072,15 +2654,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -2089,314 +2667,845 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
 
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-# To be appended to the command running the test.  Handle the stdout
-# and stderr redirection, and catch the exit status.
-am__check_post =                                       \
->$@-t 2>&1;                                            \
-estatus=$$?;                                           \
-if test -n '$(DISABLE_HARD_ERRORS)'                    \
-   && test $$estatus -eq 99; then                      \
-  estatus=1;                                           \
-fi;                                                    \
-TERM=$$__SAVED_TERM; export TERM;                      \
-$(am__tty_colors);                                     \
-xfailed=PASS;                                          \
-case " $(XFAIL_TESTS) " in                             \
-  *[\ \        ]$$f[\ \        ]* | *[\ \      ]$$dir$$f[\ \   ]*) \
-    xfailed=XFAIL;;                                    \
-esac;                                                  \
-case $$estatus:$$xfailed in                            \
-    0:XFAIL) col=$$red; res=XPASS;;                    \
-    0:*)     col=$$grn; res=PASS ;;                    \
-    77:*)    col=$$blu; res=SKIP ;;                    \
-    99:*)    col=$$red; res=FAIL ;;                    \
-    *:XFAIL) col=$$lgn; res=XFAIL;;                    \
-    *:*)     col=$$red; res=FAIL ;;                    \
-esac;                                                  \
-echo "$${col}$$res$${std}: $$f";                       \
-echo "$$res: $$f (exit: $$estatus)" |                  \
-  $(am__rst_section) >$@;                              \
-cat $@-t >>$@;                                         \
-rm -f $@-t
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'.  Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+       rm -f $< $@
+       $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+       @:
 
 $(TEST_SUITE_LOG): $(TEST_LOGS)
-       @$(am__sh_e_setup);                                             \
-       list='$(TEST_LOGS)';                                            \
-       results=`for f in $$list; do                                    \
-                  read line < $$f && echo "$$line" || echo FAIL;       \
-                done`;                                                 \
-       all=`echo "$$results" | sed '/^$$/d' | wc -l | sed -e 's/^[      ]*//'`; \
-       fail=`echo "$$results" | grep -c '^FAIL'`;                      \
-       pass=`echo "$$results" | grep -c '^PASS'`;                      \
-       skip=`echo "$$results" | grep -c '^SKIP'`;                      \
-       xfail=`echo "$$results" | grep -c '^XFAIL'`;                    \
-       xpass=`echo "$$results" | grep -c '^XPASS'`;                    \
-       failures=`expr $$fail + $$xpass`;                               \
-       all=`expr $$all - $$skip`;                                      \
-       if test "$$all" -eq 1; then tests=test; All=;                   \
-       else tests=tests; All="All "; fi;                               \
-       case fail=$$fail:xpass=$$xpass:xfail=$$xfail in                 \
-         fail=0:xpass=0:xfail=0)                                       \
-           msg="$$All$$all $$tests passed.  ";                         \
-           exit=true;;                                                 \
-         fail=0:xpass=0:xfail=*)                                       \
-           msg="$$All$$all $$tests behaved as expected";               \
-           if test "$$xfail" -eq 1; then xfailures=failure;            \
-           else xfailures=failures; fi;                                \
-           msg="$$msg ($$xfail expected $$xfailures).  ";              \
-           exit=true;;                                                 \
-         fail=*:xpass=0:xfail=*)                                       \
-           msg="$$fail of $$all $$tests failed.  ";                    \
-           exit=false;;                                                \
-         fail=*:xpass=*:xfail=*)                                       \
-           msg="$$failures of $$all $$tests did not behave as expected"; \
-           if test "$$xpass" -eq 1; then xpasses=pass;                 \
-           else xpasses=passes; fi;                                    \
-           msg="$$msg ($$xpass unexpected $$xpasses).  ";              \
-           exit=false;;                                                \
-         *)                                                            \
-           echo >&2 "incorrect case"; exit 4;;                         \
-       esac;                                                           \
-       if test "$$skip" -ne 0; then                                    \
-         if test "$$skip" -eq 1; then                                  \
-           msg="$$msg($$skip test was not run).  ";                    \
-         else                                                          \
-           msg="$$msg($$skip tests were not run).  ";                  \
-         fi;                                                           \
-       fi;                                                             \
+       @$(am__set_TESTS_bases); \
+       am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+       redo_bases=`for i in $$bases; do \
+                     am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+                   done`; \
+       if test -n "$$redo_bases"; then \
+         redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+         redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+         if $(am__make_dryrun); then :; else \
+           rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+         fi; \
+       fi; \
+       if test -n "$$am__remaking_logs"; then \
+         echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+              "recursion detected" >&2; \
+       else \
+         am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+       fi; \
+       if $(am__make_dryrun); then :; else \
+         st=0;  \
+         errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+         for i in $$redo_bases; do \
+           test -f $$i.trs && test -r $$i.trs \
+             || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+           test -f $$i.log && test -r $$i.log \
+             || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+         done; \
+         test $$st -eq 0 || exit 1; \
+       fi
+       @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+       ws='[   ]'; \
+       results=`for b in $$bases; do echo $$b.trs; done`; \
+       test -n "$$results" || results=/dev/null; \
+       all=`  grep "^$$ws*:test-result:"           $$results | wc -l`; \
+       pass=` grep "^$$ws*:test-result:$$ws*PASS"  $$results | wc -l`; \
+       fail=` grep "^$$ws*:test-result:$$ws*FAIL"  $$results | wc -l`; \
+       skip=` grep "^$$ws*:test-result:$$ws*SKIP"  $$results | wc -l`; \
+       xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+       xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+       error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+       if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+         success=true; \
+       else \
+         success=false; \
+       fi; \
+       br='==================='; br=$$br$$br$$br$$br; \
+       result_count () \
+       { \
+           if test x"$$1" = x"--maybe-color"; then \
+             maybe_colorize=yes; \
+           elif test x"$$1" = x"--no-color"; then \
+             maybe_colorize=no; \
+           else \
+             echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+           fi; \
+           shift; \
+           desc=$$1 count=$$2; \
+           if test $$maybe_colorize = yes && test $$count -gt 0; then \
+             color_start=$$3 color_end=$$std; \
+           else \
+             color_start= color_end=; \
+           fi; \
+           echo "$${color_start}# $$desc $$count$${color_end}"; \
+       }; \
+       create_testsuite_report () \
+       { \
+         result_count $$1 "TOTAL:" $$all   "$$brg"; \
+         result_count $$1 "PASS: " $$pass  "$$grn"; \
+         result_count $$1 "SKIP: " $$skip  "$$blu"; \
+         result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+         result_count $$1 "FAIL: " $$fail  "$$red"; \
+         result_count $$1 "XPASS:" $$xpass "$$red"; \
+         result_count $$1 "ERROR:" $$error "$$mgn"; \
+       }; \
        {                                                               \
          echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" |       \
            $(am__rst_title);                                           \
-         echo "$$msg";                                                 \
+         create_testsuite_report --no-color;                           \
          echo;                                                         \
          echo ".. contents:: :depth: 2";                               \
          echo;                                                         \
-         for f in $$list; do                                           \
-           read line < $$f;                                            \
-           case $$line in                                              \
-             PASS:*|XFAIL:*);;                                         \
-             *) echo; cat $$f;;                                        \
-           esac;                                                       \
-         done;                                                         \
-       } >$(TEST_SUITE_LOG).tmp;                                       \
+         for b in $$bases; do echo $$b; done                           \
+           | $(am__create_global_log);                                 \
+       } >$(TEST_SUITE_LOG).tmp || exit 1;                             \
        mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG);                     \
-       if test "$$failures" -ne 0; then                                \
-         msg="$${msg}See $(subdir)/$(TEST_SUITE_LOG).  ";              \
+       if $$success; then                                              \
+         col="$$grn";                                                  \
+        else                                                           \
+         col="$$red";                                                  \
+         test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG);               \
+       fi;                                                             \
+       echo "$${col}$$br$${std}";                                      \
+       echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}";   \
+       echo "$${col}$$br$${std}";                                      \
+       create_testsuite_report --maybe-color;                          \
+       echo "$$col$$br$$std";                                          \
+       if $$success; then :; else                                      \
+         echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}";         \
          if test -n "$(PACKAGE_BUGREPORT)"; then                       \
-           msg="$${msg}Please report to $(PACKAGE_BUGREPORT).  ";      \
+           echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
          fi;                                                           \
+         echo "$$col$$br$$std";                                        \
        fi;                                                             \
-       test x"$$VERBOSE" = x || $$exit || cat $(TEST_SUITE_LOG);       \
-       $(am__tty_colors);                                              \
-       if $$exit; then                                                 \
-         echo $(ECHO_N) "$$grn$(ECHO_C)";                              \
-        else                                                           \
-         echo $(ECHO_N) "$$red$(ECHO_C)";                              \
-       fi;                                                             \
-       echo "$$msg" | $(am__text_box);                                 \
-       echo $(ECHO_N) "$$std$(ECHO_C)";                                \
-       $$exit
+       $$success || exit 1
 
-# Run all the tests.
 check-TESTS:
-       @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
+       @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)
-       @list='$(TEST_LOGS)';                                           \
-       list=`for f in $$list; do                                       \
-         test .log = $$f || echo $$f;                                  \
-       done | tr '\012\015' '  '`;                                     \
-       $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$list"
-
-.log.html:
-       @list='$(RST2HTML) $$RST2HTML rst2html rst2html.py';            \
-       for r2h in $$list; do                                           \
-         if ($$r2h --version) >/dev/null 2>&1; then                    \
-           R2H=$$r2h;                                                  \
-         fi;                                                           \
-       done;                                                           \
-       if test -z "$$R2H"; then                                        \
-         echo >&2 "cannot find rst2html, cannot create $@";            \
-         exit 2;                                                       \
-       fi;                                                             \
-       $$R2H $< >$@.tmp
-       @mv $@.tmp $@
-
-# Be sure to run check first, and then to convert the result.
-# Beware of concurrent executions.  Run "check" not "check-TESTS", as
-# check-SCRIPTS and other dependencies are rebuilt by the former only.
-# And expect check to fail.
-check-html:
-       @if $(MAKE) $(AM_MAKEFLAGS) check; then                 \
-         rv=0; else rv=$$?;                                    \
-       fi;                                                     \
-       $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_HTML) || exit 4;   \
-       exit $$rv
-recheck recheck-html:
-       @target=`echo $@ | sed 's,^re,,'`;                              \
-       list='$(TEST_LOGS)';                                            \
-       list=`for f in $$list; do                                       \
-               test -f $$f || continue;                                \
-               if read line < $$f; then                                \
-                 case $$line in FAIL*|XPASS*) echo $$f;; esac;         \
-               else echo $$f; fi;                                      \
-             done | tr '\012\015' '  '`;                               \
-       $(MAKE) $(AM_MAKEFLAGS) $$target AM_MAKEFLAGS='$(AM_MAKEFLAGS) TEST_LOGS="'"$$list"'"'
+       @set +e; $(am__set_TESTS_bases); \
+       log_list=`for i in $$bases; do echo $$i.log; done`; \
+       trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+       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)
+       @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 \
+                | $(am__list_recheck_tests)` || exit 1; \
+       log_list=`for i in $$bases; do echo $$i.log; done`; \
+       log_list=`echo $$log_list`; \
+       $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+               am__force_recheck=am--force-recheck \
+               TEST_LOGS="$$log_list"; \
+       exit $$?
 test-alloca-opt.log: test-alloca-opt$(EXEEXT)
-       @p='test-alloca-opt$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-alloca-opt$(EXEEXT)'; \
+       b='test-alloca-opt'; \
+       $(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-binary-io.sh.log: test-binary-io.sh
-       @p='test-binary-io.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-binary-io.sh'; \
+       b='test-binary-io.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-btowc1.sh.log: test-btowc1.sh
-       @p='test-btowc1.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-btowc1.sh'; \
+       b='test-btowc1.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-btowc2.sh.log: test-btowc2.sh
-       @p='test-btowc2.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-btowc2.sh'; \
+       b='test-btowc2.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-c-ctype.log: test-c-ctype$(EXEEXT)
-       @p='test-c-ctype$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-c-ctype$(EXEEXT)'; \
+       b='test-c-ctype'; \
+       $(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-c-strcase.sh.log: test-c-strcase.sh
-       @p='test-c-strcase.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-c-strcase.sh'; \
+       b='test-c-strcase.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-canonicalize-lgpl.log: test-canonicalize-lgpl$(EXEEXT)
-       @p='test-canonicalize-lgpl$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-canonicalize-lgpl$(EXEEXT)'; \
+       b='test-canonicalize-lgpl'; \
+       $(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-close.log: test-close$(EXEEXT)
+       @p='test-close$(EXEEXT)'; \
+       b='test-close'; \
+       $(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)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-ctype$(EXEEXT)'; \
+       b='test-ctype'; \
+       $(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-dup2.log: test-dup2$(EXEEXT)
-       @p='test-dup2$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-dup2$(EXEEXT)'; \
+       b='test-dup2'; \
+       $(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)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-environ$(EXEEXT)'; \
+       b='test-environ'; \
+       $(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)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-errno$(EXEEXT)'; \
+       b='test-errno'; \
+       $(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-fcntl-h.log: test-fcntl-h$(EXEEXT)
-       @p='test-fcntl-h$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-fcntl-h$(EXEEXT)'; \
+       b='test-fcntl-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-fdopen.log: test-fdopen$(EXEEXT)
+       @p='test-fdopen$(EXEEXT)'; \
+       b='test-fdopen'; \
+       $(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-fgetc.log: test-fgetc$(EXEEXT)
+       @p='test-fgetc$(EXEEXT)'; \
+       b='test-fgetc'; \
+       $(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'; \
+       $(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-fnmatch.log: test-fnmatch$(EXEEXT)
-       @p='test-fnmatch$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-fnmatch$(EXEEXT)'; \
+       b='test-fnmatch'; \
+       $(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-fputc.log: test-fputc$(EXEEXT)
+       @p='test-fputc$(EXEEXT)'; \
+       b='test-fputc'; \
+       $(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-fread.log: test-fread$(EXEEXT)
+       @p='test-fread$(EXEEXT)'; \
+       b='test-fread'; \
+       $(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-fstat.log: test-fstat$(EXEEXT)
+       @p='test-fstat$(EXEEXT)'; \
+       b='test-fstat'; \
+       $(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'; \
+       $(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-getcwd-lgpl.log: test-getcwd-lgpl$(EXEEXT)
+       @p='test-getcwd-lgpl$(EXEEXT)'; \
+       b='test-getcwd-lgpl'; \
+       $(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-getdelim.log: test-getdelim$(EXEEXT)
-       @p='test-getdelim$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-getdelim$(EXEEXT)'; \
+       b='test-getdelim'; \
+       $(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-getline.log: test-getline$(EXEEXT)
-       @p='test-getline$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-getline$(EXEEXT)'; \
+       b='test-getline'; \
+       $(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-getopt.log: test-getopt$(EXEEXT)
-       @p='test-getopt$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-getopt$(EXEEXT)'; \
+       b='test-getopt'; \
+       $(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-gettimeofday.log: test-gettimeofday$(EXEEXT)
+       @p='test-gettimeofday$(EXEEXT)'; \
+       b='test-gettimeofday'; \
+       $(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)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-ignore-value$(EXEEXT)'; \
+       b='test-ignore-value'; \
+       $(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'; \
+       $(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'; \
+       $(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)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-isblank$(EXEEXT)'; \
+       b='test-isblank'; \
+       $(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.log: test-langinfo$(EXEEXT)
-       @p='test-langinfo$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-langinfo$(EXEEXT)'; \
+       b='test-langinfo'; \
+       $(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.log: test-locale$(EXEEXT)
-       @p='test-locale$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-locale$(EXEEXT)'; \
+       b='test-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-localeconv.log: test-localeconv$(EXEEXT)
+       @p='test-localeconv$(EXEEXT)'; \
+       b='test-localeconv'; \
+       $(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-localename.log: test-localename$(EXEEXT)
-       @p='test-localename$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-localename$(EXEEXT)'; \
+       b='test-localename'; \
+       $(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-lock.log: test-lock$(EXEEXT)
-       @p='test-lock$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-lock$(EXEEXT)'; \
+       b='test-lock'; \
+       $(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-lstat.log: test-lstat$(EXEEXT)
-       @p='test-lstat$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-lstat$(EXEEXT)'; \
+       b='test-lstat'; \
+       $(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-malloc-gnu.log: test-malloc-gnu$(EXEEXT)
-       @p='test-malloc-gnu$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @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)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-malloca$(EXEEXT)'; \
+       b='test-malloca'; \
+       $(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-mbrtowc1.sh.log: test-mbrtowc1.sh
-       @p='test-mbrtowc1.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-mbrtowc1.sh'; \
+       b='test-mbrtowc1.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-mbrtowc2.sh.log: test-mbrtowc2.sh
-       @p='test-mbrtowc2.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-mbrtowc2.sh'; \
+       b='test-mbrtowc2.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-mbrtowc3.sh.log: test-mbrtowc3.sh
-       @p='test-mbrtowc3.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-mbrtowc3.sh'; \
+       b='test-mbrtowc3.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-mbrtowc4.sh.log: test-mbrtowc4.sh
-       @p='test-mbrtowc4.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-mbrtowc4.sh'; \
+       b='test-mbrtowc4.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-1.sh.log: test-mbrtowc-w32-1.sh
-       @p='test-mbrtowc-w32-1.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-mbrtowc-w32-1.sh'; \
+       b='test-mbrtowc-w32-1.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-2.sh.log: test-mbrtowc-w32-2.sh
-       @p='test-mbrtowc-w32-2.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-mbrtowc-w32-2.sh'; \
+       b='test-mbrtowc-w32-2.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-3.sh.log: test-mbrtowc-w32-3.sh
-       @p='test-mbrtowc-w32-3.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-mbrtowc-w32-3.sh'; \
+       b='test-mbrtowc-w32-3.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-4.sh.log: test-mbrtowc-w32-4.sh
-       @p='test-mbrtowc-w32-4.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-mbrtowc-w32-4.sh'; \
+       b='test-mbrtowc-w32-4.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-5.sh.log: test-mbrtowc-w32-5.sh
-       @p='test-mbrtowc-w32-5.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-mbrtowc-w32-5.sh'; \
+       b='test-mbrtowc-w32-5.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'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-mbsinit.sh'; \
+       b='test-mbsinit.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-mbsrtowcs1.sh.log: test-mbsrtowcs1.sh
-       @p='test-mbsrtowcs1.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-mbsrtowcs1.sh'; \
+       b='test-mbsrtowcs1.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-mbsrtowcs2.sh.log: test-mbsrtowcs2.sh
-       @p='test-mbsrtowcs2.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-mbsrtowcs2.sh'; \
+       b='test-mbsrtowcs2.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-mbsrtowcs3.sh.log: test-mbsrtowcs3.sh
-       @p='test-mbsrtowcs3.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-mbsrtowcs3.sh'; \
+       b='test-mbsrtowcs3.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-mbsrtowcs4.sh.log: test-mbsrtowcs4.sh
-       @p='test-mbsrtowcs4.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-mbsrtowcs4.sh'; \
+       b='test-mbsrtowcs4.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)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-memchr$(EXEEXT)'; \
+       b='test-memchr'; \
+       $(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'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-nl_langinfo.sh'; \
+       b='test-nl_langinfo.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-open.log: test-open$(EXEEXT)
-       @p='test-open$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-open$(EXEEXT)'; \
+       b='test-open'; \
+       $(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'; \
+       $(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-rawmemchr.log: test-rawmemchr$(EXEEXT)
+       @p='test-rawmemchr$(EXEEXT)'; \
+       b='test-rawmemchr'; \
+       $(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)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-readlink$(EXEEXT)'; \
+       b='test-readlink'; \
+       $(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-safe-alloc.log: test-safe-alloc$(EXEEXT)
-       @p='test-safe-alloc$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-safe-alloc$(EXEEXT)'; \
+       b='test-safe-alloc'; \
+       $(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)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-setenv$(EXEEXT)'; \
+       b='test-setenv'; \
+       $(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'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-setlocale1.sh'; \
+       b='test-setlocale1.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-setlocale2.sh.log: test-setlocale2.sh
-       @p='test-setlocale2.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-setlocale2.sh'; \
+       b='test-setlocale2.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-stat.log: test-stat$(EXEEXT)
-       @p='test-stat$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-stat$(EXEEXT)'; \
+       b='test-stat'; \
+       $(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)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-stdbool$(EXEEXT)'; \
+       b='test-stdbool'; \
+       $(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)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-stddef$(EXEEXT)'; \
+       b='test-stddef'; \
+       $(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)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-stdint$(EXEEXT)'; \
+       b='test-stdint'; \
+       $(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-stdio.log: test-stdio$(EXEEXT)
-       @p='test-stdio$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-stdio$(EXEEXT)'; \
+       b='test-stdio'; \
+       $(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-stdlib.log: test-stdlib$(EXEEXT)
-       @p='test-stdlib$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-stdlib$(EXEEXT)'; \
+       b='test-stdlib'; \
+       $(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-strchrnul.log: test-strchrnul$(EXEEXT)
+       @p='test-strchrnul$(EXEEXT)'; \
+       b='test-strchrnul'; \
+       $(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.log: test-string$(EXEEXT)
-       @p='test-string$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-string$(EXEEXT)'; \
+       b='test-string'; \
+       $(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-strnlen.log: test-strnlen$(EXEEXT)
-       @p='test-strnlen$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-strnlen$(EXEEXT)'; \
+       b='test-strnlen'; \
+       $(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-strstr.log: test-strstr$(EXEEXT)
-       @p='test-strstr$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-strstr$(EXEEXT)'; \
+       b='test-strstr'; \
+       $(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)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-symlink$(EXEEXT)'; \
+       b='test-symlink'; \
+       $(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.log: test-sys_stat$(EXEEXT)
-       @p='test-sys_stat$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-sys_stat$(EXEEXT)'; \
+       b='test-sys_stat'; \
+       $(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_time.log: test-sys_time$(EXEEXT)
+       @p='test-sys_time$(EXEEXT)'; \
+       b='test-sys_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-sys_types.log: test-sys_types$(EXEEXT)
+       @p='test-sys_types$(EXEEXT)'; \
+       b='test-sys_types'; \
+       $(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.log: test-sys_wait$(EXEEXT)
-       @p='test-sys_wait$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-sys_wait$(EXEEXT)'; \
+       b='test-sys_wait'; \
+       $(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-init.sh.log: test-init.sh
+       @p='test-init.sh'; \
+       b='test-init.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-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.log: test-time$(EXEEXT)
-       @p='test-time$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-time$(EXEEXT)'; \
+       b='test-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-unistd.log: test-unistd$(EXEEXT)
-       @p='test-unistd$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-unistd$(EXEEXT)'; \
+       b='test-unistd'; \
+       $(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)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-unsetenv$(EXEEXT)'; \
+       b='test-unsetenv'; \
+       $(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-vasnprintf.log: test-vasnprintf$(EXEEXT)
-       @p='test-vasnprintf$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-vasnprintf$(EXEEXT)'; \
+       b='test-vasnprintf'; \
+       $(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-vasprintf.log: test-vasprintf$(EXEEXT)
-       @p='test-vasprintf$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-vasprintf$(EXEEXT)'; \
+       b='test-vasprintf'; \
+       $(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-verify.log: test-verify$(EXEEXT)
-       @p='test-verify$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-verify$(EXEEXT)'; \
+       b='test-verify'; \
+       $(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-verify.sh.log: test-verify.sh
-       @p='test-verify.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-verify.sh'; \
+       b='test-verify.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-wchar.log: test-wchar$(EXEEXT)
-       @p='test-wchar$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-wchar$(EXEEXT)'; \
+       b='test-wchar'; \
+       $(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.sh.log: test-wcrtomb.sh
-       @p='test-wcrtomb.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-wcrtomb.sh'; \
+       b='test-wcrtomb.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-1.sh.log: test-wcrtomb-w32-1.sh
-       @p='test-wcrtomb-w32-1.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-wcrtomb-w32-1.sh'; \
+       b='test-wcrtomb-w32-1.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-2.sh.log: test-wcrtomb-w32-2.sh
-       @p='test-wcrtomb-w32-2.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-wcrtomb-w32-2.sh'; \
+       b='test-wcrtomb-w32-2.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-3.sh.log: test-wcrtomb-w32-3.sh
-       @p='test-wcrtomb-w32-3.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-wcrtomb-w32-3.sh'; \
+       b='test-wcrtomb-w32-3.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-4.sh.log: test-wcrtomb-w32-4.sh
-       @p='test-wcrtomb-w32-4.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-wcrtomb-w32-4.sh'; \
+       b='test-wcrtomb-w32-4.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-5.sh.log: test-wcrtomb-w32-5.sh
-       @p='test-wcrtomb-w32-5.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-wcrtomb-w32-5.sh'; \
+       b='test-wcrtomb-w32-5.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.log: test-wctype-h$(EXEEXT)
-       @p='test-wctype-h$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-wctype-h$(EXEEXT)'; \
+       b='test-wctype-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.log:
-       @p='$<'; $(am__check_pre) $(TEST_LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='$<'; \
+       $(am__set_b); \
+       $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 @am__EXEEXT_TRUE@.test$(EXEEXT).log:
-@am__EXEEXT_TRUE@      @p='$<'; $(am__check_pre) $(TEST_LOG_COMPILE) "$$tst" $(am__check_post)
+@am__EXEEXT_TRUE@      @p='$<'; \
+@am__EXEEXT_TRUE@      $(am__set_b); \
+@am__EXEEXT_TRUE@      $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@      --log-file $$b.log --trs-file $$b.trs \
+@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)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -2430,13 +3539,10 @@ distdir: $(DISTFILES)
        done
        @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
          if test "$$subdir" = .; then :; else \
-           test -d "$(distdir)/$$subdir" \
-           || $(MKDIR_P) "$(distdir)/$$subdir" \
-           || exit 1; \
-         fi; \
-       done
-       @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-         if test "$$subdir" = .; then :; else \
+           $(am__make_dryrun) \
+             || test -d "$(distdir)/$$subdir" \
+             || $(MKDIR_P) "$(distdir)/$$subdir" \
+             || exit 1; \
            dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
            $(am__relativize); \
            new_distdir=$$reldir; \
@@ -2475,15 +3581,19 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
 mostlyclean-generic:
        -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
        -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
-       -test -z "$(TEST_LOGS_TMP)" || rm -f $(TEST_LOGS_TMP)
-       -test -z "$(TEST_SUITE_HTML)" || rm -f $(TEST_SUITE_HTML)
+       -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
        -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
 
 clean-generic:
@@ -2573,83 +3683,93 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \
-       check-am check-html ctags-recursive install install-am \
-       install-strip recheck recheck-html tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-       all all-am check check-TESTS check-am check-html clean \
-       clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \
-       clean-libtool clean-local clean-noinstLIBRARIES \
-       clean-noinstPROGRAMS ctags ctags-recursive distclean \
-       distclean-compile distclean-generic distclean-libtool \
-       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-libtool mostlyclean-local pdf pdf-am ps ps-am \
-       recheck recheck-html tags tags-recursive uninstall \
-       uninstall-am
-
-# The arg-nonnull.h that gets inserted into generated .h files is the same as
-# build-aux/arg-nonnull.h, except that it has the copyright header cut off.
-arg-nonnull.h: $(top_srcdir)/build/aux/arg-nonnull.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/GL_ARG_NONNULL/,$$p' \
-         < $(top_srcdir)/build/aux/arg-nonnull.h \
-         > $@-t && \
-       mv $@-t $@
-# The c++defs.h that gets inserted into generated .h files is the same as
-# build-aux/c++defs.h, except that it has the copyright header cut off.
-c++defs.h: $(top_srcdir)/build/aux/c++defs.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/_GL_CXXDEFS/,$$p' \
-         < $(top_srcdir)/build/aux/c++defs.h \
-         > $@-t && \
-       mv $@-t $@
-
-# We need the following in order to create <fcntl.h> when the system
+.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-libtool clean-local \
+       clean-noinstLIBRARIES clean-noinstPROGRAMS cscopelist-am ctags \
+       ctags-am distclean distclean-compile distclean-generic \
+       distclean-libtool 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-libtool mostlyclean-local pdf \
+       pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am
+
+
+# We need the following in order to create <inttypes.h> when the system
 # doesn't have one that works with the given compiler.
-fcntl.h: fcntl.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+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|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         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_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
-             -e 's|@''GNULIB_FCNTL''@|$(GNULIB_FCNTL)|g' \
-             -e 's|@''GNULIB_OPEN''@|$(GNULIB_OPEN)|g' \
-             -e 's|@''GNULIB_OPENAT''@|$(GNULIB_OPENAT)|g' \
-             -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
-             -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
-             -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \
-             -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
-             -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|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/@''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)/fcntl.in.h; \
+             < $(srcdir)/inttypes.in.h; \
        } > $@-t && \
        mv $@-t $@
-# The unused-parameter.h that gets inserted into generated .h files is the same
-# as build-aux/unused-parameter.h, except that it has the copyright header cut
+# 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.
-unused-parameter.h: $(top_srcdir)/build/aux/unused-parameter.h
+arg-nonnull.h: $(top_srcdir)/build/ac-aux/snippet/arg-nonnull.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/GL_ARG_NONNULL/,$$p' \
+         < $(top_srcdir)/build/ac-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/ac-aux/snippet/c++defs.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/_GL_CXXDEFS/,$$p' \
+         < $(top_srcdir)/build/ac-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/ac-aux/snippet/unused-parameter.h
        $(AM_V_GEN)rm -f $@-t $@ && \
        sed -n -e '/GL_UNUSED_PARAMETER/,$$p' \
-         < $(top_srcdir)/build/aux/unused-parameter.h \
+         < $(top_srcdir)/build/ac-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/warn-on-use.h, except that it has the copyright header cut off.
-warn-on-use.h: $(top_srcdir)/build/aux/warn-on-use.h
+# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
+# off.
+warn-on-use.h: $(top_srcdir)/build/ac-aux/snippet/warn-on-use.h
        $(AM_V_GEN)rm -f $@-t $@ && \
        sed -n -e '/^.ifndef/,$$p' \
-         < $(top_srcdir)/build/aux/warn-on-use.h \
+         < $(top_srcdir)/build/ac-aux/snippet/warn-on-use.h \
          > $@-t && \
        mv $@-t $@
 
index c09dbf5..a33e32a 100644 (file)
@@ -1,5 +1,5 @@
 /* Binary mode I/O.
-   Copyright (C) 2001, 2003, 2005, 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2003, 2005, 2008-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    so we include it here first.  */
 #include <stdio.h>
 
-/* SET_BINARY (fd);
-   changes the file descriptor fd to perform binary I/O.  */
+/* 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
 # else
-#  define setmode _setmode
+#  define set_binary_mode _setmode
 #  undef fileno
 #  define fileno _fileno
 # endif
-# ifdef __DJGPP__
-#  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) ? (setmode (fd, O_BINARY), 0) : 0))
-# else
-#  define SET_BINARY(fd) ((void) setmode (fd, O_BINARY))
-# endif
 #else
-  /* On reasonable systems, binary I/O is the default.  */
-# define SET_BINARY(fd) /* do nothing */ ((void) 0)
+  /* On reasonable systems, binary I/O is the only choice.  */
+  /* Use an inline function rather than a macro, to avoid gcc warnings
+     "warning: statement with no effect".  */
+static inline int
+set_binary_mode (int fd, int mode)
+{
+  (void) fd;
+  (void) mode;
+  return O_BINARY;
+}
+#endif
+
+/* SET_BINARY (fd);
+   changes the file descriptor fd to perform binary I/O.  */
+#ifdef __DJGPP__
+# 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))
+#else
+# define SET_BINARY(fd) ((void) set_binary_mode (fd, O_BINARY))
 #endif
 
 #endif /* _BINARY_H */
index 0fb4295..952d7a8 100644 (file)
@@ -1,6 +1,6 @@
 /* Character handling in C locale.
 
-   Copyright 2000-2003, 2006, 2009-2011 Free Software Foundation, Inc.
+   Copyright 2000-2003, 2006, 2009-2012 Free Software Foundation, Inc.
 
 This 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,8 +13,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, write to the Free Software Foundation,
-Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 57e71ee..0b31309 100644 (file)
@@ -5,7 +5,7 @@
    <ctype.h> functions' behaviour depends on the current locale set via
    setlocale.
 
-   Copyright (C) 2000-2003, 2006, 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2000-2003, 2006, 2008-2012 Free Software Foundation, Inc.
 
 This 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,8 +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, write to the Free Software Foundation,
-Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef C_CTYPE_H
 #define C_CTYPE_H
@@ -118,23 +117,23 @@ extern "C" {
          if (c_isalpha (*s)) ...
  */
 
-extern bool c_isascii (int c); /* not locale dependent */
-
-extern bool c_isalnum (int c);
-extern bool c_isalpha (int c);
-extern bool c_isblank (int c);
-extern bool c_iscntrl (int c);
-extern bool c_isdigit (int c);
-extern bool c_islower (int c);
-extern bool c_isgraph (int c);
-extern bool c_isprint (int c);
-extern bool c_ispunct (int c);
-extern bool c_isspace (int c);
-extern bool c_isupper (int c);
-extern bool c_isxdigit (int c);
-
-extern int c_tolower (int c);
-extern int c_toupper (int c);
+extern bool c_isascii (int c) _GL_ATTRIBUTE_CONST; /* not locale dependent */
+
+extern bool c_isalnum (int c) _GL_ATTRIBUTE_CONST;
+extern bool c_isalpha (int c) _GL_ATTRIBUTE_CONST;
+extern bool c_isblank (int c) _GL_ATTRIBUTE_CONST;
+extern bool c_iscntrl (int c) _GL_ATTRIBUTE_CONST;
+extern bool c_isdigit (int c) _GL_ATTRIBUTE_CONST;
+extern bool c_islower (int c) _GL_ATTRIBUTE_CONST;
+extern bool c_isgraph (int c) _GL_ATTRIBUTE_CONST;
+extern bool c_isprint (int c) _GL_ATTRIBUTE_CONST;
+extern bool c_ispunct (int c) _GL_ATTRIBUTE_CONST;
+extern bool c_isspace (int c) _GL_ATTRIBUTE_CONST;
+extern bool c_isupper (int c) _GL_ATTRIBUTE_CONST;
+extern bool c_isxdigit (int c) _GL_ATTRIBUTE_CONST;
+
+extern int c_tolower (int c) _GL_ATTRIBUTE_CONST;
+extern int c_toupper (int c) _GL_ATTRIBUTE_CONST;
 
 
 #if defined __GNUC__ && defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ && !defined NO_C_CTYPE_MACROS
index 4148c34..fdef238 100644 (file)
@@ -1,5 +1,5 @@
 /* Case-insensitive string comparison functions in C locale.
-   Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2011 Free Software
+   Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2012 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -13,8 +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, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef C_STRCASE_H
 #define C_STRCASE_H
@@ -40,12 +39,13 @@ extern "C" {
 /* Compare strings S1 and S2, ignoring case, returning less than, equal to or
    greater than zero if S1 is lexicographically less than, equal to or greater
    than S2.  */
-extern int c_strcasecmp (const char *s1, const char *s2);
+extern int c_strcasecmp (const char *s1, const char *s2) _GL_ATTRIBUTE_PURE;
 
 /* Compare no more than N characters of strings S1 and S2, ignoring case,
    returning less than, equal to or greater than zero if S1 is
    lexicographically less than, equal to or greater than S2.  */
-extern int c_strncasecmp (const char *s1, const char *s2, size_t n);
+extern int c_strncasecmp (const char *s1, const char *s2, size_t n)
+  _GL_ATTRIBUTE_PURE;
 
 
 #ifdef __cplusplus
index 4c4e106..d8332ca 100644 (file)
@@ -1,5 +1,5 @@
 /* c-strcasecmp.c -- case insensitive string comparator in C locale
-   Copyright (C) 1998-1999, 2005-2006, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-2006, 2009-2012 Free Software Foundation, Inc.
 
    This 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,8 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 0c433b9..47fb5fd 100644 (file)
@@ -1,5 +1,5 @@
 /* c-strncasecmp.c -- case insensitive string comparator in C locale
-   Copyright (C) 1998-1999, 2005-2006, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-2006, 2009-2012 Free Software Foundation, Inc.
 
    This 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,8 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
diff --git a/gnulib/tests/close.c b/gnulib/tests/close.c
new file mode 100644 (file)
index 0000000..4b7accb
--- /dev/null
@@ -0,0 +1,69 @@
+/* close replacement.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <unistd.h>
+
+#include <errno.h>
+
+#include "fd-hook.h"
+#include "msvc-inval.h"
+
+#undef close
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static int
+close_nothrow (int fd)
+{
+  int result;
+
+  TRY_MSVC_INVAL
+    {
+      result = close (fd);
+    }
+  CATCH_MSVC_INVAL
+    {
+      result = -1;
+      errno = EBADF;
+    }
+  DONE_MSVC_INVAL;
+
+  return result;
+}
+#else
+# define close_nothrow close
+#endif
+
+/* Override close() to call into other gnulib modules.  */
+
+int
+rpl_close (int fd)
+{
+#if WINDOWS_SOCKETS
+  int retval = execute_all_close_hooks (close_nothrow, fd);
+#else
+  int retval = close_nothrow (fd);
+#endif
+
+#if REPLACE_FCHDIR
+  if (retval >= 0)
+    _gl_unregister_fd (fd);
+#endif
+
+  return retval;
+}
index e00dc7b..f6d0f1c 100644 (file)
@@ -1,6 +1,6 @@
 /* Duplicate an open file descriptor to a specified file descriptor.
 
-   Copyright (C) 1999, 2004-2007, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2004-2007, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #include <errno.h>
 #include <fcntl.h>
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-/* Get declarations of the Win32 API functions.  */
-# define WIN32_LEAN_AND_MEAN
-# include <windows.h>
-#endif
-
 #if HAVE_DUP2
 
 # undef dup2
 
-int
-rpl_dup2 (int fd, int desired_fd)
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
+/* Get declarations of the native Windows API functions.  */
+#  define WIN32_LEAN_AND_MEAN
+#  include <windows.h>
+
+#  include "msvc-inval.h"
+
+/* Get _get_osfhandle.  */
+#  include "msvc-nothrow.h"
+
+static int
+ms_windows_dup2 (int fd, int desired_fd)
 {
   int result;
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
   /* If fd is closed, mingw hangs on dup2 (fd, fd).  If fd is open,
      dup2 (fd, fd) returns 0, but all further attempts to use fd in
      future dup2 calls will hang.  */
@@ -52,6 +57,7 @@ rpl_dup2 (int fd, int desired_fd)
         }
       return fd;
     }
+
   /* Wine 1.0.1 return 0 when desired_fd is negative but not -1:
      http://bugs.winehq.org/show_bug.cgi?id=21289 */
   if (desired_fd < 0)
@@ -59,26 +65,45 @@ rpl_dup2 (int fd, int desired_fd)
       errno = EBADF;
       return -1;
     }
-# elif !defined __linux__
-  /* On Haiku, dup2 (fd, fd) mistakenly clears FD_CLOEXEC.  */
-  if (fd == desired_fd)
-    return fcntl (fd, F_GETFL) == -1 ? -1 : fd;
-# endif
-  result = dup2 (fd, desired_fd);
-# ifdef __linux__
-  /* Correct a Linux return value.
-     <http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.30.y.git;a=commitdiff;h=2b79bc4f7ebbd5af3c8b867968f9f15602d5f802>
-   */
-  if (fd == desired_fd && result == (unsigned int) -EBADF)
+
+  TRY_MSVC_INVAL
+    {
+      result = dup2 (fd, desired_fd);
+    }
+  CATCH_MSVC_INVAL
     {
       errno = EBADF;
       result = -1;
     }
-# endif
+  DONE_MSVC_INVAL;
+
   if (result == 0)
     result = desired_fd;
-  /* Correct a cygwin 1.5.x errno value.  */
-  else if (result == -1 && errno == EMFILE)
+
+  return result;
+}
+
+#  define dup2 ms_windows_dup2
+
+# endif
+
+int
+rpl_dup2 (int fd, int desired_fd)
+{
+  int result;
+
+# 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 Haiku, dup2 (fd, fd) mistakenly clears FD_CLOEXEC.  */
+  if (fd == desired_fd)
+    return fcntl (fd, F_GETFL) == -1 ? -1 : fd;
+# 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 (fd != desired_fd && result != -1)
diff --git a/gnulib/tests/fd-hook.c b/gnulib/tests/fd-hook.c
new file mode 100644 (file)
index 0000000..8f4ffe2
--- /dev/null
@@ -0,0 +1,116 @@
+/* Hook for making making file descriptor functions close(), ioctl() extensible.
+   Copyright (C) 2009-2012 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
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "fd-hook.h"
+
+#include <stdlib.h>
+
+/* Currently, this entire code is only needed for the handling of sockets
+   on native Windows platforms.  */
+#if WINDOWS_SOCKETS
+
+/* The first and last link in the doubly linked list.
+   Initially the list is empty.  */
+static struct fd_hook anchor = { &anchor, &anchor, NULL, NULL };
+
+int
+execute_close_hooks (const struct fd_hook *remaining_list, gl_close_fn primary,
+                     int fd)
+{
+  if (remaining_list == &anchor)
+    /* End of list reached.  */
+    return primary (fd);
+  else
+    return remaining_list->private_close_fn (remaining_list->private_next,
+                                             primary, fd);
+}
+
+int
+execute_all_close_hooks (gl_close_fn primary, int fd)
+{
+  return execute_close_hooks (anchor.private_next, primary, fd);
+}
+
+int
+execute_ioctl_hooks (const struct fd_hook *remaining_list, gl_ioctl_fn primary,
+                     int fd, int request, void *arg)
+{
+  if (remaining_list == &anchor)
+    /* End of list reached.  */
+    return primary (fd, request, arg);
+  else
+    return remaining_list->private_ioctl_fn (remaining_list->private_next,
+                                             primary, fd, request, arg);
+}
+
+int
+execute_all_ioctl_hooks (gl_ioctl_fn primary,
+                         int fd, int request, void *arg)
+{
+  return execute_ioctl_hooks (anchor.private_next, primary, fd, request, arg);
+}
+
+void
+register_fd_hook (close_hook_fn close_hook, ioctl_hook_fn ioctl_hook, struct fd_hook *link)
+{
+  if (close_hook == NULL)
+    close_hook = execute_close_hooks;
+  if (ioctl_hook == NULL)
+    ioctl_hook = execute_ioctl_hooks;
+
+  if (link->private_next == NULL && link->private_prev == NULL)
+    {
+      /* Add the link to the doubly linked list.  */
+      link->private_next = anchor.private_next;
+      link->private_prev = &anchor;
+      link->private_close_fn = close_hook;
+      link->private_ioctl_fn = ioctl_hook;
+      anchor.private_next->private_prev = link;
+      anchor.private_next = link;
+    }
+  else
+    {
+      /* The link is already in use.  */
+      if (link->private_close_fn != close_hook
+          || link->private_ioctl_fn != ioctl_hook)
+        abort ();
+    }
+}
+
+void
+unregister_fd_hook (struct fd_hook *link)
+{
+  struct fd_hook *next = link->private_next;
+  struct fd_hook *prev = link->private_prev;
+
+  if (next != NULL && prev != NULL)
+    {
+      /* The link is in use.  Remove it from the doubly linked list.  */
+      prev->private_next = next;
+      next->private_prev = prev;
+      /* Clear the link, to mark it unused.  */
+      link->private_next = NULL;
+      link->private_prev = NULL;
+      link->private_close_fn = NULL;
+      link->private_ioctl_fn = NULL;
+    }
+}
+
+#endif
diff --git a/gnulib/tests/fd-hook.h b/gnulib/tests/fd-hook.h
new file mode 100644 (file)
index 0000000..721e9ad
--- /dev/null
@@ -0,0 +1,119 @@
+/* Hook for making making file descriptor functions close(), ioctl() extensible.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   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 FD_HOOK_H
+#define FD_HOOK_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Currently, this entire code is only needed for the handling of sockets
+   on native Windows platforms.  */
+#if WINDOWS_SOCKETS
+
+
+/* Type of function that closes FD.  */
+typedef int (*gl_close_fn) (int fd);
+
+/* Type of function that applies a control request to FD.  */
+typedef int (*gl_ioctl_fn) (int fd, int request, void *arg);
+
+/* An element of the list of file descriptor hooks.
+   In CLOS (Common Lisp Object System) speak, it consists of an "around"
+   method for the close() function and an "around" method for the ioctl()
+   function.
+   The fields of this structure are considered private.  */
+struct fd_hook
+{
+  /* Doubly linked list.  */
+  struct fd_hook *private_next;
+  struct fd_hook *private_prev;
+  /* Function that treats the types of FD that it knows about and calls
+     execute_close_hooks (REMAINING_LIST, PRIMARY, FD) as a fallback.  */
+  int (*private_close_fn) (const struct fd_hook *remaining_list,
+                           gl_close_fn primary,
+                           int fd);
+  /* Function that treats the types of FD that it knows about and calls
+     execute_ioctl_hooks (REMAINING_LIST, PRIMARY, FD, REQUEST, ARG) as a
+     fallback.  */
+  int (*private_ioctl_fn) (const struct fd_hook *remaining_list,
+                           gl_ioctl_fn primary,
+                           int fd, int request, void *arg);
+};
+
+/* This type of function closes FD, applying special knowledge for the FD
+   types it knows about, and calls
+   execute_close_hooks (REMAINING_LIST, PRIMARY, FD)
+   for the other FD types.
+   In CLOS speak, REMAINING_LIST is the remaining list of "around" methods,
+   and PRIMARY is the "primary" method for close().  */
+typedef int (*close_hook_fn) (const struct fd_hook *remaining_list,
+                              gl_close_fn primary,
+                              int fd);
+
+/* Execute the close hooks in REMAINING_LIST, with PRIMARY as "primary" method.
+   Return 0 or -1, like close() would do.  */
+extern int execute_close_hooks (const struct fd_hook *remaining_list,
+                                gl_close_fn primary,
+                                int fd);
+
+/* Execute all close hooks, with PRIMARY as "primary" method.
+   Return 0 or -1, like close() would do.  */
+extern int execute_all_close_hooks (gl_close_fn primary, int fd);
+
+/* This type of function applies a control request to FD, applying special
+   knowledge for the FD types it knows about, and calls
+   execute_ioctl_hooks (REMAINING_LIST, PRIMARY, FD, REQUEST, ARG)
+   for the other FD types.
+   In CLOS speak, REMAINING_LIST is the remaining list of "around" methods,
+   and PRIMARY is the "primary" method for ioctl().  */
+typedef int (*ioctl_hook_fn) (const struct fd_hook *remaining_list,
+                              gl_ioctl_fn primary,
+                              int fd, int request, void *arg);
+
+/* Execute the ioctl hooks in REMAINING_LIST, with PRIMARY as "primary" method.
+   Return 0 or -1, like ioctl() would do.  */
+extern int execute_ioctl_hooks (const struct fd_hook *remaining_list,
+                                gl_ioctl_fn primary,
+                                int fd, int request, void *arg);
+
+/* Execute all ioctl hooks, with PRIMARY as "primary" method.
+   Return 0 or -1, like ioctl() would do.  */
+extern int execute_all_ioctl_hooks (gl_ioctl_fn primary,
+                                    int fd, int request, void *arg);
+
+/* Add a function pair to the list of file descriptor hooks.
+   CLOSE_HOOK and IOCTL_HOOK may be NULL, indicating no change.
+   The LINK variable points to a piece of memory which is guaranteed to be
+   accessible until the corresponding call to unregister_fd_hook.  */
+extern void register_fd_hook (close_hook_fn close_hook, ioctl_hook_fn ioctl_hook,
+                              struct fd_hook *link);
+
+/* Removes a hook from the list of file descriptor hooks.  */
+extern void unregister_fd_hook (struct fd_hook *link);
+
+
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* FD_HOOK_H */
diff --git a/gnulib/tests/fdopen.c b/gnulib/tests/fdopen.c
new file mode 100644 (file)
index 0000000..6595b16
--- /dev/null
@@ -0,0 +1,69 @@
+/* Open a stream with a given file descriptor.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <stdio.h>
+
+#include <errno.h>
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+#endif
+
+#undef fdopen
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static FILE *
+fdopen_nothrow (int fd, const char *mode)
+{
+  FILE *result;
+
+  TRY_MSVC_INVAL
+    {
+      result = fdopen (fd, mode);
+    }
+  CATCH_MSVC_INVAL
+    {
+      result = NULL;
+    }
+  DONE_MSVC_INVAL;
+
+  return result;
+}
+#else
+# define fdopen_nothrow fdopen
+#endif
+
+FILE *
+rpl_fdopen (int fd, const char *mode)
+{
+  int saved_errno = errno;
+  FILE *fp;
+
+  errno = 0;
+  fp = fdopen_nothrow (fd, mode);
+  if (fp == NULL)
+    {
+      if (errno == 0)
+        errno = EBADF;
+    }
+  else
+    errno = saved_errno;
+
+  return fp;
+}
diff --git a/gnulib/tests/fpucw.h b/gnulib/tests/fpucw.h
new file mode 100644 (file)
index 0000000..23e4c81
--- /dev/null
@@ -0,0 +1,108 @@
+/* Manipulating the FPU control word.
+   Copyright (C) 2007-2012 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 <http://www.gnu.org/licenses/>.  */
+
+#ifndef _FPUCW_H
+#define _FPUCW_H
+
+/* The i386 floating point hardware (the 387 compatible FPU, not the modern
+   SSE/SSE2 hardware) has a controllable rounding precision.  It is specified
+   through the 'PC' bits in the FPU control word ('fctrl' register).  (See
+   the GNU libc i386 <fpu_control.h> header for details.)
+
+   On some platforms, such as Linux or Solaris, the default precision setting
+   is set to "extended precision".  This means that 'long double' instructions
+   operate correctly, but 'double' computations often produce slightly
+   different results as on strictly IEEE 754 conforming systems.
+
+   On some platforms, such as NetBSD, the default precision is set to
+   "double precision".  This means that 'long double' instructions will operate
+   only as 'double', i.e. lead to wrong results.  Similarly on FreeBSD 6.4, at
+   least for the division of 'long double' numbers.
+
+   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
+   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
+   for a good explanation.
+   See http://www.uwsg.iu.edu/hypermail/linux/kernel/0103.0/0453.html for
+   some argumentation which setting should be the default.  */
+
+/* This header file provides the following facilities:
+     fpucw_t                        integral type holding the value of 'fctrl'
+     FPU_PC_MASK                    bit mask denoting the precision control
+     FPU_PC_DOUBLE                  precision control for 53 bits mantissa
+     FPU_PC_EXTENDED                precision control for 64 bits mantissa
+     GET_FPUCW ()                   yields the current FPU control word
+     SET_FPUCW (word)               sets the FPU control word
+     DECL_LONG_DOUBLE_ROUNDING      variable declaration for
+                                    BEGIN/END_LONG_DOUBLE_ROUNDING
+     BEGIN_LONG_DOUBLE_ROUNDING ()  starts a sequence of instructions with
+                                    'long double' safe operation precision
+     END_LONG_DOUBLE_ROUNDING ()    ends a sequence of instructions with
+                                    'long double' safe operation precision
+ */
+
+/* Inline assembler like this works only with GNU C.  */
+#if (defined __i386__ || defined __x86_64__) && defined __GNUC__
+
+typedef unsigned short fpucw_t; /* glibc calls this fpu_control_t */
+
+# define FPU_PC_MASK 0x0300
+# define FPU_PC_DOUBLE 0x200    /* glibc calls this _FPU_DOUBLE */
+# define FPU_PC_EXTENDED 0x300  /* glibc calls this _FPU_EXTENDED */
+
+# define GET_FPUCW() \
+  ({ fpucw_t _cw;                                               \
+     __asm__ __volatile__ ("fnstcw %0" : "=m" (*&_cw));         \
+     _cw;                                                       \
+   })
+# define SET_FPUCW(word) \
+  (void)({ fpucw_t _ncw = (word);                               \
+           __asm__ __volatile__ ("fldcw %0" : : "m" (*&_ncw));  \
+         })
+
+# define DECL_LONG_DOUBLE_ROUNDING \
+  fpucw_t oldcw;
+# define BEGIN_LONG_DOUBLE_ROUNDING() \
+  (void)(oldcw = GET_FPUCW (),                                  \
+         SET_FPUCW ((oldcw & ~FPU_PC_MASK) | FPU_PC_EXTENDED))
+# define END_LONG_DOUBLE_ROUNDING() \
+  SET_FPUCW (oldcw)
+
+#else
+
+typedef unsigned int fpucw_t;
+
+# define FPU_PC_MASK 0
+# define FPU_PC_DOUBLE 0
+# define FPU_PC_EXTENDED 0
+
+# define GET_FPUCW() 0
+# define SET_FPUCW(word) (void)(word)
+
+# define DECL_LONG_DOUBLE_ROUNDING
+# define BEGIN_LONG_DOUBLE_ROUNDING()
+# define END_LONG_DOUBLE_ROUNDING()
+
+#endif
+
+#endif /* _FPUCW_H */
diff --git a/gnulib/tests/fstat.c b/gnulib/tests/fstat.c
new file mode 100644 (file)
index 0000000..6d5f5c2
--- /dev/null
@@ -0,0 +1,88 @@
+/* fstat() replacement.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://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
+   rpl_fstat.  */
+#define __need_system_sys_stat_h
+#include <config.h>
+
+/* 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
+
+static inline int
+orig_fstat (int fd, struct stat *buf)
+{
+  return fstat (fd, buf);
+}
+
+/* Specification.  */
+/* 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"
+#endif
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static inline int
+fstat_nothrow (int fd, struct stat *buf)
+{
+  int result;
+
+  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
+#endif
+
+int
+rpl_fstat (int fd, struct stat *buf)
+{
+#if REPLACE_FCHDIR && REPLACE_OPEN_DIRECTORY
+  /* Handle the case when rpl_open() used a dummy file descriptor to work
+     around an open() that can't normally visit directories.  */
+  const char *name = _gl_directory_name (fd);
+  if (name != NULL)
+    return stat (name, buf);
+#endif
+
+  return fstat_nothrow (fd, buf);
+}
diff --git a/gnulib/tests/getcwd-lgpl.c b/gnulib/tests/getcwd-lgpl.c
new file mode 100644 (file)
index 0000000..f1e821b
--- /dev/null
@@ -0,0 +1,125 @@
+/* Copyright (C) 2011-2012 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 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification */
+#include <unistd.h>
+
+#include <errno.h>
+#include <string.h>
+
+#if GNULIB_GETCWD
+/* Favor GPL getcwd.c if both getcwd and getcwd-lgpl modules are in use.  */
+typedef int dummy;
+#else
+
+/* Get the name of the current working directory, and put it in SIZE
+   bytes of BUF.  Returns NULL if the directory couldn't be determined
+   (perhaps because the absolute name was longer than PATH_MAX, or
+   because of missing read/search permissions on parent directories)
+   or SIZE was too small.  If successful, returns BUF.  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.  */
+
+# undef getcwd
+char *
+rpl_getcwd (char *buf, size_t size)
+{
+  char *ptr;
+  char *result;
+
+  /* Handle single size operations.  */
+  if (buf)
+    {
+      if (!size)
+        {
+          errno = EINVAL;
+          return NULL;
+        }
+      return getcwd (buf, size);
+    }
+
+  if (size)
+    {
+      buf = malloc (size);
+      if (!buf)
+        {
+          errno = ENOMEM;
+          return NULL;
+        }
+      result = getcwd (buf, size);
+      if (!result)
+        {
+          int saved_errno = errno;
+          free (buf);
+          errno = saved_errno;
+        }
+      return result;
+    }
+
+  /* Flexible sizing requested.  Avoid over-allocation for the common
+     case of a name that fits within a 4k page, minus some space for
+     local variables, to be sure we don't skip over a guard page.  */
+  {
+    char tmp[4032];
+    size = sizeof tmp;
+    ptr = getcwd (tmp, size);
+    if (ptr)
+      {
+        result = strdup (ptr);
+        if (!result)
+          errno = ENOMEM;
+        return result;
+      }
+    if (errno != ERANGE)
+      return NULL;
+  }
+
+  /* My what a large directory name we have.  */
+  do
+    {
+      size <<= 1;
+      ptr = realloc (buf, size);
+      if (ptr == NULL)
+        {
+          free (buf);
+          errno = ENOMEM;
+          return NULL;
+        }
+      buf = ptr;
+      result = getcwd (buf, size);
+    }
+  while (!result && errno == ERANGE);
+
+  if (!result)
+    {
+      int saved_errno = errno;
+      free (buf);
+      errno = saved_errno;
+    }
+  else
+    {
+      /* Trim to fit, if possible.  */
+      result = realloc (buf, strlen (buf) + 1);
+      if (!result)
+        result = buf;
+    }
+  return result;
+}
+
+#endif
index d7c1ba8..02c00fb 100644 (file)
@@ -1,6 +1,6 @@
 /* getpagesize emulation for systems where it cannot be done in a C macro.
 
-   Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@
 /* Specification. */
 #include <unistd.h>
 
-/* This implementation is only for native Win32 systems.  */
+/* This implementation is only for native Windows systems.  */
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 
 # define WIN32_LEAN_AND_MEAN
index 64dbd3f..9a391ea 100644 (file)
@@ -1,5 +1,5 @@
 /* Locking in multithreaded situations.
-   Copyright (C) 2005-2011 Free Software Foundation, Inc.
+   Copyright (C) 2005-2012 Free Software Foundation, Inc.
 
    This 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,8 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://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,
@@ -630,7 +629,7 @@ glthread_once_singlethreaded (gl_once_t *once_control)
 
 /* ========================================================================= */
 
-#if USE_WIN32_THREADS
+#if USE_WINDOWS_THREADS
 
 /* -------------------------- gl_lock_t datatype -------------------------- */
 
index 6267500..6782d49 100644 (file)
@@ -1,5 +1,5 @@
 /* Locking in multithreaded situations.
-   Copyright (C) 2005-2011 Free Software Foundation, Inc.
+   Copyright (C) 2005-2012 Free Software Foundation, Inc.
 
    This 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,8 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://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,
@@ -614,16 +613,17 @@ extern int glthread_once_singlethreaded (gl_once_t *once_control);
 
 /* ========================================================================= */
 
-#if USE_WIN32_THREADS
+#if USE_WINDOWS_THREADS
 
+# define WIN32_LEAN_AND_MEAN  /* avoid including junk */
 # include <windows.h>
 
 # ifdef __cplusplus
 extern "C" {
 # endif
 
-/* We can use CRITICAL_SECTION directly, rather than the Win32 Event, Mutex,
-   Semaphore types, because
+/* We can use CRITICAL_SECTION directly, rather than the native Windows Event,
+   Mutex, Semaphore types, because
      - we need only to synchronize inside a single process (address space),
        not inter-process locking,
      - we don't need to support trylock operations.  (TryEnterCriticalSection
@@ -709,9 +709,9 @@ extern int glthread_rwlock_destroy_func (gl_rwlock_t *lock);
 
 /* --------------------- gl_recursive_lock_t datatype --------------------- */
 
-/* The Win32 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.  */
+/* 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
         {
@@ -763,7 +763,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_WIN32_THREADS)
+#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WINDOWS_THREADS)
 
 /* Provide dummy implementation if threads are not supported.  */
 
index bb40092..d55b4e2 100644 (file)
@@ -1,5 +1,5 @@
 /* Creating and controlling threads.
-   Copyright (C) 2005-2011 Free Software Foundation, Inc.
+   Copyright (C) 2005-2012 Free Software Foundation, Inc.
 
    This 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,8 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://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,
 
 /* ========================================================================= */
 
-#if USE_WIN32_THREADS
+#if USE_POSIX_THREADS
+
+#include <pthread.h>
+
+#ifdef PTW32_VERSION
+
+const gl_thread_t gl_null_thread /* = { .p = NULL } */;
+
+#endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_WINDOWS_THREADS
 
 #include <process.h>
 
index 370f09a..6653aa2 100644 (file)
@@ -1,5 +1,5 @@
 /* Creating and controlling threads.
-   Copyright (C) 2005-2011 Free Software Foundation, Inc.
+   Copyright (C) 2005-2012 Free Software Foundation, Inc.
 
    This 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,8 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://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,
        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 void gl_thread_exit (void *return_value) __attribute__ ((noreturn));
+       extern _Noreturn void gl_thread_exit (void *return_value);
 
    Requesting custom code to be executed at fork() time(not supported on all
    platforms):
@@ -147,8 +150,20 @@ typedef pthread_t gl_thread_t;
     (pthread_in_use () ? pthread_sigmask (HOW, SET, OSET) : 0)
 # define glthread_join(THREAD, RETVALP) \
     (pthread_in_use () ? pthread_join (THREAD, RETVALP) : 0)
-# define gl_thread_self() \
-    (pthread_in_use () ? (void *) pthread_self () : NULL)
+# 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;
+# else
+#  define gl_thread_self() \
+     (pthread_in_use () ? pthread_self () : (pthread_t) NULL)
+#  define gl_thread_self_pointer() \
+     (pthread_in_use () ? (void *) pthread_self () : NULL)
+# endif
 # define gl_thread_exit(RETVAL) \
     (pthread_in_use () ? pthread_exit (RETVAL) : 0)
 
@@ -205,7 +220,9 @@ typedef pth_t gl_thread_t;
 # define glthread_join(THREAD, RETVALP) \
     (pth_in_use () && !pth_join (THREAD, RETVALP) ? errno : 0)
 # define gl_thread_self() \
-    (pth_in_use () ? (void *) pth_self () : 0)
+    (pth_in_use () ? (void *) pth_self () : NULL)
+# define gl_thread_self_pointer() \
+    gl_thread_self ()
 # define gl_thread_exit(RETVAL) \
     (pth_in_use () ? pth_exit (RETVAL) : 0)
 # define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0
@@ -257,7 +274,9 @@ typedef thread_t gl_thread_t;
 # define glthread_join(THREAD, RETVALP) \
     (thread_in_use () ? thr_join (THREAD, NULL, RETVALP) : 0)
 # define gl_thread_self() \
-    (thread_in_use () ? (void *) thr_self () : 0)
+    (thread_in_use () ? (void *) thr_self () : NULL)
+# define gl_thread_self_pointer() \
+    gl_thread_self ()
 # define gl_thread_exit(RETVAL) \
     (thread_in_use () ? thr_exit (RETVAL) : 0)
 # define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0
@@ -270,8 +289,9 @@ typedef thread_t gl_thread_t;
 
 /* ========================================================================= */
 
-#if USE_WIN32_THREADS
+#if USE_WINDOWS_THREADS
 
+# define WIN32_LEAN_AND_MEAN  /* avoid including junk */
 # include <windows.h>
 
 # ifdef __cplusplus
@@ -298,6 +318,8 @@ typedef struct gl_thread_struct *gl_thread_t;
     glthread_join_func (THREAD, RETVALP)
 # define gl_thread_self() \
     gl_thread_self_func ()
+# define gl_thread_self_pointer() \
+    gl_thread_self ()
 # define gl_thread_exit(RETVAL) \
     gl_thread_exit_func (RETVAL)
 # define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0
@@ -314,7 +336,7 @@ extern int gl_thread_exit_func (void *retval);
 
 /* ========================================================================= */
 
-#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WIN32_THREADS)
+#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WINDOWS_THREADS)
 
 /* Provide dummy implementation if threads are not supported.  */
 
@@ -322,7 +344,9 @@ 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() NULL
+# define gl_thread_self() 0
+# define gl_thread_self_pointer() \
+    ((void *) gl_thread_self ())
 # define gl_thread_exit(RETVAL) 0
 # define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0
 
index 646defa..946268e 100644 (file)
@@ -1,5 +1,5 @@
 /* Multithreading primitives.
-   Copyright (C) 2005-2011 Free Software Foundation, Inc.
+   Copyright (C) 2005-2012 Free Software Foundation, Inc.
 
    This 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,8 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2005.  */
 
index 4eb1cb8..63c45be 100644 (file)
@@ -1,5 +1,5 @@
 /* Yielding the processor to other threads and processes.
-   Copyright (C) 2005-2011 Free Software Foundation, Inc.
+   Copyright (C) 2005-2012 Free Software Foundation, Inc.
 
    This 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,8 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* This file contains a primitive for yielding the processor to other threads.
      extern void gl_thread_yield (void);
@@ -89,8 +88,9 @@ extern "C" {
 
 /* ========================================================================= */
 
-#if USE_WIN32_THREADS
+#if USE_WINDOWS_THREADS
 
+# define WIN32_LEAN_AND_MEAN  /* avoid including junk */
 # include <windows.h>
 
 # ifdef __cplusplus
@@ -108,7 +108,7 @@ extern "C" {
 
 /* ========================================================================= */
 
-#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WIN32_THREADS)
+#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WINDOWS_THREADS)
 
 /* Provide dummy implementation if threads are not supported.  */
 
index f021a1a..2e34435 100644 (file)
@@ -1,6 +1,6 @@
 /* ignore a function return without a compiler warning
 
-   Copyright (C) 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #ifndef _GL_IGNORE_VALUE_H
 # define _GL_IGNORE_VALUE_H
 
-# ifndef _GL_ATTRIBUTE_DEPRECATED
-/* The __attribute__((__deprecated__)) feature
-   is available in gcc versions 3.1 and newer.  */
-#  if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 1)
-#   define _GL_ATTRIBUTE_DEPRECATED /* empty */
-#  else
-#   define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__))
-#  endif
-# endif
-
 /* The __attribute__((__warn_unused_result__)) feature
    is available in gcc versions 3.4 and newer,
    while the typeof feature has been available since 2.7 at least.  */
@@ -54,9 +44,4 @@
 #  define ignore_value(x) (({ __typeof__ (x) __x = (x); (void) __x; }))
 # endif
 
-/* ignore_value works for scalars, pointers and aggregates;
-   deprecate ignore_ptr.  */
-static inline void _GL_ATTRIBUTE_DEPRECATED
-ignore_ptr (void *p) { (void) p; } /* deprecated: use ignore_value */
-
 #endif
index 71c6516..5f6e638 100644 (file)
@@ -1,6 +1,6 @@
 # source this file; set up for tests
 
-# Copyright (C) 2009-2011 Free Software Foundation, Inc.
+# Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -61,22 +61,36 @@ ME_=`expr "./$0" : '.*/\(.*\)$'`
 
 # 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.
+# So use 'Exit STATUS' instead of 'exit STATUS' inside of the tests.
 # Turn off errexit here so that we don't trip the bug with OSF1/Tru64
 # sh inside this function.
 Exit () { set +e; (exit $1); exit $1; }
 
 # Print warnings (e.g., about skipped and failed tests) to this file number.
 # Override by defining to say, 9, in init.cfg, and putting say,
-# "export ...ENVVAR_SETTINGS...; exec 9>&2; $(SHELL)" in the definition
-# of TESTS_ENVIRONMENT in your tests/Makefile.am file.
+#   export ...ENVVAR_SETTINGS...; $(SHELL) 9>&2
+# in the definition of TESTS_ENVIRONMENT in your tests/Makefile.am file.
 # This is useful when using automake's parallel tests mode, to print
 # the reason for skip/failure to console, rather than to the .log files.
 : ${stderr_fileno_=2}
 
-warn_ () { echo "$@" 1>&$stderr_fileno_; }
+# Note that correct expansion of "$*" depends on IFS starting with ' '.
+# Always write the full diagnostic to stderr.
+# When stderr_fileno_ is not 2, also emit the first line of the
+# diagnostic to that file descriptor.
+warn_ ()
+{
+  # If IFS does not start with ' ', set it and emit the warning in a subshell.
+  case $IFS in
+    ' '*) printf '%s\n' "$*" >&2
+          test $stderr_fileno_ = 2 \
+            || { printf '%s\n' "$*" | sed 1q >&$stderr_fileno_ ; } ;;
+    *) (IFS=' '; warn_ "$@");;
+  esac
+}
 fail_ () { warn_ "$ME_: failed test: $@"; Exit 1; }
 skip_ () { warn_ "$ME_: skipped test: $@"; Exit 77; }
+fatal_ () { warn_ "$ME_: hard error: $@"; Exit 99; }
 framework_failure_ () { warn_ "$ME_: set-up failure: $@"; Exit 99; }
 
 # Sanitize this shell to POSIX mode, if possible.
@@ -158,7 +172,7 @@ else
     if test "$re_shell_" = __current__; then
       # 'eval'ing this code makes Solaris 10's /bin/sh exit with
       # $? set to 2.  It does not evaluate any of the code after the
-      # "unexpected" first `('.  Thus, we must run it in a subshell.
+      # "unexpected" first '('.  Thus, we must run it in a subshell.
       ( eval "$gl_shell_test_script_" ) > /dev/null 2>&1
     else
       "$re_shell_" -c "$gl_shell_test_script_" 2>/dev/null
@@ -167,7 +181,10 @@ else
     st_=$?
 
     # $re_shell_ works just fine.  Use it.
-    test $st_ = 10 && break
+    if test $st_ = 10; then
+      gl_set_x_corrupts_stderr_=false
+      break
+    fi
 
     # If this is our first marginally acceptable shell, remember it.
     if test "$st_:$marginal_" = 9: ; then
@@ -190,6 +207,14 @@ else
   fi
 fi
 
+# If this is bash, turn off all aliases.
+test -n "$BASH_VERSION" && unalias -a
+
+# Note that when supporting $EXEEXT (transparently mapping from PROG_NAME to
+# PROG_NAME.exe), we want to support hyphen-containing names like test-acos.
+# 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
 
 # Enable glibc's malloc-perturbing option.
@@ -204,14 +229,105 @@ export MALLOC_PERTURB_
 # a partition, or to undo any other global state changes.
 cleanup_ () { :; }
 
-if ( diff --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then
-  compare () { diff -u "$@"; }
+# 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"
+}
+
+# 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_ ()
+{
+  test $# = 2 || return 2
+
+  if test "x$1" = x/dev/null; then
+    test -s "$2" || return 0
+    emit_diff_u_header_ "$@"; sed 's/^/+/' "$2"
+    return 1
+  fi
+
+  if test "x$2" = x/dev/null; then
+    test -s "$1" || return 0
+    emit_diff_u_header_ "$@"; sed 's/^/-/' "$1"
+    return 1
+  fi
+
+  return 2
+}
+
+if diff_out_=`exec 2>/dev/null; diff -u "$0" "$0" < /dev/null` \
+   && diff -u Makefile "$0" 2>/dev/null | grep '^[+]#!' >/dev/null; then
+  # diff accepts the -u option and does not (like AIX 7 'diff') produce an
+  # extra space on column 1 of every content line.
+  if test -z "$diff_out_"; then
+    compare_ () { diff -u "$@"; }
+  else
+    compare_ ()
+    {
+      if diff -u "$@" > diff.out; then
+        # No differences were found, but Solaris 'diff' produces output
+        # "No differences encountered". Hide this output.
+        rm -f diff.out
+        true
+      else
+        cat diff.out
+        rm -f diff.out
+        false
+      fi
+    }
+  fi
+elif diff_out_=`exec 2>/dev/null; diff -c "$0" "$0" < /dev/null`; then
+  if test -z "$diff_out_"; then
+    compare_ () { diff -c "$@"; }
+  else
+    compare_ ()
+    {
+      if diff -c "$@" > diff.out; then
+        # No differences were found, but AIX and HP-UX 'diff' produce output
+        # "No differences encountered" or "There are no differences between the
+        # files.". Hide this output.
+        rm -f diff.out
+        true
+      else
+        cat diff.out
+        rm -f diff.out
+        false
+      fi
+    }
+  fi
 elif ( cmp --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then
-  compare () { cmp -s "$@"; }
+  compare_ () { cmp -s "$@"; }
 else
-  compare () { cmp "$@"; }
+  compare_ () { cmp "$@"; }
 fi
 
+# 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
+}
+
 # An arbitrary prefix to help distinguish test directories.
 testdir_prefix_ () { printf gt; }
 
@@ -295,8 +411,7 @@ path_prepend_ ()
     case $path_dir_ in
       '') fail_ "invalid path dir: '$1'";;
       /*) abs_path_dir_=$path_dir_;;
-      *) abs_path_dir_=`cd "$initial_cwd_/$path_dir_" && echo "$PWD"` \
-           || fail_ "invalid path dir: $path_dir_";;
+      *) abs_path_dir_=$initial_cwd_/$path_dir_;;
     esac
     case $abs_path_dir_ in
       *:*) fail_ "invalid path dir: '$abs_path_dir_'";;
@@ -332,7 +447,7 @@ setup_ ()
   pfx_=`testdir_prefix_`
   test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \
     || fail_ "failed to create temporary directory in $initial_cwd_"
-  cd "$test_dir_"
+  cd "$test_dir_" || fail_ "failed to cd to temporary directory"
 
   # As autoconf-generated configure scripts do, ensure that IFS
   # is defined initially, so that saving and restoring $IFS works.
@@ -400,7 +515,7 @@ mktempd_ ()
 {
   case $# in
   2);;
-  *) fail_ "Usage: $ME DIR TEMPLATE";;
+  *) fail_ "Usage: mktempd_ DIR TEMPLATE";;
   esac
 
   destdir_=$1
@@ -422,7 +537,7 @@ mktempd_ ()
   esac
 
   # First, try to use mktemp.
-  d=`unset TMPDIR; mktemp -d -t -p "$destdir_" "$template_" 2>/dev/null` \
+  d=`unset TMPDIR; { mktemp -d -t -p "$destdir_" "$template_"; } 2>/dev/null` \
     || fail=1
 
   # The resulting name must be in the specified directory.
index 58b1b3f..2485c78 100644 (file)
@@ -1,6 +1,6 @@
 /* intprops.h -- properties of integer types
 
-   Copyright (C) 2001-2005, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2001-2005, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 /* Written by Paul Eggert.  */
 
-#ifndef GL_INTPROPS_H
-# define GL_INTPROPS_H
+#ifndef _GL_INTPROPS_H
+#define _GL_INTPROPS_H
 
-# include <limits.h>
+#include <limits.h>
+
+/* Return an integer value, converted to the same type as the integer
+   expression E after integer type promotion.  V is the unconverted value.  */
+#define _GL_INT_CONVERT(e, v) (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))
 
 /* The extra casts in the following macros work around compiler bugs,
    e.g., in Cray C 5.0.3.0.  */
 
 /* True if the arithmetic type T is an integer type.  bool counts as
    an integer.  */
-# define TYPE_IS_INTEGER(t) ((t) 1.5 == 1)
+#define TYPE_IS_INTEGER(t) ((t) 1.5 == 1)
 
 /* True if negative values of the signed integer type T use two's
    complement, ones' complement, or signed magnitude representation,
    respectively.  Much GNU code assumes two's complement, but some
    people like to be portable to all possible C hosts.  */
-# define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1)
-# define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0)
-# define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1)
+#define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1)
+#define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0)
+#define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1)
+
+/* True if the signed integer expression E uses two's complement.  */
+#define _GL_INT_TWOS_COMPLEMENT(e) (~ _GL_INT_CONVERT (e, 0) == -1)
 
 /* True if the arithmetic type T is signed.  */
-# define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+
+/* Return 1 if the integer expression E, after integer promotion, has
+   a signed type.  */
+#define _GL_INT_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
+
 
-/* The maximum and minimum values for the integer type T.  These
+/* Minimum and maximum values for integer types and expressions.  These
    macros have undefined behavior if T is signed and has padding bits.
    If this is a problem for you, please let us know how to fix it for
    your host.  */
-# define TYPE_MINIMUM(t) \
-  ((t) (! TYPE_SIGNED (t) \
-        ? (t) 0 \
-        : TYPE_SIGNED_MAGNITUDE (t) \
-        ? ~ (t) 0 \
+
+/* The maximum and minimum values for the integer type T.  */
+#define TYPE_MINIMUM(t)                                                 \
+  ((t) (! TYPE_SIGNED (t)                                               \
+        ? (t) 0                                                         \
+        : TYPE_SIGNED_MAGNITUDE (t)                                     \
+        ? ~ (t) 0                                                       \
         : ~ TYPE_MAXIMUM (t)))
-# define TYPE_MAXIMUM(t) \
-  ((t) (! TYPE_SIGNED (t) \
-        ? (t) -1 \
+#define TYPE_MAXIMUM(t)                                                 \
+  ((t) (! TYPE_SIGNED (t)                                               \
+        ? (t) -1                                                        \
         : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
 
-/* Return zero if T can be determined to be an unsigned type.
-   Otherwise, return 1.
-   When compiling with GCC, INT_STRLEN_BOUND uses this macro to obtain a
-   tighter bound.  Otherwise, it overestimates the true bound by one byte
-   when applied to unsigned types of size 2, 4, 16, ... bytes.
-   The symbol signed_type_or_expr__ is private to this header file.  */
-# if __GNUC__ >= 2
-#  define signed_type_or_expr__(t) TYPE_SIGNED (__typeof__ (t))
-# else
-#  define signed_type_or_expr__(t) 1
-# endif
+/* The maximum and minimum values for the type of the expression E,
+   after integer promotion.  E should not have side effects.  */
+#define _GL_INT_MINIMUM(e)                                              \
+  (_GL_INT_SIGNED (e)                                                   \
+   ? - _GL_INT_TWOS_COMPLEMENT (e) - _GL_SIGNED_INT_MAXIMUM (e)         \
+   : _GL_INT_CONVERT (e, 0))
+#define _GL_INT_MAXIMUM(e)                                              \
+  (_GL_INT_SIGNED (e)                                                   \
+   ? _GL_SIGNED_INT_MAXIMUM (e)                                         \
+   : _GL_INT_NEGATE_CONVERT (e, 1))
+#define _GL_SIGNED_INT_MAXIMUM(e)                                       \
+  (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1)
+
+
+/* Return 1 if the __typeof__ keyword works.  This could be done by
+   'configure', but for now it's easier to do it by hand.  */
+#if 2 <= __GNUC__ || 0x5110 <= __SUNPRO_C
+# define _GL_HAVE___TYPEOF__ 1
+#else
+# define _GL_HAVE___TYPEOF__ 0
+#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 _GL_HAVE___TYPEOF__
+# define _GL_SIGNED_TYPE_OR_EXPR(t) TYPE_SIGNED (__typeof__ (t))
+#else
+# define _GL_SIGNED_TYPE_OR_EXPR(t) 1
+#endif
 
 /* Bound on length of the string representing an unsigned integer
    value representable in B bits.  log10 (2.0) < 146/485.  The
    smallest value of B where this bound is not tight is 2621.  */
-# define INT_BITS_STRLEN_BOUND(b) (((b) * 146 + 484) / 485)
+#define INT_BITS_STRLEN_BOUND(b) (((b) * 146 + 484) / 485)
 
 /* Bound on length of the string representing an integer type or expression T.
    Subtract 1 for the sign bit if T is signed, and then add 1 more for
-   a minus sign if needed.  */
-# define INT_STRLEN_BOUND(t) \
-  (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT - signed_type_or_expr__ (t)) \
-   + signed_type_or_expr__ (t))
+   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
+   applied to unsigned types of size 2, 4, 16, ... bytes.  */
+#define INT_STRLEN_BOUND(t)                                     \
+  (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT                 \
+                          - _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.  */
-# define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1)
+#define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1)
+
+
+/* Range overflow checks.
+
+   The INT_<op>_RANGE_OVERFLOW macros return 1 if the corresponding C
+   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
+   INT_<op>_OVERFLOW macros described below.
+
+   Example usage:
+
+     long int i = ...;
+     long int j = ...;
+     if (INT_MULTIPLY_RANGE_OVERFLOW (i, j, LONG_MIN, LONG_MAX))
+       printf ("multiply would overflow");
+     else
+       printf ("product is %ld", i * j);
+
+   Restrictions on *_RANGE_OVERFLOW macros:
+
+   These macros do not check for all possible numerical problems or
+   undefined or unspecified behavior: they do not check for division
+   by zero, for bad shift counts, or for shifting negative numbers.
+
+   These macros may evaluate their arguments zero or multiple times,
+   so the arguments should not have side effects.  The arithmetic
+   arguments (including the MIN and MAX arguments) must be of the same
+   integer type after the usual arithmetic conversions, and the type
+   must have minimum value MIN and maximum MAX.  Unsigned types should
+   use a zero MIN of the proper type.
+
+   These macros are tuned for constant MIN and MAX.  For commutative
+   operations such as A + B, they are also tuned for constant B.  */
+
+/* Return 1 if A + B would overflow in [MIN,MAX] arithmetic.
+   See above for restrictions.  */
+#define INT_ADD_RANGE_OVERFLOW(a, b, min, max)          \
+  ((b) < 0                                              \
+   ? (a) < (min) - (b)                                  \
+   : (max) - (b) < (a))
+
+/* Return 1 if A - B would overflow in [MIN,MAX] arithmetic.
+   See above for restrictions.  */
+#define INT_SUBTRACT_RANGE_OVERFLOW(a, b, min, max)     \
+  ((b) < 0                                              \
+   ? (max) + (b) < (a)                                  \
+   : (a) < (min) + (b))
+
+/* Return 1 if - A would overflow in [MIN,MAX] arithmetic.
+   See above for restrictions.  */
+#define INT_NEGATE_RANGE_OVERFLOW(a, min, max)          \
+  ((min) < 0                                            \
+   ? (a) < - (max)                                      \
+   : 0 < (a))
+
+/* 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>.  */
+#define INT_MULTIPLY_RANGE_OVERFLOW(a, b, min, max)     \
+  ((b) < 0                                              \
+   ? ((a) < 0                                           \
+      ? (a) < (max) / (b)                               \
+      : (b) == -1                                       \
+      ? 0                                               \
+      : (min) / (b) < (a))                              \
+   : (b) == 0                                           \
+   ? 0                                                  \
+   : ((a) < 0                                           \
+      ? (a) < (min) / (b)                               \
+      : (max) / (b) < (a)))
+
+/* Return 1 if A / B would overflow in [MIN,MAX] arithmetic.
+   See above for restrictions.  Do not check for division by zero.  */
+#define INT_DIVIDE_RANGE_OVERFLOW(a, b, min, max)       \
+  ((min) < 0 && (b) == -1 && (a) < - (max))
+
+/* Return 1 if A % B would overflow in [MIN,MAX] arithmetic.
+   See above for restrictions.  Do not check for division by zero.
+   Mathematically, % should never overflow, but on x86-like hosts
+   INT_MIN % -1 traps, and the C standard permits this, so treat this
+   as an overflow too.  */
+#define INT_REMAINDER_RANGE_OVERFLOW(a, b, min, max)    \
+  INT_DIVIDE_RANGE_OVERFLOW (a, b, min, max)
+
+/* Return 1 if A << B would overflow in [MIN,MAX] arithmetic.
+   See above for restrictions.  Here, MIN and MAX are for A only, and B need
+   not be of the same type as the other arguments.  The C standard says that
+   behavior is undefined for shifts unless 0 <= B < wordwidth, and that when
+   A is negative then A << B has undefined behavior and A >> B has
+   implementation-defined behavior, but do not check these other
+   restrictions.  */
+#define INT_LEFT_SHIFT_RANGE_OVERFLOW(a, b, min, max)   \
+  ((a) < 0                                              \
+   ? (a) < (min) >> (b)                                 \
+   : (max) >> (b) < (a))
+
+
+/* The _GL*_OVERFLOW macros have the same restrictions as the
+   *_RANGE_OVERFLOW macros, except that they do not assume that operands
+   (e.g., A and B) have the same type as MIN and MAX.  Instead, they assume
+   that the result (e.g., A + B) has that type.  */
+#define _GL_ADD_OVERFLOW(a, b, min, max)                                \
+  ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max)                  \
+   : (a) < 0 ? (b) <= (a) + (b)                                         \
+   : (b) < 0 ? (a) <= (a) + (b)                                         \
+   : (a) + (b) < (b))
+#define _GL_SUBTRACT_OVERFLOW(a, b, min, max)                           \
+  ((min) < 0 ? INT_SUBTRACT_RANGE_OVERFLOW (a, b, min, max)             \
+   : (a) < 0 ? 1                                                        \
+   : (b) < 0 ? (a) - (b) <= (a)                                         \
+   : (a) < (b))
+#define _GL_MULTIPLY_OVERFLOW(a, b, min, max)                           \
+  (((min) == 0 && (((a) < 0 && 0 < (b)) || ((b) < 0 && 0 < (a))))       \
+   || INT_MULTIPLY_RANGE_OVERFLOW (a, b, min, max))
+#define _GL_DIVIDE_OVERFLOW(a, b, min, max)                             \
+  ((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max)  \
+   : (a) < 0 ? (b) <= (a) + (b) - 1                                     \
+   : (b) < 0 && (a) + (b) <= (a))
+#define _GL_REMAINDER_OVERFLOW(a, b, min, max)                          \
+  ((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max)  \
+   : (a) < 0 ? (a) % (b) != ((max) - (b) + 1) % (b)                     \
+   : (b) < 0 && ! _GL_UNSIGNED_NEG_MULTIPLE (a, b, max))
+
+/* Return a nonzero value if A is a mathematical multiple of B, where
+   A is unsigned, B is negative, and MAX is the maximum value of A's
+   type.  A's type must be the same as (A % B)'s type.  Normally (A %
+   -B == 0) suffices, but things get tricky if -B would overflow.  */
+#define _GL_UNSIGNED_NEG_MULTIPLE(a, b, max)                            \
+  (((b) < -_GL_SIGNED_INT_MAXIMUM (b)                                   \
+    ? (_GL_SIGNED_INT_MAXIMUM (b) == (max)                              \
+       ? (a)                                                            \
+       : (a) % (_GL_INT_CONVERT (a, _GL_SIGNED_INT_MAXIMUM (b)) + 1))   \
+    : (a) % - (b))                                                      \
+   == 0)
+
+
+/* Integer overflow checks.
+
+   The INT_<op>_OVERFLOW macros return 1 if the corresponding C operators
+   might not yield numerically correct answers due to arithmetic overflow.
+   They work correctly on all known practical hosts, and do not rely
+   on undefined behavior due to signed arithmetic overflow.
+
+   Example usage:
+
+     long int i = ...;
+     long int j = ...;
+     if (INT_MULTIPLY_OVERFLOW (i, j))
+       printf ("multiply would overflow");
+     else
+       printf ("product is %ld", i * j);
+
+   These macros do not check for all possible numerical problems or
+   undefined or unspecified behavior: they do not check for division
+   by zero, for bad shift counts, or for shifting negative numbers.
+
+   These macros may evaluate their arguments zero or multiple times, so the
+   arguments should not have side effects.
+
+   These macros are tuned for their last 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.  */
+
+#define INT_ADD_OVERFLOW(a, b) \
+  _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
+#define INT_SUBTRACT_OVERFLOW(a, b) \
+  _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
+#define INT_NEGATE_OVERFLOW(a) \
+  INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
+#define INT_MULTIPLY_OVERFLOW(a, b) \
+  _GL_BINARY_OP_OVERFLOW (a, b, _GL_MULTIPLY_OVERFLOW)
+#define INT_DIVIDE_OVERFLOW(a, b) \
+  _GL_BINARY_OP_OVERFLOW (a, b, _GL_DIVIDE_OVERFLOW)
+#define INT_REMAINDER_OVERFLOW(a, b) \
+  _GL_BINARY_OP_OVERFLOW (a, b, _GL_REMAINDER_OVERFLOW)
+#define INT_LEFT_SHIFT_OVERFLOW(a, b) \
+  INT_LEFT_SHIFT_RANGE_OVERFLOW (a, b, \
+                                 _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
+
+/* Return 1 if the expression A <op> B would overflow,
+   where OP_RESULT_OVERFLOW (A, B, MIN, MAX) does the actual test,
+   assuming MIN and MAX are the minimum and maximum for the result type.
+   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)))
 
-#endif /* GL_INTPROPS_H */
+#endif /* _GL_INTPROPS_H */
diff --git a/gnulib/tests/inttypes.in.h b/gnulib/tests/inttypes.in.h
new file mode 100644 (file)
index 0000000..b9da2b5
--- /dev/null
@@ -0,0 +1,1130 @@
+/* Copyright (C) 2006-2012 Free Software Foundation, Inc.
+   Written by Paul Eggert, Bruno Haible, Derek Price.
+   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 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/*
+ * ISO C 99 <inttypes.h> for platforms that lack it.
+ * <http://www.opengroup.org/susv3xbd/inttypes.h.html>
+ */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* Include the original <inttypes.h> if it exists, and if this file
+   has not been included yet or if this file includes gnulib stdint.h
+   which in turn includes this file.
+   The include_next requires a split double-inclusion guard.  */
+#if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+# if @HAVE_INTTYPES_H@
+
+   /* Some pre-C++11 <stdint.h> implementations need this.  */
+#  if defined __cplusplus && ! defined __STDC_FORMAT_MACROS
+#   define __STDC_FORMAT_MACROS 1
+#  endif
+
+#  @INCLUDE_NEXT@ @NEXT_INTTYPES_H@
+# endif
+#endif
+
+#if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+#define INTTYPES_H
+
+/* Include <stdint.h> or the gnulib replacement.
+   But avoid namespace pollution on glibc systems.  */
+#ifndef __GLIBC__
+# include <stdint.h>
+#endif
+/* Get CHAR_BIT.  */
+#include <limits.h>
+
+#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>."
+#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.  */
+
+/* 7.8.1 Macros for format specifiers */
+
+#if defined _TNS_R_TARGET
+   /* Tandem NonStop R series and compatible platforms released before
+      July 2005 support %Ld but not %lld.  */
+# define _LONG_LONG_FORMAT_PREFIX "L"
+#else
+# define _LONG_LONG_FORMAT_PREFIX "ll"
+#endif
+
+#if !defined PRId8 || @PRI_MACROS_BROKEN@
+# undef PRId8
+# ifdef INT8_MAX
+#  define PRId8 "d"
+# endif
+#endif
+#if !defined PRIi8 || @PRI_MACROS_BROKEN@
+# undef PRIi8
+# ifdef INT8_MAX
+#  define PRIi8 "i"
+# endif
+#endif
+#if !defined PRIo8 || @PRI_MACROS_BROKEN@
+# undef PRIo8
+# ifdef UINT8_MAX
+#  define PRIo8 "o"
+# endif
+#endif
+#if !defined PRIu8 || @PRI_MACROS_BROKEN@
+# undef PRIu8
+# ifdef UINT8_MAX
+#  define PRIu8 "u"
+# endif
+#endif
+#if !defined PRIx8 || @PRI_MACROS_BROKEN@
+# undef PRIx8
+# ifdef UINT8_MAX
+#  define PRIx8 "x"
+# endif
+#endif
+#if !defined PRIX8 || @PRI_MACROS_BROKEN@
+# undef PRIX8
+# ifdef UINT8_MAX
+#  define PRIX8 "X"
+# endif
+#endif
+#if !defined PRId16 || @PRI_MACROS_BROKEN@
+# undef PRId16
+# ifdef INT16_MAX
+#  define PRId16 "d"
+# endif
+#endif
+#if !defined PRIi16 || @PRI_MACROS_BROKEN@
+# undef PRIi16
+# ifdef INT16_MAX
+#  define PRIi16 "i"
+# endif
+#endif
+#if !defined PRIo16 || @PRI_MACROS_BROKEN@
+# undef PRIo16
+# ifdef UINT16_MAX
+#  define PRIo16 "o"
+# endif
+#endif
+#if !defined PRIu16 || @PRI_MACROS_BROKEN@
+# undef PRIu16
+# ifdef UINT16_MAX
+#  define PRIu16 "u"
+# endif
+#endif
+#if !defined PRIx16 || @PRI_MACROS_BROKEN@
+# undef PRIx16
+# ifdef UINT16_MAX
+#  define PRIx16 "x"
+# endif
+#endif
+#if !defined PRIX16 || @PRI_MACROS_BROKEN@
+# undef PRIX16
+# ifdef UINT16_MAX
+#  define PRIX16 "X"
+# endif
+#endif
+#if !defined PRId32 || @PRI_MACROS_BROKEN@
+# undef PRId32
+# ifdef INT32_MAX
+#  define PRId32 "d"
+# endif
+#endif
+#if !defined PRIi32 || @PRI_MACROS_BROKEN@
+# undef PRIi32
+# ifdef INT32_MAX
+#  define PRIi32 "i"
+# endif
+#endif
+#if !defined PRIo32 || @PRI_MACROS_BROKEN@
+# undef PRIo32
+# ifdef UINT32_MAX
+#  define PRIo32 "o"
+# endif
+#endif
+#if !defined PRIu32 || @PRI_MACROS_BROKEN@
+# undef PRIu32
+# ifdef UINT32_MAX
+#  define PRIu32 "u"
+# endif
+#endif
+#if !defined PRIx32 || @PRI_MACROS_BROKEN@
+# undef PRIx32
+# ifdef UINT32_MAX
+#  define PRIx32 "x"
+# endif
+#endif
+#if !defined PRIX32 || @PRI_MACROS_BROKEN@
+# undef PRIX32
+# ifdef UINT32_MAX
+#  define PRIX32 "X"
+# endif
+#endif
+#ifdef INT64_MAX
+# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @INT64_MAX_EQ_LONG_MAX@)
+#  define _PRI64_PREFIX "l"
+# elif defined _MSC_VER || defined __MINGW32__
+#  define _PRI64_PREFIX "I64"
+# elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+#  define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX
+# endif
+# if !defined PRId64 || @PRI_MACROS_BROKEN@
+#  undef PRId64
+#  define PRId64 _PRI64_PREFIX "d"
+# endif
+# if !defined PRIi64 || @PRI_MACROS_BROKEN@
+#  undef PRIi64
+#  define PRIi64 _PRI64_PREFIX "i"
+# endif
+#endif
+#ifdef UINT64_MAX
+# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @UINT64_MAX_EQ_ULONG_MAX@)
+#  define _PRIu64_PREFIX "l"
+# elif defined _MSC_VER || defined __MINGW32__
+#  define _PRIu64_PREFIX "I64"
+# elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+#  define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX
+# endif
+# if !defined PRIo64 || @PRI_MACROS_BROKEN@
+#  undef PRIo64
+#  define PRIo64 _PRIu64_PREFIX "o"
+# endif
+# if !defined PRIu64 || @PRI_MACROS_BROKEN@
+#  undef PRIu64
+#  define PRIu64 _PRIu64_PREFIX "u"
+# endif
+# if !defined PRIx64 || @PRI_MACROS_BROKEN@
+#  undef PRIx64
+#  define PRIx64 _PRIu64_PREFIX "x"
+# endif
+# if !defined PRIX64 || @PRI_MACROS_BROKEN@
+#  undef PRIX64
+#  define PRIX64 _PRIu64_PREFIX "X"
+# endif
+#endif
+
+#if !defined PRIdLEAST8 || @PRI_MACROS_BROKEN@
+# undef PRIdLEAST8
+# define PRIdLEAST8 "d"
+#endif
+#if !defined PRIiLEAST8 || @PRI_MACROS_BROKEN@
+# undef PRIiLEAST8
+# define PRIiLEAST8 "i"
+#endif
+#if !defined PRIoLEAST8 || @PRI_MACROS_BROKEN@
+# undef PRIoLEAST8
+# define PRIoLEAST8 "o"
+#endif
+#if !defined PRIuLEAST8 || @PRI_MACROS_BROKEN@
+# undef PRIuLEAST8
+# define PRIuLEAST8 "u"
+#endif
+#if !defined PRIxLEAST8 || @PRI_MACROS_BROKEN@
+# undef PRIxLEAST8
+# define PRIxLEAST8 "x"
+#endif
+#if !defined PRIXLEAST8 || @PRI_MACROS_BROKEN@
+# undef PRIXLEAST8
+# define PRIXLEAST8 "X"
+#endif
+#if !defined PRIdLEAST16 || @PRI_MACROS_BROKEN@
+# undef PRIdLEAST16
+# define PRIdLEAST16 "d"
+#endif
+#if !defined PRIiLEAST16 || @PRI_MACROS_BROKEN@
+# undef PRIiLEAST16
+# define PRIiLEAST16 "i"
+#endif
+#if !defined PRIoLEAST16 || @PRI_MACROS_BROKEN@
+# undef PRIoLEAST16
+# define PRIoLEAST16 "o"
+#endif
+#if !defined PRIuLEAST16 || @PRI_MACROS_BROKEN@
+# undef PRIuLEAST16
+# define PRIuLEAST16 "u"
+#endif
+#if !defined PRIxLEAST16 || @PRI_MACROS_BROKEN@
+# undef PRIxLEAST16
+# define PRIxLEAST16 "x"
+#endif
+#if !defined PRIXLEAST16 || @PRI_MACROS_BROKEN@
+# undef PRIXLEAST16
+# define PRIXLEAST16 "X"
+#endif
+#if !defined PRIdLEAST32 || @PRI_MACROS_BROKEN@
+# undef PRIdLEAST32
+# define PRIdLEAST32 "d"
+#endif
+#if !defined PRIiLEAST32 || @PRI_MACROS_BROKEN@
+# undef PRIiLEAST32
+# define PRIiLEAST32 "i"
+#endif
+#if !defined PRIoLEAST32 || @PRI_MACROS_BROKEN@
+# undef PRIoLEAST32
+# define PRIoLEAST32 "o"
+#endif
+#if !defined PRIuLEAST32 || @PRI_MACROS_BROKEN@
+# undef PRIuLEAST32
+# define PRIuLEAST32 "u"
+#endif
+#if !defined PRIxLEAST32 || @PRI_MACROS_BROKEN@
+# undef PRIxLEAST32
+# define PRIxLEAST32 "x"
+#endif
+#if !defined PRIXLEAST32 || @PRI_MACROS_BROKEN@
+# undef PRIXLEAST32
+# define PRIXLEAST32 "X"
+#endif
+#ifdef INT64_MAX
+# if !defined PRIdLEAST64 || @PRI_MACROS_BROKEN@
+#  undef PRIdLEAST64
+#  define PRIdLEAST64 PRId64
+# endif
+# if !defined PRIiLEAST64 || @PRI_MACROS_BROKEN@
+#  undef PRIiLEAST64
+#  define PRIiLEAST64 PRIi64
+# endif
+#endif
+#ifdef UINT64_MAX
+# if !defined PRIoLEAST64 || @PRI_MACROS_BROKEN@
+#  undef PRIoLEAST64
+#  define PRIoLEAST64 PRIo64
+# endif
+# if !defined PRIuLEAST64 || @PRI_MACROS_BROKEN@
+#  undef PRIuLEAST64
+#  define PRIuLEAST64 PRIu64
+# endif
+# if !defined PRIxLEAST64 || @PRI_MACROS_BROKEN@
+#  undef PRIxLEAST64
+#  define PRIxLEAST64 PRIx64
+# endif
+# if !defined PRIXLEAST64 || @PRI_MACROS_BROKEN@
+#  undef PRIXLEAST64
+#  define PRIXLEAST64 PRIX64
+# endif
+#endif
+
+#if !defined PRIdFAST8 || @PRI_MACROS_BROKEN@
+# undef 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 INT_FAST8_MAX > INT32_MAX
+#  define PRIiFAST8 PRIi64
+# else
+#  define PRIiFAST8 "i"
+# endif
+#endif
+#if !defined PRIoFAST8 || @PRI_MACROS_BROKEN@
+# undef 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 UINT_FAST8_MAX > UINT32_MAX
+#  define PRIuFAST8 PRIu64
+# else
+#  define PRIuFAST8 "u"
+# endif
+#endif
+#if !defined PRIxFAST8 || @PRI_MACROS_BROKEN@
+# undef 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 UINT_FAST8_MAX > UINT32_MAX
+#  define PRIXFAST8 PRIX64
+# else
+#  define PRIXFAST8 "X"
+# endif
+#endif
+#if !defined PRIdFAST16 || @PRI_MACROS_BROKEN@
+# undef 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 INT_FAST16_MAX > INT32_MAX
+#  define PRIiFAST16 PRIi64
+# else
+#  define PRIiFAST16 "i"
+# endif
+#endif
+#if !defined PRIoFAST16 || @PRI_MACROS_BROKEN@
+# undef 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 UINT_FAST16_MAX > UINT32_MAX
+#  define PRIuFAST16 PRIu64
+# else
+#  define PRIuFAST16 "u"
+# endif
+#endif
+#if !defined PRIxFAST16 || @PRI_MACROS_BROKEN@
+# undef 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 UINT_FAST16_MAX > UINT32_MAX
+#  define PRIXFAST16 PRIX64
+# else
+#  define PRIXFAST16 "X"
+# endif
+#endif
+#if !defined PRIdFAST32 || @PRI_MACROS_BROKEN@
+# undef 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 INT_FAST32_MAX > INT32_MAX
+#  define PRIiFAST32 PRIi64
+# else
+#  define PRIiFAST32 "i"
+# endif
+#endif
+#if !defined PRIoFAST32 || @PRI_MACROS_BROKEN@
+# undef 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 UINT_FAST32_MAX > UINT32_MAX
+#  define PRIuFAST32 PRIu64
+# else
+#  define PRIuFAST32 "u"
+# endif
+#endif
+#if !defined PRIxFAST32 || @PRI_MACROS_BROKEN@
+# undef 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 UINT_FAST32_MAX > UINT32_MAX
+#  define PRIXFAST32 PRIX64
+# else
+#  define PRIXFAST32 "X"
+# endif
+#endif
+#ifdef INT64_MAX
+# if !defined PRIdFAST64 || @PRI_MACROS_BROKEN@
+#  undef PRIdFAST64
+#  define PRIdFAST64 PRId64
+# endif
+# if !defined PRIiFAST64 || @PRI_MACROS_BROKEN@
+#  undef PRIiFAST64
+#  define PRIiFAST64 PRIi64
+# endif
+#endif
+#ifdef UINT64_MAX
+# if !defined PRIoFAST64 || @PRI_MACROS_BROKEN@
+#  undef PRIoFAST64
+#  define PRIoFAST64 PRIo64
+# endif
+# if !defined PRIuFAST64 || @PRI_MACROS_BROKEN@
+#  undef PRIuFAST64
+#  define PRIuFAST64 PRIu64
+# endif
+# if !defined PRIxFAST64 || @PRI_MACROS_BROKEN@
+#  undef PRIxFAST64
+#  define PRIxFAST64 PRIx64
+# endif
+# if !defined PRIXFAST64 || @PRI_MACROS_BROKEN@
+#  undef PRIXFAST64
+#  define PRIXFAST64 PRIX64
+# endif
+#endif
+
+#if !defined PRIdMAX || @PRI_MACROS_BROKEN@
+# undef 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 @INT32_MAX_LT_INTMAX_MAX@
+#  define PRIiMAX PRIi64
+# else
+#  define PRIiMAX "li"
+# endif
+#endif
+#if !defined PRIoMAX || @PRI_MACROS_BROKEN@
+# undef 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 @UINT32_MAX_LT_UINTMAX_MAX@
+#  define PRIuMAX PRIu64
+# else
+#  define PRIuMAX "lu"
+# endif
+#endif
+#if !defined PRIxMAX || @PRI_MACROS_BROKEN@
+# undef 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 @UINT32_MAX_LT_UINTMAX_MAX@
+#  define PRIXMAX PRIX64
+# else
+#  define PRIXMAX "lX"
+# endif
+#endif
+
+#if !defined PRIdPTR || @PRI_MACROS_BROKEN@
+# undef PRIdPTR
+# ifdef INTPTR_MAX
+#  define PRIdPTR @PRIPTR_PREFIX@ "d"
+# endif
+#endif
+#if !defined PRIiPTR || @PRI_MACROS_BROKEN@
+# undef PRIiPTR
+# ifdef INTPTR_MAX
+#  define PRIiPTR @PRIPTR_PREFIX@ "i"
+# endif
+#endif
+#if !defined PRIoPTR || @PRI_MACROS_BROKEN@
+# undef PRIoPTR
+# ifdef UINTPTR_MAX
+#  define PRIoPTR @PRIPTR_PREFIX@ "o"
+# endif
+#endif
+#if !defined PRIuPTR || @PRI_MACROS_BROKEN@
+# undef PRIuPTR
+# ifdef UINTPTR_MAX
+#  define PRIuPTR @PRIPTR_PREFIX@ "u"
+# endif
+#endif
+#if !defined PRIxPTR || @PRI_MACROS_BROKEN@
+# undef PRIxPTR
+# ifdef UINTPTR_MAX
+#  define PRIxPTR @PRIPTR_PREFIX@ "x"
+# endif
+#endif
+#if !defined PRIXPTR || @PRI_MACROS_BROKEN@
+# undef PRIXPTR
+# ifdef UINTPTR_MAX
+#  define PRIXPTR @PRIPTR_PREFIX@ "X"
+# endif
+#endif
+
+#if !defined SCNd8 || @PRI_MACROS_BROKEN@
+# undef SCNd8
+# ifdef INT8_MAX
+#  define SCNd8 "hhd"
+# endif
+#endif
+#if !defined SCNi8 || @PRI_MACROS_BROKEN@
+# undef SCNi8
+# ifdef INT8_MAX
+#  define SCNi8 "hhi"
+# endif
+#endif
+#if !defined SCNo8 || @PRI_MACROS_BROKEN@
+# undef SCNo8
+# ifdef UINT8_MAX
+#  define SCNo8 "hho"
+# endif
+#endif
+#if !defined SCNu8 || @PRI_MACROS_BROKEN@
+# undef SCNu8
+# ifdef UINT8_MAX
+#  define SCNu8 "hhu"
+# endif
+#endif
+#if !defined SCNx8 || @PRI_MACROS_BROKEN@
+# undef SCNx8
+# ifdef UINT8_MAX
+#  define SCNx8 "hhx"
+# endif
+#endif
+#if !defined SCNd16 || @PRI_MACROS_BROKEN@
+# undef SCNd16
+# ifdef INT16_MAX
+#  define SCNd16 "hd"
+# endif
+#endif
+#if !defined SCNi16 || @PRI_MACROS_BROKEN@
+# undef SCNi16
+# ifdef INT16_MAX
+#  define SCNi16 "hi"
+# endif
+#endif
+#if !defined SCNo16 || @PRI_MACROS_BROKEN@
+# undef SCNo16
+# ifdef UINT16_MAX
+#  define SCNo16 "ho"
+# endif
+#endif
+#if !defined SCNu16 || @PRI_MACROS_BROKEN@
+# undef SCNu16
+# ifdef UINT16_MAX
+#  define SCNu16 "hu"
+# endif
+#endif
+#if !defined SCNx16 || @PRI_MACROS_BROKEN@
+# undef SCNx16
+# ifdef UINT16_MAX
+#  define SCNx16 "hx"
+# endif
+#endif
+#if !defined SCNd32 || @PRI_MACROS_BROKEN@
+# undef SCNd32
+# ifdef INT32_MAX
+#  define SCNd32 "d"
+# endif
+#endif
+#if !defined SCNi32 || @PRI_MACROS_BROKEN@
+# undef SCNi32
+# ifdef INT32_MAX
+#  define SCNi32 "i"
+# endif
+#endif
+#if !defined SCNo32 || @PRI_MACROS_BROKEN@
+# undef SCNo32
+# ifdef UINT32_MAX
+#  define SCNo32 "o"
+# endif
+#endif
+#if !defined SCNu32 || @PRI_MACROS_BROKEN@
+# undef SCNu32
+# ifdef UINT32_MAX
+#  define SCNu32 "u"
+# endif
+#endif
+#if !defined SCNx32 || @PRI_MACROS_BROKEN@
+# undef SCNx32
+# ifdef UINT32_MAX
+#  define SCNx32 "x"
+# endif
+#endif
+#ifdef INT64_MAX
+# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @INT64_MAX_EQ_LONG_MAX@)
+#  define _SCN64_PREFIX "l"
+# elif defined _MSC_VER || defined __MINGW32__
+#  define _SCN64_PREFIX "I64"
+# elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+#  define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX
+# endif
+# if !defined SCNd64 || @PRI_MACROS_BROKEN@
+#  undef SCNd64
+#  define SCNd64 _SCN64_PREFIX "d"
+# endif
+# if !defined SCNi64 || @PRI_MACROS_BROKEN@
+#  undef SCNi64
+#  define SCNi64 _SCN64_PREFIX "i"
+# endif
+#endif
+#ifdef UINT64_MAX
+# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @UINT64_MAX_EQ_ULONG_MAX@)
+#  define _SCNu64_PREFIX "l"
+# elif defined _MSC_VER || defined __MINGW32__
+#  define _SCNu64_PREFIX "I64"
+# elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+#  define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX
+# endif
+# if !defined SCNo64 || @PRI_MACROS_BROKEN@
+#  undef SCNo64
+#  define SCNo64 _SCNu64_PREFIX "o"
+# endif
+# if !defined SCNu64 || @PRI_MACROS_BROKEN@
+#  undef SCNu64
+#  define SCNu64 _SCNu64_PREFIX "u"
+# endif
+# if !defined SCNx64 || @PRI_MACROS_BROKEN@
+#  undef SCNx64
+#  define SCNx64 _SCNu64_PREFIX "x"
+# endif
+#endif
+
+#if !defined SCNdLEAST8 || @PRI_MACROS_BROKEN@
+# undef SCNdLEAST8
+# define SCNdLEAST8 "hhd"
+#endif
+#if !defined SCNiLEAST8 || @PRI_MACROS_BROKEN@
+# undef SCNiLEAST8
+# define SCNiLEAST8 "hhi"
+#endif
+#if !defined SCNoLEAST8 || @PRI_MACROS_BROKEN@
+# undef SCNoLEAST8
+# define SCNoLEAST8 "hho"
+#endif
+#if !defined SCNuLEAST8 || @PRI_MACROS_BROKEN@
+# undef SCNuLEAST8
+# define SCNuLEAST8 "hhu"
+#endif
+#if !defined SCNxLEAST8 || @PRI_MACROS_BROKEN@
+# undef SCNxLEAST8
+# define SCNxLEAST8 "hhx"
+#endif
+#if !defined SCNdLEAST16 || @PRI_MACROS_BROKEN@
+# undef SCNdLEAST16
+# define SCNdLEAST16 "hd"
+#endif
+#if !defined SCNiLEAST16 || @PRI_MACROS_BROKEN@
+# undef SCNiLEAST16
+# define SCNiLEAST16 "hi"
+#endif
+#if !defined SCNoLEAST16 || @PRI_MACROS_BROKEN@
+# undef SCNoLEAST16
+# define SCNoLEAST16 "ho"
+#endif
+#if !defined SCNuLEAST16 || @PRI_MACROS_BROKEN@
+# undef SCNuLEAST16
+# define SCNuLEAST16 "hu"
+#endif
+#if !defined SCNxLEAST16 || @PRI_MACROS_BROKEN@
+# undef SCNxLEAST16
+# define SCNxLEAST16 "hx"
+#endif
+#if !defined SCNdLEAST32 || @PRI_MACROS_BROKEN@
+# undef SCNdLEAST32
+# define SCNdLEAST32 "d"
+#endif
+#if !defined SCNiLEAST32 || @PRI_MACROS_BROKEN@
+# undef SCNiLEAST32
+# define SCNiLEAST32 "i"
+#endif
+#if !defined SCNoLEAST32 || @PRI_MACROS_BROKEN@
+# undef SCNoLEAST32
+# define SCNoLEAST32 "o"
+#endif
+#if !defined SCNuLEAST32 || @PRI_MACROS_BROKEN@
+# undef SCNuLEAST32
+# define SCNuLEAST32 "u"
+#endif
+#if !defined SCNxLEAST32 || @PRI_MACROS_BROKEN@
+# undef SCNxLEAST32
+# define SCNxLEAST32 "x"
+#endif
+#ifdef INT64_MAX
+# if !defined SCNdLEAST64 || @PRI_MACROS_BROKEN@
+#  undef SCNdLEAST64
+#  define SCNdLEAST64 SCNd64
+# endif
+# if !defined SCNiLEAST64 || @PRI_MACROS_BROKEN@
+#  undef SCNiLEAST64
+#  define SCNiLEAST64 SCNi64
+# endif
+#endif
+#ifdef UINT64_MAX
+# if !defined SCNoLEAST64 || @PRI_MACROS_BROKEN@
+#  undef SCNoLEAST64
+#  define SCNoLEAST64 SCNo64
+# endif
+# if !defined SCNuLEAST64 || @PRI_MACROS_BROKEN@
+#  undef SCNuLEAST64
+#  define SCNuLEAST64 SCNu64
+# endif
+# if !defined SCNxLEAST64 || @PRI_MACROS_BROKEN@
+#  undef SCNxLEAST64
+#  define SCNxLEAST64 SCNx64
+# endif
+#endif
+
+#if !defined SCNdFAST8 || @PRI_MACROS_BROKEN@
+# undef SCNdFAST8
+# if INT_FAST8_MAX > INT32_MAX
+#  define SCNdFAST8 SCNd64
+# elif INT_FAST8_MAX == 0x7fff
+#  define SCNdFAST8 "hd"
+# elif INT_FAST8_MAX == 0x7f
+#  define SCNdFAST8 "hhd"
+# else
+#  define SCNdFAST8 "d"
+# endif
+#endif
+#if !defined SCNiFAST8 || @PRI_MACROS_BROKEN@
+# undef SCNiFAST8
+# if INT_FAST8_MAX > INT32_MAX
+#  define SCNiFAST8 SCNi64
+# elif INT_FAST8_MAX == 0x7fff
+#  define SCNiFAST8 "hi"
+# elif INT_FAST8_MAX == 0x7f
+#  define SCNiFAST8 "hhi"
+# else
+#  define SCNiFAST8 "i"
+# endif
+#endif
+#if !defined SCNoFAST8 || @PRI_MACROS_BROKEN@
+# undef SCNoFAST8
+# if UINT_FAST8_MAX > UINT32_MAX
+#  define SCNoFAST8 SCNo64
+# elif UINT_FAST8_MAX == 0xffff
+#  define SCNoFAST8 "ho"
+# elif UINT_FAST8_MAX == 0xff
+#  define SCNoFAST8 "hho"
+# else
+#  define SCNoFAST8 "o"
+# endif
+#endif
+#if !defined SCNuFAST8 || @PRI_MACROS_BROKEN@
+# undef SCNuFAST8
+# if UINT_FAST8_MAX > UINT32_MAX
+#  define SCNuFAST8 SCNu64
+# elif UINT_FAST8_MAX == 0xffff
+#  define SCNuFAST8 "hu"
+# elif UINT_FAST8_MAX == 0xff
+#  define SCNuFAST8 "hhu"
+# else
+#  define SCNuFAST8 "u"
+# endif
+#endif
+#if !defined SCNxFAST8 || @PRI_MACROS_BROKEN@
+# undef SCNxFAST8
+# if UINT_FAST8_MAX > UINT32_MAX
+#  define SCNxFAST8 SCNx64
+# elif UINT_FAST8_MAX == 0xffff
+#  define SCNxFAST8 "hx"
+# elif UINT_FAST8_MAX == 0xff
+#  define SCNxFAST8 "hhx"
+# else
+#  define SCNxFAST8 "x"
+# endif
+#endif
+#if !defined SCNdFAST16 || @PRI_MACROS_BROKEN@
+# undef SCNdFAST16
+# if INT_FAST16_MAX > INT32_MAX
+#  define SCNdFAST16 SCNd64
+# elif INT_FAST16_MAX == 0x7fff
+#  define SCNdFAST16 "hd"
+# else
+#  define SCNdFAST16 "d"
+# endif
+#endif
+#if !defined SCNiFAST16 || @PRI_MACROS_BROKEN@
+# undef SCNiFAST16
+# if INT_FAST16_MAX > INT32_MAX
+#  define SCNiFAST16 SCNi64
+# elif INT_FAST16_MAX == 0x7fff
+#  define SCNiFAST16 "hi"
+# else
+#  define SCNiFAST16 "i"
+# endif
+#endif
+#if !defined SCNoFAST16 || @PRI_MACROS_BROKEN@
+# undef SCNoFAST16
+# if UINT_FAST16_MAX > UINT32_MAX
+#  define SCNoFAST16 SCNo64
+# elif UINT_FAST16_MAX == 0xffff
+#  define SCNoFAST16 "ho"
+# else
+#  define SCNoFAST16 "o"
+# endif
+#endif
+#if !defined SCNuFAST16 || @PRI_MACROS_BROKEN@
+# undef SCNuFAST16
+# if UINT_FAST16_MAX > UINT32_MAX
+#  define SCNuFAST16 SCNu64
+# elif UINT_FAST16_MAX == 0xffff
+#  define SCNuFAST16 "hu"
+# else
+#  define SCNuFAST16 "u"
+# endif
+#endif
+#if !defined SCNxFAST16 || @PRI_MACROS_BROKEN@
+# undef SCNxFAST16
+# if UINT_FAST16_MAX > UINT32_MAX
+#  define SCNxFAST16 SCNx64
+# elif UINT_FAST16_MAX == 0xffff
+#  define SCNxFAST16 "hx"
+# else
+#  define SCNxFAST16 "x"
+# endif
+#endif
+#if !defined SCNdFAST32 || @PRI_MACROS_BROKEN@
+# undef 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 INT_FAST32_MAX > INT32_MAX
+#  define SCNiFAST32 SCNi64
+# else
+#  define SCNiFAST32 "i"
+# endif
+#endif
+#if !defined SCNoFAST32 || @PRI_MACROS_BROKEN@
+# undef 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 UINT_FAST32_MAX > UINT32_MAX
+#  define SCNuFAST32 SCNu64
+# else
+#  define SCNuFAST32 "u"
+# endif
+#endif
+#if !defined SCNxFAST32 || @PRI_MACROS_BROKEN@
+# undef SCNxFAST32
+# if UINT_FAST32_MAX > UINT32_MAX
+#  define SCNxFAST32 SCNx64
+# else
+#  define SCNxFAST32 "x"
+# endif
+#endif
+#ifdef INT64_MAX
+# if !defined SCNdFAST64 || @PRI_MACROS_BROKEN@
+#  undef SCNdFAST64
+#  define SCNdFAST64 SCNd64
+# endif
+# if !defined SCNiFAST64 || @PRI_MACROS_BROKEN@
+#  undef SCNiFAST64
+#  define SCNiFAST64 SCNi64
+# endif
+#endif
+#ifdef UINT64_MAX
+# if !defined SCNoFAST64 || @PRI_MACROS_BROKEN@
+#  undef SCNoFAST64
+#  define SCNoFAST64 SCNo64
+# endif
+# if !defined SCNuFAST64 || @PRI_MACROS_BROKEN@
+#  undef SCNuFAST64
+#  define SCNuFAST64 SCNu64
+# endif
+# if !defined SCNxFAST64 || @PRI_MACROS_BROKEN@
+#  undef SCNxFAST64
+#  define SCNxFAST64 SCNx64
+# endif
+#endif
+
+#if !defined SCNdMAX || @PRI_MACROS_BROKEN@
+# undef 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 @INT32_MAX_LT_INTMAX_MAX@
+#  define SCNiMAX SCNi64
+# else
+#  define SCNiMAX "li"
+# endif
+#endif
+#if !defined SCNoMAX || @PRI_MACROS_BROKEN@
+# undef 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 @UINT32_MAX_LT_UINTMAX_MAX@
+#  define SCNuMAX SCNu64
+# else
+#  define SCNuMAX "lu"
+# endif
+#endif
+#if !defined SCNxMAX || @PRI_MACROS_BROKEN@
+# undef SCNxMAX
+# if @UINT32_MAX_LT_UINTMAX_MAX@
+#  define SCNxMAX SCNx64
+# else
+#  define SCNxMAX "lx"
+# endif
+#endif
+
+#if !defined SCNdPTR || @PRI_MACROS_BROKEN@
+# undef SCNdPTR
+# ifdef INTPTR_MAX
+#  define SCNdPTR @PRIPTR_PREFIX@ "d"
+# endif
+#endif
+#if !defined SCNiPTR || @PRI_MACROS_BROKEN@
+# undef SCNiPTR
+# ifdef INTPTR_MAX
+#  define SCNiPTR @PRIPTR_PREFIX@ "i"
+# endif
+#endif
+#if !defined SCNoPTR || @PRI_MACROS_BROKEN@
+# undef SCNoPTR
+# ifdef UINTPTR_MAX
+#  define SCNoPTR @PRIPTR_PREFIX@ "o"
+# endif
+#endif
+#if !defined SCNuPTR || @PRI_MACROS_BROKEN@
+# undef SCNuPTR
+# ifdef UINTPTR_MAX
+#  define SCNuPTR @PRIPTR_PREFIX@ "u"
+# endif
+#endif
+#if !defined SCNxPTR || @PRI_MACROS_BROKEN@
+# undef SCNxPTR
+# ifdef UINTPTR_MAX
+#  define SCNxPTR @PRIPTR_PREFIX@ "x"
+# endif
+#endif
+
+/* 7.8.2 Functions for greatest-width integer types */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if @GNULIB_IMAXABS@
+# if !@HAVE_DECL_IMAXABS@
+extern intmax_t imaxabs (intmax_t);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef imaxabs
+# if HAVE_RAW_DECL_IMAXABS
+_GL_WARN_ON_USE (imaxabs, "imaxabs is unportable - "
+                 "use gnulib module imaxabs for portability");
+# endif
+#endif
+
+#if @GNULIB_IMAXDIV@
+# if !@HAVE_DECL_IMAXDIV@
+#  if !GNULIB_defined_imaxdiv_t
+typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t;
+#   define GNULIB_defined_imaxdiv_t 1
+#  endif
+extern imaxdiv_t imaxdiv (intmax_t, intmax_t);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef imaxdiv
+# if HAVE_RAW_DECL_IMAXDIV
+_GL_WARN_ON_USE (imaxdiv, "imaxdiv is unportable - "
+                 "use gnulib module imaxdiv for portability");
+# endif
+#endif
+
+#if @GNULIB_STRTOIMAX@
+# if @REPLACE_STRTOIMAX@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef strtoimax
+#   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));
+# else
+#  if !@HAVE_DECL_STRTOIMAX@
+#   undef strtoimax
+_GL_FUNCDECL_SYS (strtoimax, intmax_t,
+                  (const char *, char **, int) _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (strtoimax, intmax_t, (const char *, char **, int));
+# endif
+_GL_CXXALIASWARN (strtoimax);
+#elif defined GNULIB_POSIXCHECK
+# undef strtoimax
+# if HAVE_RAW_DECL_STRTOIMAX
+_GL_WARN_ON_USE (strtoimax, "strtoimax is unportable - "
+                 "use gnulib module strtoimax for portability");
+# endif
+#endif
+
+#if @GNULIB_STRTOUMAX@
+# if !@HAVE_DECL_STRTOUMAX@
+#  undef strtoumax
+_GL_FUNCDECL_SYS (strtoumax, uintmax_t,
+                  (const char *, char **, int) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtoumax, uintmax_t, (const char *, char **, int));
+_GL_CXXALIASWARN (strtoumax);
+#elif defined GNULIB_POSIXCHECK
+# undef strtoumax
+# if HAVE_RAW_DECL_STRTOUMAX
+_GL_WARN_ON_USE (strtoumax, "strtoumax is unportable - "
+                 "use gnulib module strtoumax for portability");
+# endif
+#endif
+
+/* Don't bother defining or declaring wcstoimax and wcstoumax, since
+   wide-character functions like this are hardly ever useful.  */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !defined INTTYPES_H && !defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H */
index a5bfea7..e921e76 100644 (file)
@@ -1,24 +1,22 @@
 /* Determine name of the currently selected locale.
-   Copyright (C) 1995-2011 Free Software Foundation, Inc.
+   Copyright (C) 1995-2012 Free Software Foundation, Inc.
 
-   This program is free software; you can redistribute 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 free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT 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, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-   USA.  */
+   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 Ulrich Drepper <drepper@gnu.org>, 1995.  */
-/* Win32 code written by Tor Lillqvist <tml@iki.fi>.  */
-/* MacOS X code written by Bruno Haible <bruno@clisp.org>.  */
+/* Native Windows code written by Tor Lillqvist <tml@iki.fi>.  */
+/* Mac OS X code written by Bruno Haible <bruno@clisp.org>.  */
 
 #include <config.h>
 
@@ -36,7 +34,7 @@
 #include <string.h>
 
 #if HAVE_USELOCALE
-/* MacOS X 10.5 defines the locale_t type in <xlocale.h>.  */
+/* Mac OS X 10.5 defines the locale_t type in <xlocale.h>.  */
 # if defined __APPLE__ && defined __MACH__
 #  include <xlocale.h>
 # endif
 #endif
 
 #if defined _WIN32 || defined __WIN32__
-# define WIN32_NATIVE
+# define WINDOWS_NATIVE
 #endif
 
-#if defined WIN32_NATIVE || defined __CYGWIN__ /* WIN32 or Cygwin */
+#if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Native Windows or Cygwin */
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
 /* List of language codes, sorted by value:
 
 
 #if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE
-/* MacOS X 10.2 or newer */
+/* Mac OS X 10.2 or newer */
 
-/* Canonicalize a MacOS X locale name to a Unix locale name.
+/* Canonicalize a Mac OS X locale name to a Unix locale name.
    NAME is a sufficiently large buffer.
-   On input, it contains the MacOS X locale name.
+   On input, it contains the Mac OS X locale name.
    On output, it contains the Unix locale name.  */
 # if !defined IN_LIBINTL
 static
@@ -1147,9 +1145,9 @@ gl_locale_name_canonicalize (char *name)
      http://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 MacOS X 10.3, there is no API for doing this.
+     ISO 3166) names.  Prior to Mac OS X 10.3, there is no API for doing this.
      Therefore we do it ourselves, using a table based on the results of the
-     MacOS X 10.3.8 function
+     Mac OS X 10.3.8 function
      CFLocaleCreateCanonicalLocaleIdentifierFromString().  */
   typedef struct { const char legacy[21+1]; const char unixy[5+1]; }
           legacy_entry;
@@ -1292,26 +1290,26 @@ gl_locale_name_canonicalize (char *name)
   typedef struct { const char langtag[7+1]; const char unixy[12+1]; }
           langtag_entry;
   static const langtag_entry langtag_table[] = {
-    /* MacOS X has "az-Arab", "az-Cyrl", "az-Latn".
+    /* Mac OS X has "az-Arab", "az-Cyrl", "az-Latn".
        The default script for az on Unix is Latin.  */
     { "az-Latn", "az" },
-    /* MacOS X has "ga-dots".  Does not yet exist on Unix.  */
+    /* Mac OS X has "ga-dots".  Does not yet exist on Unix.  */
     { "ga-dots", "ga" },
-    /* MacOS X has "kk-Cyrl".  Does not yet exist on Unix.  */
-    /* MacOS X has "mn-Cyrl", "mn-Mong".
+    /* Mac OS X has "kk-Cyrl".  Does not yet exist on Unix.  */
+    /* Mac OS X has "mn-Cyrl", "mn-Mong".
        The default script for mn on Unix is Cyrillic.  */
     { "mn-Cyrl", "mn" },
-    /* MacOS X has "ms-Arab", "ms-Latn".
+    /* Mac OS X has "ms-Arab", "ms-Latn".
        The default script for ms on Unix is Latin.  */
     { "ms-Latn", "ms" },
-    /* MacOS X has "tg-Cyrl".
+    /* Mac OS X has "tg-Cyrl".
        The default script for tg on Unix is Cyrillic.  */
     { "tg-Cyrl", "tg" },
-    /* MacOS X has "tk-Cyrl".  Does not yet exist on Unix.  */
-    /* MacOS X has "tt-Cyrl".
+    /* Mac OS X has "tk-Cyrl".  Does not yet exist on Unix.  */
+    /* Mac OS X has "tt-Cyrl".
        The default script for tt on Unix is Cyrillic.  */
     { "tt-Cyrl", "tt" },
-    /* MacOS X has "zh-Hans", "zh-Hant".
+    /* Mac OS X has "zh-Hans", "zh-Hant".
        Country codes are used to distinguish these on Unix.  */
     { "zh-Hans", "zh_CN" },
     { "zh-Hant", "zh_TW" }
@@ -1407,11 +1405,11 @@ gl_locale_name_canonicalize (char *name)
 #endif
 
 
-#if defined WIN32_NATIVE || defined __CYGWIN__ /* WIN32 or Cygwin */
+#if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Native Windows or Cygwin */
 
-/* Canonicalize a Win32 native locale name to a Unix locale name.
+/* Canonicalize a Windows native locale name to a Unix locale name.
    NAME is a sufficiently large buffer.
-   On input, it contains the Win32 locale name.
+   On input, it contains the Windows locale name.
    On output, it contains the Unix locale name.  */
 # if !defined IN_LIBINTL
 static
@@ -1467,9 +1465,9 @@ gl_locale_name_from_win32_LANGID (LANGID langid)
     }
   /* Internet Explorer has an LCID to RFC3066 name mapping stored in
      HKEY_CLASSES_ROOT\Mime\Database\Rfc1766.  But we better don't use that
-     since IE's i18n subsystem is known to be inconsistent with the Win32 base
-     (e.g. they have different character conversion facilities that produce
-     different results).  */
+     since IE's i18n subsystem is known to be inconsistent with the native
+     Windows base (e.g. they have different character conversion facilities
+     that produce different results).  */
   /* Use our own table.  */
   {
     int primary, sub;
@@ -2507,7 +2505,7 @@ gl_locale_name_from_win32_LCID (LCID lcid)
 #endif
 
 
-#if HAVE_USELOCALE /* glibc or MacOS X */
+#if HAVE_USELOCALE /* glibc or Mac OS X */
 
 /* Simple hash set of strings.  We don't want to drag in lots of hash table
    code here.  */
@@ -2619,20 +2617,20 @@ gl_locale_name_thread_unsafe (int category, const char *categoryname)
           name = thread_locale->__names[category];
         return name;
 #  endif
-#  if defined __APPLE__ && defined __MACH__ /* MacOS X */
+#  if defined __APPLE__ && defined __MACH__ /* Mac OS X */
         /* The locale name is found deep in an undocumented data structure.
            Since it's stored in a buffer of size 32 and newlocale() rejects
            locale names of length > 31, we can assume that it is NUL terminated
            in this buffer. But we need to make a copy of the locale name, of
            indefinite extent.  */
-        struct _xlocale_part1_v0 /* used in MacOS X 10.5 */
+        struct _xlocale_part1_v0 /* used in Mac OS X 10.5 */
           {
             int32_t __refcount;
             void (*__free_extra)(void *);
             __darwin_mbstate_t __mbs[10];
             int64_t __magic;
           };
-        struct _xlocale_part1_v1 /* used in MacOS X >= 10.6.0 */
+        struct _xlocale_part1_v1 /* used in Mac OS X >= 10.6.0 */
           {
             int32_t __refcount;
             void (*__free_extra)(void *);
@@ -2704,18 +2702,18 @@ gl_locale_name_thread_unsafe (int category, const char *categoryname)
         struct _xlocale_part2 *tlp;
         if (((struct _xlocale_part1_v0 *) thread_locale)->__magic
             == 0x786C6F63616C6530LL)
-          /* MacOS X 10.5 */
+          /* Mac OS X 10.5 */
           tlp =
             (struct _xlocale_part2 *)
             &((struct _xlocale_part1_v0 *) thread_locale)->__magic;
         else if (((struct _xlocale_part1_v1 *) thread_locale)->__magic
                  == 0x786C6F63616C6530LL)
-          /* MacOS X >= 10.6.0 */
+          /* Mac OS X >= 10.6.0 */
           tlp =
             (struct _xlocale_part2 *)
             &((struct _xlocale_part1_v1 *) thread_locale)->__magic;
         else
-          /* Unsupported version of MacOS X: The internals of 'struct _xlocale'
+          /* Unsupported version of Mac OS X: The internals of 'struct _xlocale'
              have changed again.  */
           return "";
         switch (category)
@@ -2786,8 +2784,8 @@ gl_locale_name_posix (int category, const char *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
-          (MacOS X, native Windows, Cygwin) and where the system's setlocale()
-          function ignores this default locale (MacOS X, Cygwin), in two cases:
+          (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
@@ -2822,7 +2820,7 @@ gl_locale_name_environ (int category, const char *categoryname)
   if (retval != NULL && retval[0] != '\0')
     {
 #if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE
-      /* MacOS X 10.2 or newer.
+      /* Mac OS X 10.2 or newer.
          Ignore invalid LANG value set by the Terminal application.  */
       if (strcmp (retval, "UTF-8") != 0)
 #endif
@@ -2849,10 +2847,10 @@ gl_locale_name_default (void)
       locale, customizing it for each location.  POSIX:2001 does not require
       such a facility.
 
-     The systems with such a facility are MacOS X and Windows: They provide a
+     The systems with such a facility are Mac OS X and Windows: They provide a
      GUI that allows the user to choose a locale.
-       - On MacOS X, by default, none of LC_* or LANG are set.  Starting with
-         MacOS X 10.4 or 10.5, LANG is set for processes launched by the
+       - On Mac OS X, by default, none of LC_* or LANG are set.  Starting with
+         Mac OS X 10.4 or 10.5, LANG is set for processes launched by the
          'Terminal' application (but sometimes to an incorrect value "UTF-8").
          When no environment variable is set, setlocale (LC_ALL, "") uses the
          "C" locale.
@@ -2868,7 +2866,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 WIN32_NATIVE || defined __CYGWIN__)
+#if !(HAVE_CFLOCALECOPYCURRENT || 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.  */
@@ -2882,7 +2880,7 @@ gl_locale_name_default (void)
      codeset.  */
 
 # if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE
-  /* MacOS X 10.2 or newer */
+  /* Mac OS X 10.2 or newer */
   {
     /* Cache the locale name, since CoreFoundation calls are expensive.  */
     static const char *cached_localename;
@@ -2890,7 +2888,7 @@ gl_locale_name_default (void)
     if (cached_localename == NULL)
       {
         char namebuf[256];
-#  if HAVE_CFLOCALECOPYCURRENT /* MacOS X 10.3 or newer */
+#  if HAVE_CFLOCALECOPYCURRENT /* Mac OS X 10.3 or newer */
         CFLocaleRef locale = CFLocaleCopyCurrent ();
         CFStringRef name = CFLocaleGetIdentifier (locale);
 
@@ -2901,7 +2899,7 @@ gl_locale_name_default (void)
             cached_localename = strdup (namebuf);
           }
         CFRelease (locale);
-#  elif HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.2 or newer */
+#  elif HAVE_CFPREFERENCESCOPYAPPVALUE /* Mac OS X 10.2 or newer */
         CFTypeRef value =
           CFPreferencesCopyAppValue (CFSTR ("AppleLocale"),
                                      kCFPreferencesCurrentApplication);
@@ -2923,11 +2921,11 @@ gl_locale_name_default (void)
 
 # endif
 
-# if defined WIN32_NATIVE || defined __CYGWIN__ /* WIN32 or Cygwin */
+# if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Native Windows or Cygwin */
   {
     LCID lcid;
 
-    /* Use native Win32 API locale ID.  */
+    /* Use native Windows API locale ID.  */
     lcid = GetThreadLocale ();
 
     return gl_locale_name_from_win32_LCID (lcid);
index e754853..330932d 100644 (file)
@@ -1,20 +1,18 @@
 /* Determine name of the currently selected locale.
-   Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
 
-   This program is free software; you can redistribute 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 free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT 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, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-   USA.  */
+   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 _GL_LOCALENAME_H
 #define _GL_LOCALENAME_H
index 8922675..478004c 100644 (file)
@@ -1,5 +1,5 @@
 /* Common macros used by gnulib tests.
-   Copyright (C) 2006-2011 Free Software Foundation, Inc.
+   Copyright (C) 2006-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    *not* work for function parameters of array type, because they are actually
    parameters of pointer type.  */
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
+
+/* STREQ (str1, str2)
+   Return true if two strings compare equal.  */
+#define STREQ(a, b) (strcmp (a, b) == 0)
+
+/* Some numbers in the interval [0,1).  */
+extern const float randomf[1000];
+extern const double randomd[1000];
+extern const long double randoml[1000];
diff --git a/gnulib/tests/msvc-inval.c b/gnulib/tests/msvc-inval.c
new file mode 100644 (file)
index 0000000..ba76a7e
--- /dev/null
@@ -0,0 +1,129 @@
+/* Invalid parameter handler for MSVC runtime libraries.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute 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/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "msvc-inval.h"
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \
+    && !(MSVC_INVALID_PARAMETER_HANDLING == SANE_LIBRARY_HANDLING)
+
+/* Get _invalid_parameter_handler type and _set_invalid_parameter_handler
+   declaration.  */
+# include <stdlib.h>
+
+# if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
+
+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)
+{
+}
+
+# else
+
+/* Get declarations of the native Windows API functions.  */
+#  define WIN32_LEAN_AND_MEAN
+#  include <windows.h>
+
+#  if defined _MSC_VER
+
+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)
+{
+  RaiseException (STATUS_GNULIB_INVALID_PARAMETER, 0, 0, NULL);
+}
+
+#  else
+
+/* An index to thread-local storage.  */
+static DWORD tls_index;
+static int tls_initialized /* = 0 */;
+
+/* Used as a fallback only.  */
+static struct gl_msvc_inval_per_thread not_per_thread;
+
+struct gl_msvc_inval_per_thread *
+gl_msvc_inval_current (void)
+{
+  if (!tls_initialized)
+    {
+      tls_index = TlsAlloc ();
+      tls_initialized = 1;
+    }
+  if (tls_index == TLS_OUT_OF_INDEXES)
+    /* TlsAlloc had failed.  */
+    return &not_per_thread;
+  else
+    {
+      struct gl_msvc_inval_per_thread *pointer =
+        (struct gl_msvc_inval_per_thread *) TlsGetValue (tls_index);
+      if (pointer == NULL)
+        {
+          /* First call.  Allocate a new 'struct gl_msvc_inval_per_thread'.  */
+          pointer =
+            (struct gl_msvc_inval_per_thread *)
+            malloc (sizeof (struct gl_msvc_inval_per_thread));
+          if (pointer == NULL)
+            /* Could not allocate memory.  Use the global storage.  */
+            pointer = &not_per_thread;
+          TlsSetValue (tls_index, pointer);
+        }
+      return pointer;
+    }
+}
+
+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)
+{
+  struct gl_msvc_inval_per_thread *current = gl_msvc_inval_current ();
+  if (current->restart_valid)
+    longjmp (current->restart, 1);
+  else
+    /* An invalid parameter notification from outside the gnulib code.
+       Give the caller a chance to intervene.  */
+    RaiseException (STATUS_GNULIB_INVALID_PARAMETER, 0, 0, NULL);
+}
+
+#  endif
+
+# endif
+
+static int gl_msvc_inval_initialized /* = 0 */;
+
+void
+gl_msvc_inval_ensure_handler (void)
+{
+  if (gl_msvc_inval_initialized == 0)
+    {
+      _set_invalid_parameter_handler (gl_msvc_invalid_parameter_handler);
+      gl_msvc_inval_initialized = 1;
+    }
+}
+
+#endif
diff --git a/gnulib/tests/msvc-inval.h b/gnulib/tests/msvc-inval.h
new file mode 100644 (file)
index 0000000..eb6930b
--- /dev/null
@@ -0,0 +1,222 @@
+/* Invalid parameter handler for MSVC runtime libraries.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute 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/>.  */
+
+#ifndef _MSVC_INVAL_H
+#define _MSVC_INVAL_H
+
+/* With MSVC runtime libraries with the "invalid parameter handler" concept,
+   functions like fprintf(), dup2(), or close() crash when the caller passes
+   an invalid argument.  But POSIX wants error codes (such as EINVAL or EBADF)
+   instead.
+   This file defines macros that turn such an invalid parameter notification
+   into a non-local exit.  An error code can then be produced at the target
+   of this exit.  You can thus write code like
+
+     TRY_MSVC_INVAL
+       {
+         <Code that can trigger an invalid parameter notification
+          but does not do 'return', 'break', 'continue', nor 'goto'.>
+       }
+     CATCH_MSVC_INVAL
+       {
+         <Code that handles an invalid parameter notification
+          but does not do 'return', 'break', 'continue', nor 'goto'.>
+       }
+     DONE_MSVC_INVAL;
+
+   This entire block expands to a single statement.
+
+   The handling of invalid parameters can be done in three ways:
+
+     * The default way, which is reasonable for programs (not libraries):
+       AC_DEFINE([MSVC_INVALID_PARAMETER_HANDLING], [DEFAULT_HANDLING])
+
+     * The way for libraries that make "hairy" calls (like close(-1), or
+       fclose(fp) where fileno(fp) is closed, or simply getdtablesize()):
+       AC_DEFINE([MSVC_INVALID_PARAMETER_HANDLING], [HAIRY_LIBRARY_HANDLING])
+
+     * The way for libraries that make no "hairy" calls:
+       AC_DEFINE([MSVC_INVALID_PARAMETER_HANDLING], [SANE_LIBRARY_HANDLING])
+ */
+
+#define DEFAULT_HANDLING       0
+#define HAIRY_LIBRARY_HANDLING 1
+#define SANE_LIBRARY_HANDLING  2
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \
+    && !(MSVC_INVALID_PARAMETER_HANDLING == SANE_LIBRARY_HANDLING)
+/* A native Windows platform with the "invalid parameter handler" concept,
+   and either DEFAULT_HANDLING or HAIRY_LIBRARY_HANDLING.  */
+
+# if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
+/* Default handling.  */
+
+#  ifdef __cplusplus
+extern "C" {
+#  endif
+
+/* Ensure that the invalid parameter handler in installed that just returns.
+   Because we assume no other part of the program installs a different
+   invalid parameter handler, this solution is multithread-safe.  */
+extern void gl_msvc_inval_ensure_handler (void);
+
+#  ifdef __cplusplus
+}
+#  endif
+
+#  define TRY_MSVC_INVAL \
+     do                                                                        \
+       {                                                                       \
+         gl_msvc_inval_ensure_handler ();                                      \
+         if (1)
+#  define CATCH_MSVC_INVAL \
+         else
+#  define DONE_MSVC_INVAL \
+       }                                                                       \
+     while (0)
+
+# else
+/* Handling for hairy libraries.  */
+
+#  include <excpt.h>
+
+/* 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>.
+   Our status codes are composed of
+     - 0xE0000000, mandatory for all user-defined status codes,
+     - 0x474E550, a API identifier ("GNU"),
+     - 0, 1, 2, ..., used to distinguish different status codes from the
+       same API.  */
+#  define STATUS_GNULIB_INVALID_PARAMETER (0xE0000000 + 0x474E550 + 0)
+
+#  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>.
+   With __try/__except, we can use the multithread-safe exception handling.  */
+
+#   ifdef __cplusplus
+extern "C" {
+#   endif
+
+/* Ensure that the invalid parameter handler in installed that raises a
+   software exception with code STATUS_GNULIB_INVALID_PARAMETER.
+   Because we assume no other part of the program installs a different
+   invalid parameter handler, this solution is multithread-safe.  */
+extern void gl_msvc_inval_ensure_handler (void);
+
+#   ifdef __cplusplus
+}
+#   endif
+
+#   define TRY_MSVC_INVAL \
+      do                                                                       \
+        {                                                                      \
+          gl_msvc_inval_ensure_handler ();                                     \
+          __try
+#   define CATCH_MSVC_INVAL \
+          __except (GetExceptionCode () == STATUS_GNULIB_INVALID_PARAMETER     \
+                    ? EXCEPTION_EXECUTE_HANDLER                                \
+                    : EXCEPTION_CONTINUE_SEARCH)
+#   define DONE_MSVC_INVAL \
+        }                                                                      \
+      while (0)
+
+#  else
+/* Any compiler.
+   We can only use setjmp/longjmp.  */
+
+#   include <setjmp.h>
+
+#   ifdef __cplusplus
+extern "C" {
+#   endif
+
+struct gl_msvc_inval_per_thread
+{
+  /* The restart that will resume execution at the code between
+     CATCH_MSVC_INVAL and DONE_MSVC_INVAL.  It is enabled only between
+     TRY_MSVC_INVAL and CATCH_MSVC_INVAL.  */
+  jmp_buf restart;
+
+  /* Tells whether the contents of restart is valid.  */
+  int restart_valid;
+};
+
+/* Ensure that the invalid parameter handler in installed that passes
+   control to the gl_msvc_inval_restart if it is valid, or raises a
+   software exception with code STATUS_GNULIB_INVALID_PARAMETER otherwise.
+   Because we assume no other part of the program installs a different
+   invalid parameter handler, this solution is multithread-safe.  */
+extern void gl_msvc_inval_ensure_handler (void);
+
+/* Return a pointer to the per-thread data for the current thread.  */
+extern struct gl_msvc_inval_per_thread *gl_msvc_inval_current (void);
+
+#   ifdef __cplusplus
+}
+#   endif
+
+#   define TRY_MSVC_INVAL \
+      do                                                                       \
+        {                                                                      \
+          struct gl_msvc_inval_per_thread *msvc_inval_current;                 \
+          gl_msvc_inval_ensure_handler ();                                     \
+          msvc_inval_current = gl_msvc_inval_current ();                       \
+          /* First, initialize gl_msvc_inval_restart.  */                      \
+          if (setjmp (msvc_inval_current->restart) == 0)                       \
+            {                                                                  \
+              /* Then, mark it as valid.  */                                   \
+              msvc_inval_current->restart_valid = 1;
+#   define CATCH_MSVC_INVAL \
+              /* Execution completed.                                          \
+                 Mark gl_msvc_inval_restart as invalid.  */                    \
+              msvc_inval_current->restart_valid = 0;                           \
+            }                                                                  \
+          else                                                                 \
+            {                                                                  \
+              /* Execution triggered an invalid parameter notification.        \
+                 Mark gl_msvc_inval_restart as invalid.  */                    \
+              msvc_inval_current->restart_valid = 0;
+#   define DONE_MSVC_INVAL \
+            }                                                                  \
+        }                                                                      \
+      while (0)
+
+#  endif
+
+# endif
+
+#else
+/* A platform that does not need to the invalid parameter handler,
+   or when SANE_LIBRARY_HANDLING is desired.  */
+
+/* The braces here avoid GCC warnings like
+   "warning: suggest explicit braces to avoid ambiguous 'else'".  */
+# define TRY_MSVC_INVAL \
+    do                                                                         \
+      {                                                                        \
+        if (1)
+# define CATCH_MSVC_INVAL \
+        else
+# define DONE_MSVC_INVAL \
+      }                                                                        \
+    while (0)
+
+#endif
+
+#endif /* _MSVC_INVAL_H */
diff --git a/gnulib/tests/msvc-nothrow.c b/gnulib/tests/msvc-nothrow.c
new file mode 100644 (file)
index 0000000..e5cf181
--- /dev/null
@@ -0,0 +1,49 @@
+/* Wrappers that don't throw invalid parameter notifications
+   with MSVC runtime libraries.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute 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/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "msvc-nothrow.h"
+
+/* Get declarations of the native Windows API functions.  */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include "msvc-inval.h"
+
+#undef _get_osfhandle
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+intptr_t
+_gl_nothrow_get_osfhandle (int fd)
+{
+  intptr_t result;
+
+  TRY_MSVC_INVAL
+    {
+      result = _get_osfhandle (fd);
+    }
+  CATCH_MSVC_INVAL
+    {
+      result = (intptr_t) INVALID_HANDLE_VALUE;
+    }
+  DONE_MSVC_INVAL;
+
+  return result;
+}
+#endif
diff --git a/gnulib/tests/msvc-nothrow.h b/gnulib/tests/msvc-nothrow.h
new file mode 100644 (file)
index 0000000..2b71945
--- /dev/null
@@ -0,0 +1,43 @@
+/* Wrappers that don't throw invalid parameter notifications
+   with MSVC runtime libraries.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute 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/>.  */
+
+#ifndef _MSVC_NOTHROW_H
+#define _MSVC_NOTHROW_H
+
+/* With MSVC runtime libraries with the "invalid parameter handler" concept,
+   functions like fprintf(), dup2(), or close() crash when the caller passes
+   an invalid argument.  But POSIX wants error codes (such as EINVAL or EBADF)
+   instead.
+   This file defines wrappers that turn such an invalid parameter notification
+   into an error code.  */
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
+/* Get original declaration of _get_osfhandle.  */
+# include <io.h>
+
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+
+/* Override _get_osfhandle.  */
+extern intptr_t _gl_nothrow_get_osfhandle (int fd);
+#  define _get_osfhandle _gl_nothrow_get_osfhandle
+
+# endif
+
+#endif
+
+#endif /* _MSVC_NOTHROW_H */
index 2e2cc74..27801b9 100644 (file)
@@ -1,5 +1,5 @@
 /* Open a descriptor to a file.
-   Copyright (C) 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
+/* If the user's config.h happens to include <fcntl.h>, let it include only
+   the system's <fcntl.h> here, so that orig_open doesn't recurse to
+   rpl_open.  */
+#define __need_system_fcntl_h
 #include <config.h>
 
 /* Get the original definition of open.  It might be defined as a macro.  */
-#define __need_system_fcntl_h
 #include <fcntl.h>
-#undef __need_system_fcntl_h
 #include <sys/types.h>
+#undef __need_system_fcntl_h
 
 static inline int
 orig_open (const char *filename, int flags, mode_t mode)
@@ -31,7 +34,9 @@ orig_open (const char *filename, int flags, mode_t mode)
 }
 
 /* Specification.  */
-#include <fcntl.h>
+/* 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 <stdarg.h>
@@ -63,6 +68,15 @@ open (const char *filename, int flags, ...)
       va_end (arg);
     }
 
+#if GNULIB_defined_O_NONBLOCK
+  /* The only known platform that lacks O_NONBLOCK is mingw, but it
+     also lacks named pipes and Unix sockets, which are the only two
+     file types that require non-blocking handling in open().
+     Therefore, it is safe to ignore O_NONBLOCK here.  It is handy
+     that mingw also lacks openat(), so that is also covered here.  */
+  flags &= ~O_NONBLOCK;
+#endif
+
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
   if (strcmp (filename, "/dev/null") == 0)
     filename = "NUL";
index 68e5fec..3c0f7ea 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2011 Free Software
+/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2012 Free Software
    Foundation, Inc.
 
    NOTE: The canonical source of this file is maintained with the GNU C
 #include <string.h>
 #include <unistd.h>
 
-#if HAVE_GNU_LD
-# define environ __environ
-#else
+#if _LIBC
+# if HAVE_GNU_LD
+#  define environ __environ
+# else
 extern char **environ;
+# endif
 #endif
 
 #if _LIBC
-/* This lock protects against simultaneous modifications of `environ'.  */
+/* This lock protects against simultaneous modifications of 'environ'.  */
 # include <bits/libc-lock.h>
 __libc_lock_define_initialized (static, envlock)
 # define LOCK   __libc_lock_lock (envlock)
@@ -89,7 +91,7 @@ _unsetenv (const char *name)
 
 
 /* Put STRING, which is of the form "NAME=VALUE", in the environment.
-   If STRING contains no `=', then remove STRING from the environment.  */
+   If STRING contains no '=', then remove STRING from the environment.  */
 int
 putenv (char *string)
 {
index d434b94..8c3900d 100644 (file)
@@ -1,6 +1,6 @@
 /* Determine whether two stat buffers refer to the same file.
 
-   Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #ifndef SAME_INODE_H
 # define SAME_INODE_H 1
 
-# define SAME_INODE(Stat_buf_1, Stat_buf_2) \
-   ((Stat_buf_1).st_ino == (Stat_buf_2).st_ino \
-    && (Stat_buf_1).st_dev == (Stat_buf_2).st_dev)
+# ifdef __VMS
+#  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)
+# else
+#  define SAME_INODE(a, b)    \
+    ((a).st_ino == (b).st_ino \
+     && (a).st_dev == (b).st_dev)
+# endif
 
 #endif
index 7c06192..8201be2 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995-2003, 2005-2011 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995-2003, 2005-2012 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
@@ -15,6 +15,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #if !_LIBC
+# define _GL_USE_STDLIB_ALLOC 1
 # include <config.h>
 #endif
 
@@ -48,7 +49,7 @@
 #endif
 
 #if _LIBC
-/* This lock protects against simultaneous modifications of `environ'.  */
+/* This lock protects against simultaneous modifications of 'environ'.  */
 # include <bits/libc-lock.h>
 __libc_lock_define_initialized (static, envlock)
 # define LOCK   __libc_lock_lock (envlock)
@@ -64,10 +65,6 @@ __libc_lock_define_initialized (static, envlock)
 # define clearenv __clearenv
 # define tfind __tfind
 # define tsearch __tsearch
-#else
-/* Use the system functions, not the gnulib overrides in this file.  */
-# undef malloc
-# undef realloc
 #endif
 
 /* In the GNU C library implementation we try to be more clever and
@@ -106,11 +103,11 @@ static void *known_values;
 static char **last_environ;
 
 
-/* This function is used by `setenv' and `putenv'.  The difference between
+/* This function is used by 'setenv' and 'putenv'.  The difference between
    the two functions is that for the former must create a new string which
-   is then placed in the environment, while the argument of `putenv'
+   is then placed in the environment, while the argument of 'putenv'
    must be used directly.  This is all complicated by the fact that we try
-   to reuse values once generated for a `setenv' call since we can never
+   to reuse values once generated for a 'setenv' call since we can never
    free the strings.  */
 int
 __add_to_environ (const char *name, const char *value, const char *combined,
@@ -302,7 +299,7 @@ setenv (const char *name, const char *value, int replace)
   return __add_to_environ (name, value, NULL, replace);
 }
 
-/* The `clearenv' was planned to be added to POSIX.1 but probably
+/* The 'clearenv' was planned to be added to POSIX.1 but probably
    never made it.  Nevertheless the POSIX.9 standard (POSIX bindings
    for Fortran 77) requires this function.  */
 int
@@ -353,6 +350,9 @@ weak_alias (__clearenv, clearenv)
 #if HAVE_SETENV
 
 # undef setenv
+# if !HAVE_DECL_SETENV
+extern int setenv (const char *, const char *, int);
+# endif
 # define STREQ(a, b) (strcmp (a, b) == 0)
 
 int
index 0cef00f..8a47cde 100644 (file)
@@ -1,5 +1,5 @@
 /* Set the current locale.
-   Copyright (C) 2009, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2011-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -74,7 +74,7 @@ category_to_name (int category)
 
 # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 
-/* The native Win32 setlocale() function expects locale names of the form
+/* 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.
index 8256989..d9d8b47 100644 (file)
@@ -1,5 +1,5 @@
 /* Macro for checking that a function declaration is compliant.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 2896cc9..642ca66 100644 (file)
@@ -1,5 +1,5 @@
 /* Stub for symlink().
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 5aa1645..6b9a4d7 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of optional automatic memory allocation.
-   Copyright (C) 2005, 2007, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -44,7 +44,7 @@ main ()
     {
       /* Try various values.
          n = 0 gave a crash on Alpha with gcc-2.5.8.
-         Some versions of MacOS X have a stack size limit of 512 KB.  */
+         Some versions of Mac OS X have a stack size limit of 512 KB.  */
       func (34);
       func (134);
       func (399);
index 8e5d193..4f284e7 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of binary mode I/O.
-   Copyright (C) 2005, 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #include "macros.h"
 
 int
-main ()
+main (int argc, char *argv[])
 {
   /* Test the O_BINARY macro.  */
   {
     int fd =
-      open ("t-bin-out2.tmp", O_CREAT | O_TRUNC | O_RDWR | O_BINARY, 0600);
+      open ("t-bin-out0.tmp", O_CREAT | O_TRUNC | O_RDWR | O_BINARY, 0600);
     if (write (fd, "Hello\n", 6) < 0)
       exit (1);
     close (fd);
   }
   {
     struct stat statbuf;
-    if (stat ("t-bin-out2.tmp", &statbuf) < 0)
+    if (stat ("t-bin-out0.tmp", &statbuf) < 0)
       exit (1);
     ASSERT (statbuf.st_size == 6);
   }
-  unlink ("t-bin-out2.tmp");
 
-  /* Test the SET_BINARY macro.  */
-  SET_BINARY (1);
-  fputs ("Hello\n", stdout);
-  fclose (stdout);
-  fclose (stderr);
-  {
-    struct stat statbuf;
-    if (stat ("t-bin-out1.tmp", &statbuf) < 0)
-      exit (1);
-    ASSERT (statbuf.st_size == 6);
-  }
+  switch (argv[1][0])
+    {
+    case '1':
+      /* Test the set_binary_mode() function.  */
+      set_binary_mode (1, O_BINARY);
+      fputs ("Hello\n", stdout);
+      break;
+
+    case '2':
+      /* Test the SET_BINARY macro.  */
+      SET_BINARY (1);
+      fputs ("Hello\n", stdout);
+      break;
+
+    default:
+      break;
+    }
 
   return 0;
 }
index 33e128c..c4dd6e9 100755 (executable)
@@ -3,8 +3,11 @@
 tmpfiles=""
 trap 'rm -fr $tmpfiles' 1 2 3 15
 
-tmpfiles="$tmpfiles t-bin-out1.tmp t-bin-out2.tmp"
-./test-binary-io${EXEEXT} > t-bin-out1.tmp || exit 1
+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
+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
 
index 7907cbe..845fe06 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of conversion of unibyte character to wide character.
-   Copyright (C) 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 9d748ff..a9cb655 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of character handling in C locale.
-   Copyright (C) 2005, 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index faa3001..1eb5958 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of case-insensitive string comparison function.
-   Copyright (C) 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 6a225c7..479528b 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of case-insensitive string comparison function.
-   Copyright (C) 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 17cdff0..7497e24 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of execution of program termination handlers.
-   Copyright (C) 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/gnulib/tests/test-close.c b/gnulib/tests/test-close.c
new file mode 100644 (file)
index 0000000..83f71c0
--- /dev/null
@@ -0,0 +1,44 @@
+/* Test closing a file or socket.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (close, int, (int));
+
+#include <errno.h>
+
+#include "macros.h"
+
+int
+main (void)
+{
+  /* Test behaviour for invalid file descriptors.  */
+  {
+    errno = 0;
+    ASSERT (close (-1) == -1);
+    ASSERT (errno == EBADF);
+  }
+  {
+    errno = 0;
+    ASSERT (close (99) == -1);
+    ASSERT (errno == EBADF);
+  }
+
+  return 0;
+}
index 0a5cb19..d6cdff9 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <ctype.h> substitute.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index e2ad88b..5043c0c 100644 (file)
@@ -1,5 +1,5 @@
 /* Test duplicating file descriptors.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -33,9 +33,11 @@ SIGNATURE_CHECK (dup2, int, (int, int));
 #endif
 
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-/* Get declarations of the Win32 API functions.  */
+/* Get declarations of the native Windows API functions.  */
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
+/* Get _get_osfhandle.  */
+# include "msvc-nothrow.h"
 #endif
 
 #include "macros.h"
@@ -45,7 +47,7 @@ static int
 is_open (int fd)
 {
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-  /* On Win32, the initial state of unassigned standard file
+  /* 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;
@@ -63,7 +65,7 @@ static int
 is_inheritable (int fd)
 {
 # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-  /* On Win32, the initial state of unassigned standard file
+  /* 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.  */
   HANDLE h = (HANDLE) _get_osfhandle (fd);
@@ -121,6 +123,9 @@ main (void)
   ASSERT (dup2 (-1, fd) == -1);
   ASSERT (errno == EBADF);
   errno = 0;
+  ASSERT (dup2 (99, fd) == -1);
+  ASSERT (errno == EBADF);
+  errno = 0;
   ASSERT (dup2 (AT_FDCWD, fd) == -1);
   ASSERT (errno == EBADF);
   ASSERT (is_open (fd));
index 11df789..972ed06 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of environ variable.
-   Copyright (C) 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 7851c22..8d00717 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <errno.h> substitute.
-   Copyright (C) 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -98,6 +98,8 @@ int e115 = EINPROGRESS;
 int e116 = ESTALE;
 int e122 = EDQUOT;
 int e125 = ECANCELED;
+int e130 = EOWNERDEAD;
+int e131 = ENOTRECOVERABLE;
 
 /* Don't verify that these errno values are all different, except for possibly
    EWOULDBLOCK == EAGAIN.  Even Linux/x86 does not pass this check: it has
index dd20fbb..00c5468 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <fcntl.h> substitute.
-   Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -29,10 +29,93 @@ int o = O_DIRECT | O_DIRECTORY | O_DSYNC | O_NDELAY | O_NOATIME | O_NONBLOCK
 int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
 
 /* Check that the FD_* macros are defined.  */
-int fd = FD_CLOEXEC;
+int i = FD_CLOEXEC;
+
+/* Check that the types are all defined.  */
+pid_t t1;
+off_t t2;
+mode_t t3;
 
 int
 main (void)
 {
-  return 0;
+  /* Ensure no overlap in SEEK_*. */
+  switch (0)
+    {
+    case SEEK_CUR:
+    case SEEK_END:
+    case SEEK_SET:
+      ;
+    }
+
+  /* Ensure no dangerous overlap in non-zero gnulib-defined replacements.  */
+  switch (O_RDONLY)
+    {
+      /* Access modes */
+    case O_RDONLY:
+    case O_WRONLY:
+    case O_RDWR:
+#if O_EXEC && O_EXEC != O_RDONLY
+    case O_EXEC:
+#endif
+#if O_SEARCH && O_EXEC != O_SEARCH && O_SEARCH != O_RDONLY
+    case O_SEARCH:
+#endif
+      i = O_ACCMODE == (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH);
+      break;
+
+      /* Everyone should have these */
+    case O_CREAT:
+    case O_EXCL:
+    case O_TRUNC:
+    case O_APPEND:
+      break;
+
+      /* These might be 0 or O_RDONLY, only test non-zero versions.  */
+#if O_CLOEXEC
+    case O_CLOEXEC:
+#endif
+#if O_DIRECT
+    case O_DIRECT:
+#endif
+#if O_DIRECTORY
+    case O_DIRECTORY:
+#endif
+#if O_DSYNC
+    case O_DSYNC:
+#endif
+#if O_NOATIME
+    case O_NOATIME:
+#endif
+#if O_NONBLOCK
+    case O_NONBLOCK:
+#endif
+#if O_NOCTTY
+    case O_NOCTTY:
+#endif
+#if O_NOFOLLOW
+    case O_NOFOLLOW:
+#endif
+#if O_NOLINKS
+    case O_NOLINKS:
+#endif
+#if O_RSYNC && O_RSYNC != O_DSYNC
+    case O_RSYNC:
+#endif
+#if O_SYNC && O_SYNC != O_RSYNC
+    case O_SYNC:
+#endif
+#if O_TTY_INIT
+    case O_TTY_INIT:
+#endif
+#if O_BINARY
+    case O_BINARY:
+#endif
+#if O_TEXT
+    case O_TEXT:
+#endif
+      ;
+    }
+
+  return !i;
 }
diff --git a/gnulib/tests/test-fdopen.c b/gnulib/tests/test-fdopen.c
new file mode 100644 (file)
index 0000000..8e2f7bf
--- /dev/null
@@ -0,0 +1,54 @@
+/* Test opening a stream with a file descriptor.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (fdopen, FILE *, (int, const char *));
+
+#include <errno.h>
+
+#include "macros.h"
+
+int
+main (void)
+{
+  /* Test behaviour for invalid file descriptors.  */
+  {
+    FILE *fp;
+
+    errno = 0;
+    fp = fdopen (-1, "r");
+    if (fp == NULL)
+      ASSERT (errno == EBADF);
+    else
+      fclose (fp);
+  }
+  {
+    FILE *fp;
+
+    errno = 0;
+    fp = fdopen (99, "r");
+    if (fp == NULL)
+      ASSERT (errno == EBADF);
+    else
+      fclose (fp);
+  }
+
+  return 0;
+}
diff --git a/gnulib/tests/test-fgetc.c b/gnulib/tests/test-fgetc.c
new file mode 100644 (file)
index 0000000..f7ebbc6
--- /dev/null
@@ -0,0 +1,95 @@
+/* Test of fgetc() function.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute 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/>.  */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (fgetc, int, (FILE *));
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "msvc-inval.h"
+
+#include "macros.h"
+
+int
+main (int argc, char **argv)
+{
+  const char *filename = "test-fgetc.txt";
+
+  /* We don't have an fgetc() function that installs an invalid parameter
+     handler so far.  So install that handler here, explicitly.  */
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \
+    && MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
+  gl_msvc_inval_ensure_handler ();
+#endif
+
+  /* Prepare a file.  */
+  {
+    const char text[] = "hello world";
+    int fd = open (filename, O_RDWR | O_CREAT | O_TRUNC, 0600);
+    ASSERT (fd >= 0);
+    ASSERT (write (fd, text, sizeof (text)) == sizeof (text));
+    ASSERT (close (fd) == 0);
+  }
+
+  /* Test that fgetc() sets errno if someone else closes the stream
+     fd behind the back of stdio.  */
+  {
+    FILE *fp = fopen (filename, "r");
+    ASSERT (fp != NULL);
+    ASSERT (close (fileno (fp)) == 0);
+    errno = 0;
+    ASSERT (fgetc (fp) == EOF);
+    ASSERT (errno == EBADF);
+    ASSERT (ferror (fp));
+    fclose (fp);
+  }
+
+  /* Test that fgetc() sets errno if the stream was constructed with
+     an invalid file descriptor.  */
+  {
+    FILE *fp = fdopen (-1, "r");
+    if (fp != NULL)
+      {
+        errno = 0;
+        ASSERT (fgetc (fp) == EOF);
+        ASSERT (errno == EBADF);
+        ASSERT (ferror (fp));
+        fclose (fp);
+      }
+  }
+  {
+    FILE *fp = fdopen (99, "r");
+    if (fp != NULL)
+      {
+        errno = 0;
+        ASSERT (fgetc (fp) == EOF);
+        ASSERT (errno == EBADF);
+        ASSERT (ferror (fp));
+        fclose (fp);
+      }
+  }
+
+  /* Clean up.  */
+  unlink (filename);
+
+  return 0;
+}
diff --git a/gnulib/tests/test-float.c b/gnulib/tests/test-float.c
new file mode 100644 (file)
index 0000000..f3691be
--- /dev/null
@@ -0,0 +1,384 @@
+/* Test of <float.h> substitute.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   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>, 2011.  */
+
+#include <config.h>
+
+#include <float.h>
+
+#include "fpucw.h"
+#include "macros.h"
+
+/* Check that FLT_RADIX is a constant expression.  */
+int a[] = { FLT_RADIX };
+
+#if FLT_RADIX == 2
+
+/* Return 2^n.  */
+static float
+pow2f (int n)
+{
+  int k = n;
+  volatile float x = 1;
+  volatile float y = 2;
+  /* Invariant: 2^n == x * y^k.  */
+  if (k < 0)
+    {
+      y = 0.5f;
+      k = - k;
+    }
+  while (k > 0)
+    {
+      if (k != 2 * (k / 2))
+        {
+          x = x * y;
+          k = k - 1;
+        }
+      if (k == 0)
+        break;
+      y = y * y;
+      k = k / 2;
+    }
+  /* Now k == 0, hence x == 2^n.  */
+  return x;
+}
+
+/* Return 2^n.  */
+static double
+pow2d (int n)
+{
+  int k = n;
+  volatile double x = 1;
+  volatile double y = 2;
+  /* Invariant: 2^n == x * y^k.  */
+  if (k < 0)
+    {
+      y = 0.5;
+      k = - k;
+    }
+  while (k > 0)
+    {
+      if (k != 2 * (k / 2))
+        {
+          x = x * y;
+          k = k - 1;
+        }
+      if (k == 0)
+        break;
+      y = y * y;
+      k = k / 2;
+    }
+  /* Now k == 0, hence x == 2^n.  */
+  return x;
+}
+
+/* Return 2^n.  */
+static long double
+pow2l (int n)
+{
+  int k = n;
+  volatile long double x = 1;
+  volatile long double y = 2;
+  /* Invariant: 2^n == x * y^k.  */
+  if (k < 0)
+    {
+      y = 0.5L;
+      k = - k;
+    }
+  while (k > 0)
+    {
+      if (k != 2 * (k / 2))
+        {
+          x = x * y;
+          k = k - 1;
+        }
+      if (k == 0)
+        break;
+      y = y * y;
+      k = k / 2;
+    }
+  /* Now k == 0, hence x == 2^n.  */
+  return x;
+}
+
+/* ----------------------- Check macros for 'float' ----------------------- */
+
+/* Check that the FLT_* macros expand to constant expressions.  */
+int fb[] =
+  {
+    FLT_MANT_DIG, FLT_MIN_EXP, FLT_MAX_EXP,
+    FLT_DIG, FLT_MIN_10_EXP, FLT_MAX_10_EXP
+  };
+float fc[] = { FLT_EPSILON, FLT_MIN, FLT_MAX };
+
+static void
+test_float (void)
+{
+  /* Check that the value of FLT_MIN_EXP is well parenthesized.  */
+  ASSERT ((FLT_MIN_EXP % 101111) == (FLT_MIN_EXP) % 101111);
+
+  /* Check that the value of DBL_MIN_10_EXP is well parenthesized.  */
+  ASSERT ((FLT_MIN_10_EXP % 101111) == (FLT_MIN_10_EXP) % 101111);
+
+  /* Check that 'float' is as specified in IEEE 754.  */
+  ASSERT (FLT_MANT_DIG == 24);
+  ASSERT (FLT_MIN_EXP == -125);
+  ASSERT (FLT_MAX_EXP == 128);
+
+  /* Check the value of FLT_MIN_10_EXP.  */
+  ASSERT (FLT_MIN_10_EXP == - (int) (- (FLT_MIN_EXP - 1) * 0.30103));
+
+  /* Check the value of FLT_DIG.  */
+  ASSERT (FLT_DIG == (int) ((FLT_MANT_DIG - 1) * 0.30103));
+
+  /* Check the value of FLT_MIN_10_EXP.  */
+  ASSERT (FLT_MIN_10_EXP == - (int) (- (FLT_MIN_EXP - 1) * 0.30103));
+
+  /* Check the value of FLT_MAX_10_EXP.  */
+  ASSERT (FLT_MAX_10_EXP == (int) (FLT_MAX_EXP * 0.30103));
+
+  /* Check the value of FLT_MAX.  */
+  {
+    volatile float m = FLT_MAX;
+    int n;
+
+    ASSERT (m + m > m);
+    for (n = 0; n <= 2 * FLT_MANT_DIG; n++)
+      {
+        volatile float pow2_n = pow2f (n); /* 2^n */
+        volatile float x = m + (m / pow2_n);
+        if (x > m)
+          ASSERT (x + x == x);
+        else
+          ASSERT (!(x + x == x));
+      }
+  }
+
+  /* Check the value of FLT_MIN.  */
+  {
+    volatile float m = FLT_MIN;
+    volatile float x = pow2f (FLT_MIN_EXP - 1);
+    ASSERT (m == x);
+  }
+
+  /* Check the value of FLT_EPSILON.  */
+  {
+    volatile float e = FLT_EPSILON;
+    volatile float me;
+    int n;
+
+    me = 1.0f + e;
+    ASSERT (me > 1.0f);
+    ASSERT (me - 1.0f == e);
+    for (n = 0; n <= 2 * FLT_MANT_DIG; n++)
+      {
+        volatile float half_n = pow2f (- n); /* 2^-n */
+        volatile float x = me - half_n;
+        if (x < me)
+          ASSERT (x <= 1.0f);
+      }
+  }
+}
+
+/* ----------------------- Check macros for 'double' ----------------------- */
+
+/* Check that the DBL_* macros expand to constant expressions.  */
+int db[] =
+  {
+    DBL_MANT_DIG, DBL_MIN_EXP, DBL_MAX_EXP,
+    DBL_DIG, DBL_MIN_10_EXP, DBL_MAX_10_EXP
+  };
+double dc[] = { DBL_EPSILON, DBL_MIN, DBL_MAX };
+
+static void
+test_double (void)
+{
+  /* Check that the value of DBL_MIN_EXP is well parenthesized.  */
+  ASSERT ((DBL_MIN_EXP % 101111) == (DBL_MIN_EXP) % 101111);
+
+  /* Check that the value of DBL_MIN_10_EXP is well parenthesized.  */
+  ASSERT ((DBL_MIN_10_EXP % 101111) == (DBL_MIN_10_EXP) % 101111);
+
+  /* Check that 'double' is as specified in IEEE 754.  */
+  ASSERT (DBL_MANT_DIG == 53);
+  ASSERT (DBL_MIN_EXP == -1021);
+  ASSERT (DBL_MAX_EXP == 1024);
+
+  /* Check the value of DBL_MIN_10_EXP.  */
+  ASSERT (DBL_MIN_10_EXP == - (int) (- (DBL_MIN_EXP - 1) * 0.30103));
+
+  /* Check the value of DBL_DIG.  */
+  ASSERT (DBL_DIG == (int) ((DBL_MANT_DIG - 1) * 0.30103));
+
+  /* Check the value of DBL_MIN_10_EXP.  */
+  ASSERT (DBL_MIN_10_EXP == - (int) (- (DBL_MIN_EXP - 1) * 0.30103));
+
+  /* Check the value of DBL_MAX_10_EXP.  */
+  ASSERT (DBL_MAX_10_EXP == (int) (DBL_MAX_EXP * 0.30103));
+
+  /* Check the value of DBL_MAX.  */
+  {
+    volatile double m = DBL_MAX;
+    int n;
+
+    ASSERT (m + m > m);
+    for (n = 0; n <= 2 * DBL_MANT_DIG; n++)
+      {
+        volatile double pow2_n = pow2d (n); /* 2^n */
+        volatile double x = m + (m / pow2_n);
+        if (x > m)
+          ASSERT (x + x == x);
+        else
+          ASSERT (!(x + x == x));
+      }
+  }
+
+  /* Check the value of DBL_MIN.  */
+  {
+    volatile double m = DBL_MIN;
+    volatile double x = pow2d (DBL_MIN_EXP - 1);
+    ASSERT (m == x);
+  }
+
+  /* Check the value of DBL_EPSILON.  */
+  {
+    volatile double e = DBL_EPSILON;
+    volatile double me;
+    int n;
+
+    me = 1.0 + e;
+    ASSERT (me > 1.0);
+    ASSERT (me - 1.0 == e);
+    for (n = 0; n <= 2 * DBL_MANT_DIG; n++)
+      {
+        volatile double half_n = pow2d (- n); /* 2^-n */
+        volatile double x = me - half_n;
+        if (x < me)
+          ASSERT (x <= 1.0);
+      }
+  }
+}
+
+/* -------------------- Check macros for 'long double' -------------------- */
+
+/* Check that the LDBL_* macros expand to constant expressions.  */
+int lb[] =
+  {
+    LDBL_MANT_DIG, LDBL_MIN_EXP, LDBL_MAX_EXP,
+    LDBL_DIG, LDBL_MIN_10_EXP, LDBL_MAX_10_EXP
+  };
+long double lc1 = LDBL_EPSILON;
+long double lc2 = LDBL_MIN;
+#if 0 /* LDBL_MAX is not a constant expression on some platforms.  */
+long double lc3 = LDBL_MAX;
+#endif
+
+static void
+test_long_double (void)
+{
+  /* Check that the value of LDBL_MIN_EXP is well parenthesized.  */
+  ASSERT ((LDBL_MIN_EXP % 101111) == (LDBL_MIN_EXP) % 101111);
+
+  /* Check that the value of LDBL_MIN_10_EXP is well parenthesized.  */
+  ASSERT ((LDBL_MIN_10_EXP % 101111) == (LDBL_MIN_10_EXP) % 101111);
+
+  /* Check that 'long double' is at least as wide as 'double'.  */
+  ASSERT (LDBL_MANT_DIG >= DBL_MANT_DIG);
+  ASSERT (LDBL_MIN_EXP - LDBL_MANT_DIG <= DBL_MIN_EXP - DBL_MANT_DIG);
+  ASSERT (LDBL_MAX_EXP >= DBL_MAX_EXP);
+
+  /* Check the value of LDBL_DIG.  */
+  ASSERT (LDBL_DIG == (int)((LDBL_MANT_DIG - 1) * 0.30103));
+
+  /* Check the value of LDBL_MIN_10_EXP.  */
+  ASSERT (LDBL_MIN_10_EXP == - (int) (- (LDBL_MIN_EXP - 1) * 0.30103));
+
+  /* Check the value of LDBL_MAX_10_EXP.  */
+  ASSERT (LDBL_MAX_10_EXP == (int) (LDBL_MAX_EXP * 0.30103));
+
+  /* Check the value of LDBL_MAX.  */
+  {
+    volatile long double m = LDBL_MAX;
+    int n;
+
+    ASSERT (m + m > m);
+    for (n = 0; n <= 2 * LDBL_MANT_DIG; n++)
+      {
+        volatile long double pow2_n = pow2l (n); /* 2^n */
+        volatile long double x = m + (m / pow2_n);
+        if (x > m)
+          ASSERT (x + x == x);
+        else
+          ASSERT (!(x + x == x));
+      }
+  }
+
+  /* Check the value of LDBL_MIN.  */
+  {
+    volatile long double m = LDBL_MIN;
+    volatile long double x = pow2l (LDBL_MIN_EXP - 1);
+    ASSERT (m == x);
+  }
+
+  /* Check the value of LDBL_EPSILON.  */
+  {
+    volatile long double e = LDBL_EPSILON;
+    volatile long double me;
+    int n;
+
+    me = 1.0L + e;
+    ASSERT (me > 1.0L);
+    ASSERT (me - 1.0L == e);
+    for (n = 0; n <= 2 * LDBL_MANT_DIG; n++)
+      {
+        volatile long double half_n = pow2l (- n); /* 2^-n */
+        volatile long double x = me - half_n;
+        if (x < me)
+          ASSERT (x <= 1.0L);
+      }
+  }
+}
+
+int
+main ()
+{
+  test_float ();
+  test_double ();
+
+  {
+    DECL_LONG_DOUBLE_ROUNDING
+
+    BEGIN_LONG_DOUBLE_ROUNDING ();
+
+    test_long_double ();
+
+    END_LONG_DOUBLE_ROUNDING ();
+  }
+
+  return 0;
+}
+
+#else
+
+int
+main ()
+{
+  fprintf (stderr, "Skipping test: FLT_RADIX is not 2.\n");
+  return 77;
+}
+
+#endif
index 66f9b1c..9dd0693 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of fnmatch string matching function.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -46,5 +46,11 @@ main ()
   ASSERT (res = fnmatch ("foo\\.txt", "foo.txt", 0) == 0);
   ASSERT (res = fnmatch ("foo\\.txt", "foo.txt", FNM_NOESCAPE) == FNM_NOMATCH);
 
+  /* Verify that an unmatched [ is treated as a literal, as POSIX
+     requires.  This test ensures that glibc Bugzilla bug #12378 stays
+     fixed.
+   */
+  ASSERT (res = fnmatch ("[/b", "[/b", 0) == 0);
+
   return 0;
 }
diff --git a/gnulib/tests/test-fputc.c b/gnulib/tests/test-fputc.c
new file mode 100644 (file)
index 0000000..fd92ae8
--- /dev/null
@@ -0,0 +1,89 @@
+/* Test of fputc() function.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute 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/>.  */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (fputc, int, (int, FILE *));
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "msvc-inval.h"
+
+#include "macros.h"
+
+int
+main (int argc, char **argv)
+{
+  const char *filename = "test-fputc.txt";
+
+  /* We don't have an fputc() function that installs an invalid parameter
+     handler so far.  So install that handler here, explicitly.  */
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \
+    && MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
+  gl_msvc_inval_ensure_handler ();
+#endif
+
+  /* Test that fputc() on an unbuffered stream sets errno if someone else
+     closes the stream fd behind the back of stdio.  */
+  {
+    FILE *fp = fopen (filename, "w");
+    ASSERT (fp != NULL);
+    setvbuf (fp, NULL, _IONBF, 0);
+    ASSERT (close (fileno (fp)) == 0);
+    errno = 0;
+    ASSERT (fputc ('x', fp) == EOF);
+    ASSERT (errno == EBADF);
+    ASSERT (ferror (fp));
+    fclose (fp);
+  }
+
+  /* Test that fputc() on an unbuffered stream sets errno if the stream
+     was constructed with an invalid file descriptor.  */
+  {
+    FILE *fp = fdopen (-1, "w");
+    if (fp != NULL)
+      {
+        setvbuf (fp, NULL, _IONBF, 0);
+        errno = 0;
+        ASSERT (fputc ('x', fp) == EOF);
+        ASSERT (errno == EBADF);
+        ASSERT (ferror (fp));
+        fclose (fp);
+      }
+  }
+  {
+    FILE *fp = fdopen (99, "w");
+    if (fp != NULL)
+      {
+        setvbuf (fp, NULL, _IONBF, 0);
+        errno = 0;
+        ASSERT (fputc ('x', fp) == EOF);
+        ASSERT (errno == EBADF);
+        ASSERT (ferror (fp));
+        fclose (fp);
+      }
+  }
+
+  /* Clean up.  */
+  unlink (filename);
+
+  return 0;
+}
diff --git a/gnulib/tests/test-fread.c b/gnulib/tests/test-fread.c
new file mode 100644 (file)
index 0000000..792299b
--- /dev/null
@@ -0,0 +1,98 @@
+/* Test of fread() function.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute 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/>.  */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (fread, size_t, (void *, size_t, size_t, FILE *));
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "msvc-inval.h"
+
+#include "macros.h"
+
+int
+main (int argc, char **argv)
+{
+  const char *filename = "test-fread.txt";
+
+  /* We don't have an fread() function that installs an invalid parameter
+     handler so far.  So install that handler here, explicitly.  */
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \
+    && MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
+  gl_msvc_inval_ensure_handler ();
+#endif
+
+  /* Prepare a file.  */
+  {
+    const char text[] = "hello world";
+    int fd = open (filename, O_RDWR | O_CREAT | O_TRUNC, 0600);
+    ASSERT (fd >= 0);
+    ASSERT (write (fd, text, sizeof (text)) == sizeof (text));
+    ASSERT (close (fd) == 0);
+  }
+
+  /* Test that fread() sets errno if someone else closes the stream
+     fd behind the back of stdio.  */
+  {
+    FILE *fp = fopen (filename, "r");
+    char buf[5];
+    ASSERT (fp != NULL);
+    ASSERT (close (fileno (fp)) == 0);
+    errno = 0;
+    ASSERT (fread (buf, 1, sizeof (buf), fp) == 0);
+    ASSERT (errno == EBADF);
+    ASSERT (ferror (fp));
+    fclose (fp);
+  }
+
+  /* Test that fread() sets errno if the stream was constructed with
+     an invalid file descriptor.  */
+  {
+    FILE *fp = fdopen (-1, "r");
+    if (fp != NULL)
+      {
+        char buf[1];
+        errno = 0;
+        ASSERT (fread (buf, 1, 1, fp) == 0);
+        ASSERT (errno == EBADF);
+        ASSERT (ferror (fp));
+        fclose (fp);
+      }
+  }
+  {
+    FILE *fp = fdopen (99, "r");
+    if (fp != NULL)
+      {
+        char buf[1];
+        errno = 0;
+        ASSERT (fread (buf, 1, 1, fp) == 0);
+        ASSERT (errno == EBADF);
+        ASSERT (ferror (fp));
+        fclose (fp);
+      }
+  }
+
+  /* Clean up.  */
+  unlink (filename);
+
+  return 0;
+}
diff --git a/gnulib/tests/test-fstat.c b/gnulib/tests/test-fstat.c
new file mode 100644 (file)
index 0000000..7f3c3c4
--- /dev/null
@@ -0,0 +1,48 @@
+/* Tests of fstat() function.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <sys/stat.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (fstat, int, (int, struct stat *));
+
+#include <errno.h>
+
+#include "macros.h"
+
+int
+main (int argc, char *argv[])
+{
+  /* Test behaviour for invalid file descriptors.  */
+  {
+    struct stat statbuf;
+
+    errno = 0;
+    ASSERT (fstat (-1, &statbuf) == -1);
+    ASSERT (errno == EBADF);
+  }
+  {
+    struct stat statbuf;
+
+    errno = 0;
+    ASSERT (fstat (99, &statbuf) == -1);
+    ASSERT (errno == EBADF);
+  }
+
+  return 0;
+}
diff --git a/gnulib/tests/test-fwrite.c b/gnulib/tests/test-fwrite.c
new file mode 100644 (file)
index 0000000..1f3a66d
--- /dev/null
@@ -0,0 +1,92 @@
+/* Test of fwrite() function.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute 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/>.  */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (fwrite, size_t, (const void *, size_t, size_t, FILE *));
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "msvc-inval.h"
+
+#include "macros.h"
+
+int
+main (int argc, char **argv)
+{
+  const char *filename = "test-fwrite.txt";
+
+  /* We don't have an fwrite() function that installs an invalid parameter
+     handler so far.  So install that handler here, explicitly.  */
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \
+    && MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
+  gl_msvc_inval_ensure_handler ();
+#endif
+
+  /* Test that fwrite() on an unbuffered stream sets errno if someone else
+     closes the stream fd behind the back of stdio.  */
+  {
+    FILE *fp = fopen (filename, "w");
+    char buf[5] = "world";
+    ASSERT (fp != NULL);
+    setvbuf (fp, NULL, _IONBF, 0);
+    ASSERT (close (fileno (fp)) == 0);
+    errno = 0;
+    ASSERT (fwrite (buf, 1, sizeof (buf), fp) == 0);
+    ASSERT (errno == EBADF);
+    ASSERT (ferror (fp));
+    fclose (fp);
+  }
+
+  /* Test that fwrite() on an unbuffered stream sets errno if the stream
+     was constructed with an invalid file descriptor.  */
+  {
+    FILE *fp = fdopen (-1, "w");
+    if (fp != NULL)
+      {
+        char buf[5] = "world";
+        setvbuf (fp, NULL, _IONBF, 0);
+        errno = 0;
+        ASSERT (fwrite (buf, 1, sizeof (buf), fp) == 0);
+        ASSERT (errno == EBADF);
+        ASSERT (ferror (fp));
+        fclose (fp);
+      }
+  }
+  {
+    FILE *fp = fdopen (99, "w");
+    if (fp != NULL)
+      {
+        char buf[5] = "world";
+        setvbuf (fp, NULL, _IONBF, 0);
+        errno = 0;
+        ASSERT (fwrite (buf, 1, sizeof (buf), fp) == 0);
+        ASSERT (errno == EBADF);
+        ASSERT (ferror (fp));
+        fclose (fp);
+      }
+  }
+
+  /* Clean up.  */
+  unlink (filename);
+
+  return 0;
+}
diff --git a/gnulib/tests/test-getcwd-lgpl.c b/gnulib/tests/test-getcwd-lgpl.c
new file mode 100644 (file)
index 0000000..3010760
--- /dev/null
@@ -0,0 +1,102 @@
+/* Test of getcwd() function.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (getcwd, char *, (char *, size_t));
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "macros.h"
+
+int
+main (int argc, char **argv)
+{
+  char *pwd1;
+  char *pwd2;
+  /* If the user provides an argument, attempt to chdir there first.  */
+  if (1 < argc)
+    {
+      if (chdir (argv[1]) == 0)
+        printf ("changed to directory %s\n", argv[1]);
+    }
+
+  pwd1 = getcwd (NULL, 0);
+  ASSERT (pwd1 && *pwd1);
+  if (1 < argc)
+    printf ("cwd=%s\n", pwd1);
+
+  /* Make sure the result is usable.  */
+  ASSERT (chdir (pwd1) == 0);
+  ASSERT (chdir (".//./.") == 0);
+
+  /* Make sure that result is normalized.  */
+  pwd2 = getcwd (NULL, 0);
+  ASSERT (pwd2);
+  ASSERT (strcmp (pwd1, pwd2) == 0);
+  free (pwd2);
+  {
+    size_t len = strlen (pwd1);
+    ssize_t i = len - 10;
+    if (i < 1)
+      i = 1;
+    pwd2 = getcwd (NULL, len + 1);
+    ASSERT (pwd2);
+    free (pwd2);
+    pwd2 = malloc (len + 2);
+    for ( ; i <= len; i++)
+      {
+        char *tmp;
+        errno = 0;
+        ASSERT (getcwd (pwd2, i) == NULL);
+        ASSERT (errno == ERANGE);
+        /* Allow either glibc or BSD behavior, since POSIX allows both.  */
+        errno = 0;
+        tmp = getcwd (NULL, i);
+        if (tmp)
+          {
+            ASSERT (strcmp (pwd1, tmp) == 0);
+            free (tmp);
+          }
+        else
+          {
+            ASSERT (errno == ERANGE);
+          }
+      }
+    ASSERT (getcwd (pwd2, len + 1) == pwd2);
+    pwd2[len] = '/';
+    pwd2[len + 1] = '\0';
+  }
+  ASSERT (strstr (pwd2, "/./") == NULL);
+  ASSERT (strstr (pwd2, "/../") == NULL);
+  ASSERT (strstr (pwd2 + 1 + (pwd2[1] == '/'), "//") == NULL);
+
+  /* Validate a POSIX requirement on size.  */
+  errno = 0;
+  ASSERT (getcwd(pwd2, 0) == NULL);
+  ASSERT (errno == EINVAL);
+
+  free (pwd1);
+  free (pwd2);
+
+  return 0;
+}
index f4d1c9d..daea646 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of getdelim() function.
-   Copyright (C) 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 Free Software Foundation, Inc.
 
    This 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,8 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2007.  */
 
index bead4b6..ede1b85 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of getline() function.
-   Copyright (C) 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 Free Software Foundation, Inc.
 
    This 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,8 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2007.  */
 
index 69f2cfa..e08a834 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of command line argument processing.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 9c877b3..978b753 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of command line argument processing.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -1365,5 +1365,27 @@ test_getopt (void)
       ASSERT (optind == 3);
       ASSERT (!output);
     }
+
+  /* Check that 'W' does not dump core:
+     http://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.  */
+  for (start = OPTIND_MIN; start <= 1; start++)
+    {
+      int argc = 0;
+      const char *argv[10];
+      int pos = ftell (stderr);
+
+      argv[argc++] = "program";
+      argv[argc++] = "-W";
+      argv[argc++] = "dummy";
+      argv[argc] = NULL;
+      optind = start;
+      opterr = 1;
+      ASSERT (getopt (argc, (char **) argv, "W;") == 'W');
+      ASSERT (ftell (stderr) == pos);
+      ASSERT (optind == 2);
+    }
 #endif /* GNULIB_TEST_GETOPT_GNU */
 }
index 7a74867..9d55c65 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of command line argument processing.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -314,6 +314,25 @@ test_getopt_long (void)
       }
   }
 
+  /* Test that 'W' does not dump core:
+     http://sourceware.org/bugzilla/show_bug.cgi?id=12922  */
+  {
+    int argc = 0;
+    const char *argv[10];
+    int option_index;
+    int c;
+
+    argv[argc++] = "program";
+    argv[argc++] = "-W";
+    argv[argc++] = "dummy";
+    argv[argc] = NULL;
+    optind = 1;
+    opterr = 0;
+    c = do_getopt_long (argc, argv, "W;", NULL, &option_index);
+    ASSERT (c == 'W');
+    ASSERT (optind == 2);
+  }
+
   /* Test processing of boolean short options.  */
   for (start = 0; start <= 1; start++)
     {
diff --git a/gnulib/tests/test-gettimeofday.c b/gnulib/tests/test-gettimeofday.c
new file mode 100644 (file)
index 0000000..4a9d264
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2005, 2007, 2009-2012 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 <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <sys/time.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (gettimeofday, int,
+                 (struct timeval *, GETTIMEOFDAY_TIMEZONE *));
+
+#include <time.h>
+
+#include <stdio.h>
+#include <string.h>
+
+int
+main (void)
+{
+  time_t t = 0;
+  struct tm *lt;
+  struct tm saved_lt;
+  struct timeval tv;
+  lt = localtime (&t);
+  saved_lt = *lt;
+  gettimeofday (&tv, NULL);
+  if (memcmp (lt, &saved_lt, sizeof (struct tm)) != 0)
+    {
+      fprintf (stderr, "gettimeofday still clobbers the localtime buffer!\n");
+      return 1;
+    }
+  return 0;
+}
index 501f79c..f036134 100644 (file)
@@ -1,6 +1,6 @@
 /* Test the "ignore-value" module.
 
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -24,7 +24,7 @@
 #include <stdio.h>
 
 #ifndef _GL_ATTRIBUTE_RETURN_CHECK
-# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 1)
+# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4)
 #  define _GL_ATTRIBUTE_RETURN_CHECK
 # else
 #  define _GL_ATTRIBUTE_RETURN_CHECK __attribute__((__warn_unused_result__))
diff --git a/gnulib/tests/test-init.sh b/gnulib/tests/test-init.sh
new file mode 100755 (executable)
index 0000000..a2825cc
--- /dev/null
@@ -0,0 +1,73 @@
+#!/bin/sh
+# Unit tests for init.sh
+# Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# This file is part of the GNUlib 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 <http://www.gnu.org/licenses/>.  */
+
+: ${srcdir=.}
+. "$srcdir/init.sh"; path_prepend_ .
+
+fail=0
+
+test_compare()
+{
+  touch empty || fail=1
+  echo xyz > in || fail=1
+
+  compare /dev/null /dev/null >out 2>err || fail=1
+  test -s out && fail_ "out not empty: $(cat out)"
+  # "err" should be empty, too, but has "set -x" output when VERBOSE=yes
+  case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac
+
+  compare /dev/null empty >out 2>err || fail=1
+  test -s out && fail_ "out not empty: $(cat out)"
+  case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac
+
+  compare in in >out 2>err || fail=1
+  test -s out && fail_ "out not empty: $(cat out)"
+  case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac
+
+  compare /dev/null in >out 2>err && fail=1
+  cat <<\EOF > exp
+diff -u /dev/null in
+--- /dev/null  1970-01-01
++++ in 1970-01-01
++xyz
+EOF
+  compare exp out || fail=1
+  case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac
+
+  compare empty in >out 2>err && fail=1
+  # Compare against expected output only if compare is using diff -u.
+  if grep @ out >/dev/null; then
+    # Remove the TAB-date suffix on each --- and +++ line,
+    # for both the expected and the actual output files.
+    # Also remove the @@ line, since Solaris 5.10 and GNU diff formats differ:
+    # -@@ -0,0 +1 @@
+    # +@@ -1,0 +1,1 @@
+    sed 's/    .*//;/^@@/d' out > k && mv k out
+    cat <<\EOF > exp
+--- empty
++++ in
++xyz
+EOF
+    compare exp out || fail=1
+  fi
+  case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac
+}
+
+test_compare
+
+Exit $fail
diff --git a/gnulib/tests/test-intprops.c b/gnulib/tests/test-intprops.c
new file mode 100644 (file)
index 0000000..aeb1168
--- /dev/null
@@ -0,0 +1,275 @@
+/* Test intprops.h.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   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.  */
+
+/* Tell gcc not to warn about the many (X < 0) expressions that
+   the overflow macros expand to.  */
+#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
+# pragma GCC diagnostic ignored "-Wtype-limits"
+#endif
+
+#include <config.h>
+
+#include "intprops.h"
+#include "verify.h"
+
+#include <stdbool.h>
+#include <inttypes.h>
+
+#include "macros.h"
+
+/* 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)
+#else
+# define VERIFY(x) ASSERT (x)
+#endif
+
+int
+main (void)
+{
+  /* Use VERIFY for tests that must be integer constant expressions,
+     ASSERT otherwise.  */
+
+  /* TYPE_IS_INTEGER.  */
+  ASSERT (TYPE_IS_INTEGER (bool));
+  ASSERT (TYPE_IS_INTEGER (char));
+  ASSERT (TYPE_IS_INTEGER (signed char));
+  ASSERT (TYPE_IS_INTEGER (unsigned char));
+  ASSERT (TYPE_IS_INTEGER (short int));
+  ASSERT (TYPE_IS_INTEGER (unsigned short int));
+  ASSERT (TYPE_IS_INTEGER (int));
+  ASSERT (TYPE_IS_INTEGER (unsigned int));
+  ASSERT (TYPE_IS_INTEGER (long int));
+  ASSERT (TYPE_IS_INTEGER (unsigned long int));
+  ASSERT (TYPE_IS_INTEGER (intmax_t));
+  ASSERT (TYPE_IS_INTEGER (uintmax_t));
+  ASSERT (! TYPE_IS_INTEGER (float));
+  ASSERT (! TYPE_IS_INTEGER (double));
+  ASSERT (! TYPE_IS_INTEGER (long double));
+
+  /* TYPE_SIGNED.  */
+  /* VERIFY (! TYPE_SIGNED (bool)); // not guaranteed by gnulib substitute */
+  VERIFY (TYPE_SIGNED (signed char));
+  VERIFY (! TYPE_SIGNED (unsigned char));
+  VERIFY (TYPE_SIGNED (short int));
+  VERIFY (! TYPE_SIGNED (unsigned short int));
+  VERIFY (TYPE_SIGNED (int));
+  VERIFY (! TYPE_SIGNED (unsigned int));
+  VERIFY (TYPE_SIGNED (long int));
+  VERIFY (! TYPE_SIGNED (unsigned long int));
+  VERIFY (TYPE_SIGNED (intmax_t));
+  VERIFY (! TYPE_SIGNED (uintmax_t));
+  ASSERT (TYPE_SIGNED (float));
+  ASSERT (TYPE_SIGNED (double));
+  ASSERT (TYPE_SIGNED (long double));
+
+  /* Integer representation.  */
+  VERIFY (INT_MIN + INT_MAX < 0
+          ? (TYPE_TWOS_COMPLEMENT (int)
+             && ! TYPE_ONES_COMPLEMENT (int) && ! TYPE_SIGNED_MAGNITUDE (int))
+          : (! TYPE_TWOS_COMPLEMENT (int)
+             && (TYPE_ONES_COMPLEMENT (int) || TYPE_SIGNED_MAGNITUDE (int))));
+
+  /* TYPE_MINIMUM, TYPE_MAXIMUM.  */
+  VERIFY (TYPE_MINIMUM (char) == CHAR_MIN);
+  VERIFY (TYPE_MAXIMUM (char) == CHAR_MAX);
+  VERIFY (TYPE_MINIMUM (unsigned char) == 0);
+  VERIFY (TYPE_MAXIMUM (unsigned char) == UCHAR_MAX);
+  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 (unsigned short int) == 0);
+  VERIFY (TYPE_MAXIMUM (unsigned short int) == USHRT_MAX);
+  VERIFY (TYPE_MINIMUM (int) == INT_MIN);
+  VERIFY (TYPE_MAXIMUM (int) == INT_MAX);
+  VERIFY (TYPE_MINIMUM (unsigned int) == 0);
+  VERIFY (TYPE_MAXIMUM (unsigned int) == UINT_MAX);
+  VERIFY (TYPE_MINIMUM (long int) == LONG_MIN);
+  VERIFY (TYPE_MAXIMUM (long int) == LONG_MAX);
+  VERIFY (TYPE_MINIMUM (unsigned long int) == 0);
+  VERIFY (TYPE_MAXIMUM (unsigned long int) == ULONG_MAX);
+  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);
+
+  /* INT_BITS_STRLEN_BOUND.  */
+  VERIFY (INT_BITS_STRLEN_BOUND (1) == 1);
+  VERIFY (INT_BITS_STRLEN_BOUND (2620) == 789);
+
+  /* INT_STRLEN_BOUND, INT_BUFSIZE_BOUND.  */
+  #ifdef INT32_MAX /* POSIX guarantees int32_t; this ports to non-POSIX.  */
+  VERIFY (INT_STRLEN_BOUND (int32_t) == sizeof ("-2147483648") - 1);
+  VERIFY (INT_BUFSIZE_BOUND (int32_t) == sizeof ("-2147483648"));
+  #endif
+  #ifdef INT64_MAX
+  VERIFY (INT_STRLEN_BOUND (int64_t) == sizeof ("-9223372036854775808") - 1);
+  VERIFY (INT_BUFSIZE_BOUND (int64_t) == sizeof ("-9223372036854775808"));
+  #endif
+
+  /* All the INT_<op>_RANGE_OVERFLOW tests are equally valid as
+     INT_<op>_OVERFLOW tests, so define a single macro to do both.  */
+  #define CHECK_BINOP(op, a, b, min, max, overflow)                      \
+    (INT_##op##_RANGE_OVERFLOW (a, b, min, max) == (overflow)            \
+     && INT_##op##_OVERFLOW (a, b) == (overflow))
+  #define CHECK_UNOP(op, a, min, max, overflow)                          \
+    (INT_##op##_RANGE_OVERFLOW (a, min, max) == (overflow)               \
+     && INT_##op##_OVERFLOW (a) == (overflow))
+
+  /* INT_<op>_RANGE_OVERFLOW, INT_<op>_OVERFLOW.  */
+  VERIFY (INT_ADD_RANGE_OVERFLOW (INT_MAX, 1, INT_MIN, INT_MAX));
+  VERIFY (INT_ADD_OVERFLOW (INT_MAX, 1));
+  VERIFY (CHECK_BINOP (ADD, INT_MAX, 1, INT_MIN, INT_MAX, true));
+  VERIFY (CHECK_BINOP (ADD, INT_MAX, -1, INT_MIN, INT_MAX, false));
+  VERIFY (CHECK_BINOP (ADD, INT_MIN, 1, INT_MIN, INT_MAX, false));
+  VERIFY (CHECK_BINOP (ADD, INT_MIN, -1, INT_MIN, INT_MAX, true));
+  VERIFY (CHECK_BINOP (ADD, UINT_MAX, 1u, 0u, UINT_MAX, true));
+  VERIFY (CHECK_BINOP (ADD, 0u, 1u, 0u, UINT_MAX, false));
+
+  VERIFY (CHECK_BINOP (SUBTRACT, INT_MAX, 1, INT_MIN, INT_MAX, false));
+  VERIFY (CHECK_BINOP (SUBTRACT, INT_MAX, -1, INT_MIN, INT_MAX, true));
+  VERIFY (CHECK_BINOP (SUBTRACT, INT_MIN, 1, INT_MIN, INT_MAX, true));
+  VERIFY (CHECK_BINOP (SUBTRACT, INT_MIN, -1, INT_MIN, INT_MAX, false));
+  VERIFY (CHECK_BINOP (SUBTRACT, UINT_MAX, 1u, 0u, UINT_MAX, false));
+  VERIFY (CHECK_BINOP (SUBTRACT, 0u, 1u, 0u, UINT_MAX, true));
+
+  VERIFY (CHECK_UNOP (NEGATE, INT_MIN, INT_MIN, INT_MAX,
+                      TYPE_TWOS_COMPLEMENT (int)));
+  VERIFY (CHECK_UNOP (NEGATE, 0, INT_MIN, INT_MAX, false));
+  VERIFY (CHECK_UNOP (NEGATE, INT_MAX, INT_MIN, INT_MAX, false));
+  VERIFY (CHECK_UNOP (NEGATE, 0u, 0u, UINT_MAX, false));
+  VERIFY (CHECK_UNOP (NEGATE, 1u, 0u, UINT_MAX, true));
+  VERIFY (CHECK_UNOP (NEGATE, UINT_MAX, 0u, UINT_MAX, true));
+
+  VERIFY (CHECK_BINOP (MULTIPLY, INT_MAX, INT_MAX, INT_MIN, INT_MAX, true));
+  VERIFY (CHECK_BINOP (MULTIPLY, INT_MAX, INT_MIN, INT_MIN, INT_MAX, true));
+  VERIFY (CHECK_BINOP (MULTIPLY, INT_MIN, INT_MAX, INT_MIN, INT_MAX, true));
+  VERIFY (CHECK_BINOP (MULTIPLY, INT_MIN, INT_MIN, INT_MIN, INT_MAX, true));
+  VERIFY (CHECK_BINOP (MULTIPLY, -1, INT_MIN, INT_MIN, INT_MAX,
+                       INT_NEGATE_OVERFLOW (INT_MIN)));
+  VERIFY (CHECK_BINOP (MULTIPLY, LONG_MIN / INT_MAX, (long int) INT_MAX,
+                       LONG_MIN, LONG_MIN, false));
+
+  VERIFY (CHECK_BINOP (DIVIDE, INT_MIN, -1, INT_MIN, INT_MAX,
+                       INT_NEGATE_OVERFLOW (INT_MIN)));
+  VERIFY (CHECK_BINOP (DIVIDE, INT_MAX, 1, INT_MIN, INT_MAX, false));
+  VERIFY (CHECK_BINOP (DIVIDE, (unsigned int) INT_MIN,
+                       -1u, 0u, UINT_MAX, false));
+
+  VERIFY (CHECK_BINOP (REMAINDER, INT_MIN, -1, INT_MIN, INT_MAX,
+                       INT_NEGATE_OVERFLOW (INT_MIN)));
+  VERIFY (CHECK_BINOP (REMAINDER, INT_MAX, 1, INT_MIN, INT_MAX, false));
+  VERIFY (CHECK_BINOP (REMAINDER, (unsigned int) INT_MIN,
+                       -1u, 0u, UINT_MAX, false));
+
+  VERIFY (CHECK_BINOP (LEFT_SHIFT, UINT_MAX, 1, 0u, UINT_MAX, true));
+  VERIFY (CHECK_BINOP (LEFT_SHIFT, UINT_MAX / 2 + 1, 1, 0u, UINT_MAX, true));
+  VERIFY (CHECK_BINOP (LEFT_SHIFT, UINT_MAX / 2, 1, 0u, UINT_MAX, false));
+
+  /* INT_<op>_OVERFLOW with mixed types.  */
+  #define CHECK_SUM(a, b, overflow)                       \
+    VERIFY (INT_ADD_OVERFLOW (a, b) == (overflow));       \
+    VERIFY (INT_ADD_OVERFLOW (b, a) == (overflow))
+  CHECK_SUM (-1, LONG_MIN, true);
+  CHECK_SUM (-1, UINT_MAX, false);
+  CHECK_SUM (-1L, INT_MIN, INT_MIN == LONG_MIN);
+  CHECK_SUM (0u, -1, true);
+  CHECK_SUM (0u, 0, false);
+  CHECK_SUM (0u, 1, false);
+  CHECK_SUM (1, LONG_MAX, true);
+  CHECK_SUM (1, UINT_MAX, true);
+  CHECK_SUM (1L, INT_MAX, INT_MAX == LONG_MAX);
+  CHECK_SUM (1u, INT_MAX, INT_MAX == UINT_MAX);
+  CHECK_SUM (1u, INT_MIN, true);
+
+  VERIFY (! INT_SUBTRACT_OVERFLOW (INT_MAX, 1u));
+  VERIFY (! INT_SUBTRACT_OVERFLOW (UINT_MAX, 1));
+  VERIFY (! INT_SUBTRACT_OVERFLOW (0u, -1));
+  VERIFY (INT_SUBTRACT_OVERFLOW (UINT_MAX, -1));
+  VERIFY (INT_SUBTRACT_OVERFLOW (INT_MIN, 1u));
+  VERIFY (INT_SUBTRACT_OVERFLOW (-1, 0u));
+
+  #define CHECK_PRODUCT(a, b, overflow)                   \
+    VERIFY (INT_MULTIPLY_OVERFLOW (a, b) == (overflow));   \
+    VERIFY (INT_MULTIPLY_OVERFLOW (b, a) == (overflow))
+
+  CHECK_PRODUCT (-1, 1u, true);
+  CHECK_PRODUCT (-1, INT_MIN, INT_NEGATE_OVERFLOW (INT_MIN));
+  CHECK_PRODUCT (-1, UINT_MAX, true);
+  CHECK_PRODUCT (-12345, LONG_MAX / -12345 - 1, true);
+  CHECK_PRODUCT (-12345, LONG_MAX / -12345, false);
+  CHECK_PRODUCT (0, -1, false);
+  CHECK_PRODUCT (0, 0, false);
+  CHECK_PRODUCT (0, 0u, false);
+  CHECK_PRODUCT (0, 1, false);
+  CHECK_PRODUCT (0, INT_MAX, false);
+  CHECK_PRODUCT (0, INT_MIN, false);
+  CHECK_PRODUCT (0, UINT_MAX, false);
+  CHECK_PRODUCT (0u, -1, false);
+  CHECK_PRODUCT (0u, 0, false);
+  CHECK_PRODUCT (0u, 0u, false);
+  CHECK_PRODUCT (0u, 1, false);
+  CHECK_PRODUCT (0u, INT_MAX, false);
+  CHECK_PRODUCT (0u, INT_MIN, false);
+  CHECK_PRODUCT (0u, UINT_MAX, false);
+  CHECK_PRODUCT (1, INT_MAX, false);
+  CHECK_PRODUCT (1, INT_MIN, false);
+  CHECK_PRODUCT (1, UINT_MAX, false);
+  CHECK_PRODUCT (1u, INT_MIN, true);
+  CHECK_PRODUCT (1u, INT_MAX, UINT_MAX < INT_MAX);
+  CHECK_PRODUCT (INT_MAX, UINT_MAX, true);
+  CHECK_PRODUCT (INT_MAX, ULONG_MAX, true);
+  CHECK_PRODUCT (INT_MIN, LONG_MAX / INT_MIN - 1, true);
+  CHECK_PRODUCT (INT_MIN, LONG_MAX / INT_MIN, false);
+  CHECK_PRODUCT (INT_MIN, UINT_MAX, true);
+  CHECK_PRODUCT (INT_MIN, ULONG_MAX, true);
+
+  VERIFY (INT_DIVIDE_OVERFLOW (INT_MIN, -1L)
+          == (TYPE_TWOS_COMPLEMENT (long int) && INT_MIN == LONG_MIN));
+  VERIFY (! INT_DIVIDE_OVERFLOW (INT_MIN, UINT_MAX));
+  VERIFY (! INT_DIVIDE_OVERFLOW (INTMAX_MIN, UINTMAX_MAX));
+  VERIFY (! INT_DIVIDE_OVERFLOW (INTMAX_MIN, UINT_MAX));
+  VERIFY (INT_DIVIDE_OVERFLOW (-11, 10u));
+  VERIFY (INT_DIVIDE_OVERFLOW (-10, 10u));
+  VERIFY (! INT_DIVIDE_OVERFLOW (-9, 10u));
+  VERIFY (INT_DIVIDE_OVERFLOW (11u, -10));
+  VERIFY (INT_DIVIDE_OVERFLOW (10u, -10));
+  VERIFY (! INT_DIVIDE_OVERFLOW (9u, -10));
+
+  VERIFY (INT_REMAINDER_OVERFLOW (INT_MIN, -1L)
+          == (TYPE_TWOS_COMPLEMENT (long int) && INT_MIN == LONG_MIN));
+  VERIFY (INT_REMAINDER_OVERFLOW (-1, UINT_MAX));
+  VERIFY (INT_REMAINDER_OVERFLOW ((intmax_t) -1, UINTMAX_MAX));
+  VERIFY (INT_REMAINDER_OVERFLOW (INTMAX_MIN, UINT_MAX)
+          == (INTMAX_MAX < UINT_MAX
+              && - (unsigned int) INTMAX_MIN % UINT_MAX != 0));
+  VERIFY (INT_REMAINDER_OVERFLOW (INT_MIN, ULONG_MAX)
+          == (INT_MIN % ULONG_MAX != 1));
+  VERIFY (! INT_REMAINDER_OVERFLOW (1u, -1));
+  VERIFY (! INT_REMAINDER_OVERFLOW (37*39u, -39));
+  VERIFY (INT_REMAINDER_OVERFLOW (37*39u + 1, -39));
+  VERIFY (INT_REMAINDER_OVERFLOW (37*39u - 1, -39));
+  VERIFY (! INT_REMAINDER_OVERFLOW (LONG_MAX, -INT_MAX));
+
+  return 0;
+}
diff --git a/gnulib/tests/test-inttypes.c b/gnulib/tests/test-inttypes.c
new file mode 100644 (file)
index 0000000..698d3dc
--- /dev/null
@@ -0,0 +1,118 @@
+/* Test of <inttypes.h> substitute.
+   Copyright (C) 2006-2007, 2009-2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   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>, 2007.  */
+
+#include <config.h>
+
+#include <inttypes.h>
+
+#include <stddef.h>
+
+/* Tests for macros supposed to be defined in inttypes.h.  */
+
+const char *k = /* implicit string concatenation */
+#ifdef INT8_MAX
+  PRId8 PRIi8
+#endif
+#ifdef UINT8_MAX
+  PRIo8 PRIu8 PRIx8 PRIX8
+#endif
+#ifdef INT16_MAX
+  PRId16 PRIi16
+#endif
+#ifdef UINT16_MAX
+  PRIo16 PRIu16 PRIx16 PRIX16
+#endif
+#ifdef INT32_MAX
+  PRId32 PRIi32
+#endif
+#ifdef UINT32_MAX
+  PRIo32 PRIu32 PRIx32 PRIX32
+#endif
+#ifdef INT64_MAX
+  PRId64 PRIi64
+#endif
+#ifdef UINT64_MAX
+  PRIo64 PRIu64 PRIx64 PRIX64
+#endif
+  PRIdLEAST8 PRIiLEAST8 PRIoLEAST8 PRIuLEAST8 PRIxLEAST8 PRIXLEAST8
+  PRIdLEAST16 PRIiLEAST16 PRIoLEAST16 PRIuLEAST16 PRIxLEAST16 PRIXLEAST16
+  PRIdLEAST32 PRIiLEAST32 PRIoLEAST32 PRIuLEAST32 PRIxLEAST32 PRIXLEAST32
+  PRIdLEAST64 PRIiLEAST64
+  PRIoLEAST64 PRIuLEAST64 PRIxLEAST64 PRIXLEAST64
+  PRIdFAST8 PRIiFAST8 PRIoFAST8 PRIuFAST8 PRIxFAST8 PRIXFAST8
+  PRIdFAST16 PRIiFAST16 PRIoFAST16 PRIuFAST16 PRIxFAST16 PRIXFAST16
+  PRIdFAST32 PRIiFAST32 PRIoFAST32 PRIuFAST32 PRIxFAST32 PRIXFAST32
+  PRIdFAST64 PRIiFAST64
+  PRIoFAST64 PRIuFAST64 PRIxFAST64 PRIXFAST64
+  PRIdMAX PRIiMAX PRIoMAX PRIuMAX PRIxMAX PRIXMAX
+#ifdef INTPTR_MAX
+  PRIdPTR PRIiPTR
+#endif
+#ifdef UINTPTR_MAX
+  PRIoPTR PRIuPTR PRIxPTR PRIXPTR
+#endif
+  ;
+const char *l = /* implicit string concatenation */
+#ifdef INT8_MAX
+  SCNd8 SCNi8
+#endif
+#ifdef UINT8_MAX
+  SCNo8 SCNu8 SCNx8
+#endif
+#ifdef INT16_MAX
+  SCNd16 SCNi16
+#endif
+#ifdef UINT16_MAX
+  SCNo16 SCNu16 SCNx16
+#endif
+#ifdef INT32_MAX
+  SCNd32 SCNi32
+#endif
+#ifdef UINT32_MAX
+  SCNo32 SCNu32 SCNx32
+#endif
+#ifdef INT64_MAX
+  SCNd64 SCNi64
+#endif
+#ifdef UINT64_MAX
+  SCNo64 SCNu64 SCNx64
+#endif
+  SCNdLEAST8 SCNiLEAST8 SCNoLEAST8 SCNuLEAST8 SCNxLEAST8
+  SCNdLEAST16 SCNiLEAST16 SCNoLEAST16 SCNuLEAST16 SCNxLEAST16
+  SCNdLEAST32 SCNiLEAST32 SCNoLEAST32 SCNuLEAST32 SCNxLEAST32
+  SCNdLEAST64 SCNiLEAST64
+  SCNoLEAST64 SCNuLEAST64 SCNxLEAST64
+  SCNdFAST8 SCNiFAST8 SCNoFAST8 SCNuFAST8 SCNxFAST8
+  SCNdFAST16 SCNiFAST16 SCNoFAST16 SCNuFAST16 SCNxFAST16
+  SCNdFAST32 SCNiFAST32 SCNoFAST32 SCNuFAST32 SCNxFAST32
+  SCNdFAST64 SCNiFAST64
+  SCNoFAST64 SCNuFAST64 SCNxFAST64
+  SCNdMAX SCNiMAX SCNoMAX SCNuMAX SCNxMAX
+#ifdef INTPTR_MAX
+  SCNdPTR SCNiPTR
+#endif
+#ifdef UINTPTR_MAX
+  SCNoPTR SCNuPTR SCNxPTR
+#endif
+  ;
+
+int
+main (void)
+{
+  return 0;
+}
index 229d8d6..878ee42 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of isblank() function.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index ade807c..02b4637 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <langinfo.h> substitute.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 9b55e37..e884ea1 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <locale.h> substitute.
-   Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -38,6 +38,10 @@ int a[] =
 locale_t b = LC_GLOBAL_LOCALE;
 #endif
 
+/* Check that the 'struct lconv' type is defined.  */
+struct lconv l;
+int ls;
+
 /* Check that NULL can be passed through varargs as a pointer type,
    per POSIX 2008.  */
 verify (sizeof NULL == sizeof (void *));
@@ -45,5 +49,31 @@ verify (sizeof NULL == sizeof (void *));
 int
 main ()
 {
+  /* Check that 'struct lconv' has the ISO C and POSIX specified members.  */
+  ls += sizeof (*l.decimal_point);
+  ls += sizeof (*l.thousands_sep);
+  ls += sizeof (*l.grouping);
+  ls += sizeof (*l.mon_decimal_point);
+  ls += sizeof (*l.mon_thousands_sep);
+  ls += sizeof (*l.mon_grouping);
+  ls += sizeof (*l.positive_sign);
+  ls += sizeof (*l.negative_sign);
+  ls += sizeof (*l.currency_symbol);
+  ls += sizeof (l.frac_digits);
+  ls += sizeof (l.p_cs_precedes);
+  ls += sizeof (l.p_sign_posn);
+  ls += sizeof (l.p_sep_by_space);
+  ls += sizeof (l.n_cs_precedes);
+  ls += sizeof (l.n_sign_posn);
+  ls += sizeof (l.n_sep_by_space);
+  ls += sizeof (*l.int_curr_symbol);
+  ls += sizeof (l.int_frac_digits);
+  ls += sizeof (l.int_p_cs_precedes);
+  ls += sizeof (l.int_p_sign_posn);
+  ls += sizeof (l.int_p_sep_by_space);
+  ls += sizeof (l.int_n_cs_precedes);
+  ls += sizeof (l.int_n_sign_posn);
+  ls += sizeof (l.int_n_sep_by_space);
+
   return 0;
 }
diff --git a/gnulib/tests/test-localeconv.c b/gnulib/tests/test-localeconv.c
new file mode 100644 (file)
index 0000000..9125800
--- /dev/null
@@ -0,0 +1,72 @@
+/* Test of localeconv() function.
+   Copyright (C) 2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   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>, 2012.  */
+
+#include <config.h>
+
+#include <locale.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (localeconv, struct lconv *, (void));
+
+#include <limits.h>
+#include <string.h>
+
+#include "macros.h"
+
+int
+main ()
+{
+  /* Test localeconv() result in the "C" locale.  */
+  {
+    struct lconv *l = localeconv ();
+
+    ASSERT (STREQ (l->decimal_point, "."));
+    ASSERT (STREQ (l->thousands_sep, ""));
+#if !defined __FreeBSD__
+    ASSERT (STREQ (l->grouping, ""));
+#endif
+
+    ASSERT (STREQ (l->mon_decimal_point, ""));
+    ASSERT (STREQ (l->mon_thousands_sep, ""));
+#if !defined __FreeBSD__
+    ASSERT (STREQ (l->mon_grouping, ""));
+#endif
+    ASSERT (STREQ (l->positive_sign, ""));
+    ASSERT (STREQ (l->negative_sign, ""));
+
+    ASSERT (STREQ (l->currency_symbol, ""));
+    ASSERT (l->frac_digits == CHAR_MAX);
+    ASSERT (l->p_cs_precedes == CHAR_MAX);
+    ASSERT (l->p_sign_posn == CHAR_MAX);
+    ASSERT (l->p_sep_by_space == CHAR_MAX);
+    ASSERT (l->n_cs_precedes == CHAR_MAX);
+    ASSERT (l->n_sign_posn == CHAR_MAX);
+    ASSERT (l->n_sep_by_space == CHAR_MAX);
+
+    ASSERT (STREQ (l->int_curr_symbol, ""));
+    ASSERT (l->int_frac_digits == CHAR_MAX);
+    ASSERT (l->int_p_cs_precedes == CHAR_MAX);
+    ASSERT (l->int_p_sign_posn == CHAR_MAX);
+    ASSERT (l->int_p_sep_by_space == CHAR_MAX);
+    ASSERT (l->int_n_cs_precedes == CHAR_MAX);
+    ASSERT (l->int_n_sign_posn == CHAR_MAX);
+    ASSERT (l->int_n_sep_by_space == CHAR_MAX);
+  }
+
+  return 0;
+}
index 09f002c..37b76a3 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of gl_locale_name function and its variants.
-   Copyright (C) 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -715,7 +715,7 @@ test_locale_name_default (void)
 
   ASSERT (name != NULL);
 
-  /* Only MacOS X and Windows have a facility for the user to set the default
+  /* 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__))
   ASSERT (strcmp (name, "C") == 0);
index 04ce076..5cada7d 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of locking in multithreaded situations.
-   Copyright (C) 2005, 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2008-2012 Free Software Foundation, Inc.
 
    This 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 @@
 
 #include <config.h>
 
-#if USE_POSIX_THREADS || USE_SOLARIS_THREADS || USE_PTH_THREADS || USE_WIN32_THREADS
+#if USE_POSIX_THREADS || USE_SOLARIS_THREADS || USE_PTH_THREADS || USE_WINDOWS_THREADS
 
 #if USE_POSIX_THREADS
 # define TEST_POSIX_THREADS 1
@@ -29,8 +29,8 @@
 #if USE_PTH_THREADS
 # define TEST_PTH_THREADS 1
 #endif
-#if USE_WIN32_THREADS
-# define TEST_WIN32_THREADS 1
+#if USE_WINDOWS_THREADS
+# define TEST_WINDOWS_THREADS 1
 #endif
 
 /* Whether to enable locking.
@@ -69,7 +69,7 @@
 # undef USE_POSIX_THREADS
 # undef USE_SOLARIS_THREADS
 # undef USE_PTH_THREADS
-# undef USE_WIN32_THREADS
+# undef USE_WINDOWS_THREADS
 #endif
 #include "glthread/lock.h"
 
@@ -83,8 +83,8 @@
 # if TEST_PTH_THREADS
 #  define USE_PTH_THREADS 1
 # endif
-# if TEST_WIN32_THREADS
-#  define USE_WIN32_THREADS 1
+# if TEST_WINDOWS_THREADS
+#  define USE_WINDOWS_THREADS 1
 # endif
 #endif
 
@@ -143,9 +143,9 @@ lock_mutator_thread (void *arg)
     {
       int i1, i2, value;
 
-      dbgprintf ("Mutator %p before lock\n", gl_thread_self ());
+      dbgprintf ("Mutator %p before lock\n", gl_thread_self_pointer ());
       gl_lock_lock (my_lock);
-      dbgprintf ("Mutator %p after  lock\n", gl_thread_self ());
+      dbgprintf ("Mutator %p after  lock\n", gl_thread_self_pointer ());
 
       i1 = random_account ();
       i2 = random_account ();
@@ -153,20 +153,20 @@ lock_mutator_thread (void *arg)
       account[i1] += value;
       account[i2] -= value;
 
-      dbgprintf ("Mutator %p before unlock\n", gl_thread_self ());
+      dbgprintf ("Mutator %p before unlock\n", gl_thread_self_pointer ());
       gl_lock_unlock (my_lock);
-      dbgprintf ("Mutator %p after  unlock\n", gl_thread_self ());
+      dbgprintf ("Mutator %p after  unlock\n", gl_thread_self_pointer ());
 
-      dbgprintf ("Mutator %p before check lock\n", gl_thread_self ());
+      dbgprintf ("Mutator %p before check lock\n", gl_thread_self_pointer ());
       gl_lock_lock (my_lock);
       check_accounts ();
       gl_lock_unlock (my_lock);
-      dbgprintf ("Mutator %p after  check unlock\n", gl_thread_self ());
+      dbgprintf ("Mutator %p after  check unlock\n", gl_thread_self_pointer ());
 
       yield ();
     }
 
-  dbgprintf ("Mutator %p dying.\n", gl_thread_self ());
+  dbgprintf ("Mutator %p dying.\n", gl_thread_self_pointer ());
   return NULL;
 }
 
@@ -177,16 +177,16 @@ lock_checker_thread (void *arg)
 {
   while (!lock_checker_done)
     {
-      dbgprintf ("Checker %p before check lock\n", gl_thread_self ());
+      dbgprintf ("Checker %p before check lock\n", gl_thread_self_pointer ());
       gl_lock_lock (my_lock);
       check_accounts ();
       gl_lock_unlock (my_lock);
-      dbgprintf ("Checker %p after  check unlock\n", gl_thread_self ());
+      dbgprintf ("Checker %p after  check unlock\n", gl_thread_self_pointer ());
 
       yield ();
     }
 
-  dbgprintf ("Checker %p dying.\n", gl_thread_self ());
+  dbgprintf ("Checker %p dying.\n", gl_thread_self_pointer ());
   return NULL;
 }
 
@@ -233,9 +233,9 @@ rwlock_mutator_thread (void *arg)
     {
       int i1, i2, value;
 
-      dbgprintf ("Mutator %p before wrlock\n", gl_thread_self ());
+      dbgprintf ("Mutator %p before wrlock\n", gl_thread_self_pointer ());
       gl_rwlock_wrlock (my_rwlock);
-      dbgprintf ("Mutator %p after  wrlock\n", gl_thread_self ());
+      dbgprintf ("Mutator %p after  wrlock\n", gl_thread_self_pointer ());
 
       i1 = random_account ();
       i2 = random_account ();
@@ -243,14 +243,14 @@ rwlock_mutator_thread (void *arg)
       account[i1] += value;
       account[i2] -= value;
 
-      dbgprintf ("Mutator %p before unlock\n", gl_thread_self ());
+      dbgprintf ("Mutator %p before unlock\n", gl_thread_self_pointer ());
       gl_rwlock_unlock (my_rwlock);
-      dbgprintf ("Mutator %p after  unlock\n", gl_thread_self ());
+      dbgprintf ("Mutator %p after  unlock\n", gl_thread_self_pointer ());
 
       yield ();
     }
 
-  dbgprintf ("Mutator %p dying.\n", gl_thread_self ());
+  dbgprintf ("Mutator %p dying.\n", gl_thread_self_pointer ());
   return NULL;
 }
 
@@ -261,16 +261,16 @@ rwlock_checker_thread (void *arg)
 {
   while (!rwlock_checker_done)
     {
-      dbgprintf ("Checker %p before check rdlock\n", gl_thread_self ());
+      dbgprintf ("Checker %p before check rdlock\n", gl_thread_self_pointer ());
       gl_rwlock_rdlock (my_rwlock);
       check_accounts ();
       gl_rwlock_unlock (my_rwlock);
-      dbgprintf ("Checker %p after  check unlock\n", gl_thread_self ());
+      dbgprintf ("Checker %p after  check unlock\n", gl_thread_self_pointer ());
 
       yield ();
     }
 
-  dbgprintf ("Checker %p dying.\n", gl_thread_self ());
+  dbgprintf ("Checker %p dying.\n", gl_thread_self_pointer ());
   return NULL;
 }
 
@@ -315,9 +315,9 @@ recshuffle (void)
 {
   int i1, i2, value;
 
-  dbgprintf ("Mutator %p before lock\n", gl_thread_self ());
+  dbgprintf ("Mutator %p before lock\n", gl_thread_self_pointer ());
   gl_recursive_lock_lock (my_reclock);
-  dbgprintf ("Mutator %p after  lock\n", gl_thread_self ());
+  dbgprintf ("Mutator %p after  lock\n", gl_thread_self_pointer ());
 
   i1 = random_account ();
   i2 = random_account ();
@@ -329,9 +329,9 @@ recshuffle (void)
   if (((unsigned int) rand () >> 3) % 2)
     recshuffle ();
 
-  dbgprintf ("Mutator %p before unlock\n", gl_thread_self ());
+  dbgprintf ("Mutator %p before unlock\n", gl_thread_self_pointer ());
   gl_recursive_lock_unlock (my_reclock);
-  dbgprintf ("Mutator %p after  unlock\n", gl_thread_self ());
+  dbgprintf ("Mutator %p after  unlock\n", gl_thread_self_pointer ());
 }
 
 static void *
@@ -343,16 +343,16 @@ reclock_mutator_thread (void *arg)
     {
       recshuffle ();
 
-      dbgprintf ("Mutator %p before check lock\n", gl_thread_self ());
+      dbgprintf ("Mutator %p before check lock\n", gl_thread_self_pointer ());
       gl_recursive_lock_lock (my_reclock);
       check_accounts ();
       gl_recursive_lock_unlock (my_reclock);
-      dbgprintf ("Mutator %p after  check unlock\n", gl_thread_self ());
+      dbgprintf ("Mutator %p after  check unlock\n", gl_thread_self_pointer ());
 
       yield ();
     }
 
-  dbgprintf ("Mutator %p dying.\n", gl_thread_self ());
+  dbgprintf ("Mutator %p dying.\n", gl_thread_self_pointer ());
   return NULL;
 }
 
@@ -363,16 +363,16 @@ reclock_checker_thread (void *arg)
 {
   while (!reclock_checker_done)
     {
-      dbgprintf ("Checker %p before check lock\n", gl_thread_self ());
+      dbgprintf ("Checker %p before check lock\n", gl_thread_self_pointer ());
       gl_recursive_lock_lock (my_reclock);
       check_accounts ();
       gl_recursive_lock_unlock (my_reclock);
-      dbgprintf ("Checker %p after  check unlock\n", gl_thread_self ());
+      dbgprintf ("Checker %p after  check unlock\n", gl_thread_self_pointer ());
 
       yield ();
     }
 
-  dbgprintf ("Checker %p dying.\n", gl_thread_self ());
+  dbgprintf ("Checker %p dying.\n", gl_thread_self_pointer ());
   return NULL;
 }
 
@@ -444,7 +444,7 @@ once_contender_thread (void *arg)
         break;
 
       dbgprintf ("Contender %p waiting for signal for round %d\n",
-                 gl_thread_self (), repeat);
+                 gl_thread_self_pointer (), repeat);
 #if ENABLE_LOCKING
       /* Wait for the signal to go.  */
       gl_rwlock_rdlock (fire_signal[repeat]);
@@ -456,7 +456,7 @@ once_contender_thread (void *arg)
         yield ();
 #endif
       dbgprintf ("Contender %p got the     signal for round %d\n",
-                 gl_thread_self (), repeat);
+                 gl_thread_self_pointer (), repeat);
 
       /* Contend for execution.  */
       gl_once (once_control, once_execute);
@@ -495,7 +495,7 @@ test_once (void)
   for (repeat = 0; repeat <= REPEAT_COUNT; repeat++)
     {
       /* Wait until every thread is ready.  */
-      dbgprintf ("Main thread before synchonizing for round %d\n", repeat);
+      dbgprintf ("Main thread before synchronizing for round %d\n", repeat);
       for (;;)
         {
           int ready_count = 0;
@@ -509,7 +509,7 @@ test_once (void)
             break;
           yield ();
         }
-      dbgprintf ("Main thread after  synchonizing for round %d\n", repeat);
+      dbgprintf ("Main thread after  synchronizing for round %d\n", repeat);
 
       if (repeat > 0)
         {
index 372e056..459bf88 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of lstat() function.
-   Copyright (C) 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 883c4e8..4a81494 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of lstat() function.
-   Copyright (C) 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index c2a3d6b..16b3a0a 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of malloc function.
-   Copyright (C) 2010-2011 Free Software Foundation, Inc.
+   Copyright (C) 2010-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 92c86f2..9c7109c 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of safe automatic memory allocation.
-   Copyright (C) 2005, 2007, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -45,7 +45,7 @@ main ()
     {
       /* Try various values.
          n = 0 gave a crash on Alpha with gcc-2.5.8.
-         Some versions of MacOS X have a stack size limit of 512 KB.  */
+         Some versions of Mac OS X have a stack size limit of 512 KB.  */
       func (34);
       func (134);
       func (399);
index ee8caf9..50006c0 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of conversion of multibyte character to wide character.
-   Copyright (C) 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 727016a..02b7841 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of conversion of multibyte character to wide character.
-   Copyright (C) 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 2cc2924..dae7569 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of test for initial conversion state.
-   Copyright (C) 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 9a63ed9..f93677e 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of conversion of string to wide string.
-   Copyright (C) 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index a11f6cd..1298c27 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008-2011 Free Software Foundation, Inc.
+ * Copyright (C) 2008-2012 Free Software Foundation, Inc.
  * Written by Eric Blake and Bruno Haible
  *
  * This program is free software: you can redistribute it and/or modify
index 964ea8d..d3384f4 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of nl_langinfo replacement.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 3c5b2ab..b9ec9bf 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of opening a file descriptor.
-   Copyright (C) 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 3e5c5e1..cab1d27 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of opening a file descriptor.
-   Copyright (C) 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -63,6 +63,12 @@ test_open (int (*func) (char const *, int, ...), bool print)
   ASSERT (write (fd, "c", 1) == 1);
   ASSERT (close (fd) == 0);
 
+  /* Although O_NONBLOCK on regular files can be ignored, it must not
+     cause a failure.  */
+  fd = func (BASE "file", O_NONBLOCK | O_RDONLY);
+  ASSERT (0 <= fd);
+  ASSERT (close (fd) == 0);
+
   /* Symlink handling, where supported.  */
   if (symlink (BASE "file", BASE "link") != 0)
     {
diff --git a/gnulib/tests/test-pathmax.c b/gnulib/tests/test-pathmax.c
new file mode 100644 (file)
index 0000000..c6d0ccc
--- /dev/null
@@ -0,0 +1,32 @@
+/* Test of "pathmax.h".
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   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>, 2011.  */
+
+#include <config.h>
+
+#include "pathmax.h"
+
+/* Check that PATH_MAX is a constant if it is defined.  */
+#ifdef PATH_MAX
+int a = PATH_MAX;
+#endif
+
+int
+main (void)
+{
+  return 0;
+}
diff --git a/gnulib/tests/test-rawmemchr.c b/gnulib/tests/test-rawmemchr.c
new file mode 100644 (file)
index 0000000..9e31500
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2008-2012 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 <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <string.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (rawmemchr, void *, (void const *, int));
+
+#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 RAWMEMCHR (char *) rawmemchr
+
+int
+main (void)
+{
+  size_t n = 0x100000;
+  char *input = malloc (n + 1);
+  ASSERT (input);
+
+  input[0] = 'a';
+  input[1] = 'b';
+  memset (input + 2, 'c', 1024);
+  memset (input + 1026, 'd', n - 1028);
+  input[n - 2] = 'e';
+  input[n - 1] = 'a';
+  input[n] = '\0';
+
+  /* Basic behavior tests.  */
+  ASSERT (RAWMEMCHR (input, 'a') == input);
+  ASSERT (RAWMEMCHR (input, 'b') == input + 1);
+  ASSERT (RAWMEMCHR (input, 'c') == input + 2);
+  ASSERT (RAWMEMCHR (input, 'd') == input + 1026);
+
+  ASSERT (RAWMEMCHR (input + 1, 'a') == input + n - 1);
+  ASSERT (RAWMEMCHR (input + 1, 'e') == input + n - 2);
+  ASSERT (RAWMEMCHR (input + 1, 0x789abc00 | 'e') == input + n - 2);
+
+  ASSERT (RAWMEMCHR (input, '\0') == input + n);
+
+  /* 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 (RAWMEMCHR (input + i, j) == input + i + j);
+          }
+      }
+  }
+
+  /* Ensure that no unaligned oversized reads occur.  */
+  {
+    char *page_boundary = (char *) zerosize_ptr ();
+    size_t i;
+
+    if (!page_boundary)
+      page_boundary = input + 4096;
+    memset (page_boundary - 512, '1', 511);
+    page_boundary[-1] = '2';
+    for (i = 1; i <= 512; i++)
+      ASSERT (RAWMEMCHR (page_boundary - i, (i * 0x01010100) | '2')
+              == page_boundary - 1);
+  }
+
+  free (input);
+
+  return 0;
+}
index 3da5fbf..d755182 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests of readlink.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 7247fc4..284152a 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests of readlink.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 2cf61be..36a4be9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Test the safe-alloc macros
  *
- * Copyright (C) 2009-2011 Free Software Foundation, Inc.
+ * Copyright (C) 2009-2012 Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  *
  * Author: David Lutterkort <lutter@redhat.com>
  */
index 50eb71b..4752a11 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests of setenv.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index ea7945c..08f9224 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of setting the current locale.
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 7bfc42a..7416647 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of setting the current locale.
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 723e74e..904e147 100755 (executable)
@@ -2,14 +2,16 @@
 
 # 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
-  LC_ALL=$name ./test-setlocale2${EXEEXT} 1 || exit 1
+  env LC_ALL=$name ./test-setlocale2${EXEEXT} 1 || exit 1
 done
 
 # Test locale names with likely unsupported encoding in native Windows syntax.
 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
-  LC_ALL=$name ./test-setlocale2${EXEEXT} 1 || exit 1
+  # 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
 done
 
 exit 0
index 4cda089..db9adf9 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests of stat.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -33,7 +33,6 @@ SIGNATURE_CHECK (stat, int, (char const *, struct stat *));
 #include <stdio.h>
 #include <unistd.h>
 
-#include "pathmax.h"
 #include "same-inode.h"
 #include "macros.h"
 
index 22552dc..2c9afc0 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests of stat.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -27,9 +27,9 @@ test_stat_func (int (*func) (char const *, struct stat *), bool print)
 {
   struct stat st1;
   struct stat st2;
-  char cwd[PATH_MAX];
+  char *cwd = getcwd (NULL, 0);
 
-  ASSERT (getcwd (cwd, PATH_MAX) == cwd);
+  ASSERT (cwd);
   ASSERT (func (".", &st1) == 0);
   ASSERT (func ("./", &st2) == 0);
   ASSERT (SAME_INODE (st1, st2));
index e115ba2..c22ca1f 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdbool.h> substitute.
-   Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2002-2007, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index c929af8..d7237b3 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stddef.h> substitute.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index f606cc3..23b2b28 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdint.h> substitute.
-   Copyright (C) 2006-2011 Free Software Foundation, Inc.
+   Copyright (C) 2006-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -21,8 +21,6 @@
 /* Whether to enable pedantic checks. */
 #define DO_PEDANTIC 0
 
-#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
-#define __STDC_CONSTANT_MACROS 1 /* likewise */
 #include <stdint.h>
 
 #include "verify.h"
index 7e7a206..7bd67c2 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdio.h> substitute.
-   Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 210aab4..7eeb410 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdlib.h> substitute.
-   Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/gnulib/tests/test-strchrnul.c b/gnulib/tests/test-strchrnul.c
new file mode 100644 (file)
index 0000000..f1d0928
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2008-2012 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 <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <string.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (strchrnul, char *, (char const *, int));
+
+#include <stdlib.h>
+
+#include "macros.h"
+
+int
+main (void)
+{
+  size_t n = 0x100000;
+  char *input = malloc (n + 1);
+  ASSERT (input);
+
+  input[0] = 'a';
+  input[1] = 'b';
+  memset (input + 2, 'c', 1024);
+  memset (input + 1026, 'd', n - 1028);
+  input[n - 2] = 'e';
+  input[n - 1] = 'a';
+  input[n] = '\0';
+
+  /* Basic behavior tests.  */
+  ASSERT (strchrnul (input, 'a') == input);
+  ASSERT (strchrnul (input, 'b') == input + 1);
+  ASSERT (strchrnul (input, 'c') == input + 2);
+  ASSERT (strchrnul (input, 'd') == input + 1026);
+
+  ASSERT (strchrnul (input + 1, 'a') == input + n - 1);
+  ASSERT (strchrnul (input + 1, 'e') == input + n - 2);
+
+  ASSERT (strchrnul (input, 'f') == input + n);
+  ASSERT (strchrnul (input, '\0') == input + n);
+
+  /* Check that a very long haystack is handled quickly if the byte is
+     found near the beginning.  */
+  {
+    size_t repeat = 10000;
+    for (; repeat > 0; repeat--)
+      {
+        ASSERT (strchrnul (input, 'c') == input + 2);
+      }
+  }
+
+  /* Alignment tests.  */
+  {
+    int i, j;
+    for (i = 0; i < 32; i++)
+      {
+        for (j = 0; j < 256; j++)
+          input[i + j] = (j + 1) & 0xff;
+        for (j = 1; j < 256; j++)
+          {
+            ASSERT (strchrnul (input + i, j) == input + i + j - 1);
+            input[i + j - 1] = (j == 1 ? 2 : 1);
+            ASSERT (strchrnul (input + i, j) == input + i + 255);
+            input[i + j - 1] = j;
+          }
+      }
+  }
+
+  free (input);
+
+  return 0;
+}
index 54c49a9..56e5974 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <string.h> substitute.
-   Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 18d6fcd..cbc1883 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2011 Free Software Foundation, Inc.
+ * Copyright (C) 2010-2012 Free Software Foundation, Inc.
  * Written by Eric Blake
  *
  * This program is free software: you can redistribute it and/or modify
index d6d6639..9d44dfb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004, 2007-2011 Free Software Foundation, Inc.
+ * Copyright (C) 2004, 2007-2012 Free Software Foundation, Inc.
  * Written by Bruno Haible and Eric Blake
  *
  * This program is free software: you can redistribute it and/or modify
index 367e045..b3caac9 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests of symlink.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 4d93929..a7c4079 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests of symlink.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index cd07d86..0702e04 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <sys/stat.h> substitute.
-   Copyright (C) 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 int a[] =
   {
     S_IFMT,
-    S_IFBLK, S_IFCHR, S_IFDIR, S_IFIFO, S_IFREG,
-#ifdef S_IFLNK /* missing on mingw and djgpp */
+#ifdef S_IFBLK /* missing on MSVC */
+    S_IFBLK,
+#endif
+    S_IFCHR, S_IFDIR, S_IFIFO, S_IFREG,
+#ifdef S_IFLNK /* missing on native Windows and DJGPP */
     S_IFLNK,
 #endif
-#ifdef S_IFSOCK /* missing on mingw and djgpp */
+#ifdef S_IFSOCK /* missing on native Windows and DJGPP */
     S_IFSOCK,
 #endif
     S_IRWXU, S_IRUSR, S_IWUSR, S_IXUSR,
@@ -61,7 +64,9 @@ verify (S_IRWXU == (S_IRUSR | S_IWUSR | S_IXUSR));
 verify (S_IRWXG == (S_IRGRP | S_IWGRP | S_IXGRP));
 verify (S_IRWXO == (S_IROTH | S_IWOTH | S_IXOTH));
 
+#ifdef S_IFBLK
 verify (S_ISBLK (S_IFBLK));
+#endif
 verify (!S_ISBLK (S_IFCHR));
 verify (!S_ISBLK (S_IFDIR));
 verify (!S_ISBLK (S_IFIFO));
@@ -73,7 +78,9 @@ verify (!S_ISBLK (S_IFLNK));
 verify (!S_ISBLK (S_IFSOCK));
 #endif
 
+#ifdef S_IFBLK
 verify (!S_ISCHR (S_IFBLK));
+#endif
 verify (S_ISCHR (S_IFCHR));
 verify (!S_ISCHR (S_IFDIR));
 verify (!S_ISCHR (S_IFIFO));
@@ -85,7 +92,9 @@ verify (!S_ISCHR (S_IFLNK));
 verify (!S_ISCHR (S_IFSOCK));
 #endif
 
+#ifdef S_IFBLK
 verify (!S_ISDIR (S_IFBLK));
+#endif
 verify (!S_ISDIR (S_IFCHR));
 verify (S_ISDIR (S_IFDIR));
 verify (!S_ISDIR (S_IFIFO));
@@ -97,7 +106,9 @@ verify (!S_ISDIR (S_IFLNK));
 verify (!S_ISDIR (S_IFSOCK));
 #endif
 
+#ifdef S_IFBLK
 verify (!S_ISFIFO (S_IFBLK));
+#endif
 verify (!S_ISFIFO (S_IFCHR));
 verify (!S_ISFIFO (S_IFDIR));
 verify (S_ISFIFO (S_IFIFO));
@@ -109,7 +120,9 @@ verify (!S_ISFIFO (S_IFLNK));
 verify (!S_ISFIFO (S_IFSOCK));
 #endif
 
+#ifdef S_IFBLK
 verify (!S_ISREG (S_IFBLK));
+#endif
 verify (!S_ISREG (S_IFCHR));
 verify (!S_ISREG (S_IFDIR));
 verify (!S_ISREG (S_IFIFO));
@@ -121,7 +134,9 @@ verify (!S_ISREG (S_IFLNK));
 verify (!S_ISREG (S_IFSOCK));
 #endif
 
+#ifdef S_IFBLK
 verify (!S_ISLNK (S_IFBLK));
+#endif
 verify (!S_ISLNK (S_IFCHR));
 verify (!S_ISLNK (S_IFDIR));
 verify (!S_ISLNK (S_IFIFO));
@@ -133,7 +148,9 @@ verify (S_ISLNK (S_IFLNK));
 verify (!S_ISLNK (S_IFSOCK));
 #endif
 
+#ifdef S_IFBLK
 verify (!S_ISSOCK (S_IFBLK));
+#endif
 verify (!S_ISSOCK (S_IFCHR));
 verify (!S_ISSOCK (S_IFDIR));
 verify (!S_ISSOCK (S_IFIFO));
@@ -145,7 +162,9 @@ verify (!S_ISSOCK (S_IFLNK));
 verify (S_ISSOCK (S_IFSOCK));
 #endif
 
+#ifdef S_IFBLK
 verify (!S_ISDOOR (S_IFBLK));
+#endif
 verify (!S_ISDOOR (S_IFCHR));
 verify (!S_ISDOOR (S_IFDIR));
 verify (!S_ISDOOR (S_IFIFO));
@@ -157,7 +176,9 @@ verify (!S_ISDOOR (S_IFLNK));
 verify (!S_ISDOOR (S_IFSOCK));
 #endif
 
+#ifdef S_IFBLK
 verify (!S_ISMPB (S_IFBLK));
+#endif
 verify (!S_ISMPB (S_IFCHR));
 verify (!S_ISMPB (S_IFDIR));
 verify (!S_ISMPB (S_IFIFO));
@@ -169,7 +190,9 @@ verify (!S_ISMPB (S_IFLNK));
 verify (!S_ISMPB (S_IFSOCK));
 #endif
 
+#ifdef S_IFBLK
 verify (!S_ISNAM (S_IFBLK));
+#endif
 verify (!S_ISNAM (S_IFCHR));
 verify (!S_ISNAM (S_IFDIR));
 verify (!S_ISNAM (S_IFIFO));
@@ -181,7 +204,9 @@ verify (!S_ISNAM (S_IFLNK));
 verify (!S_ISNAM (S_IFSOCK));
 #endif
 
+#ifdef S_IFBLK
 verify (!S_ISNWK (S_IFBLK));
+#endif
 verify (!S_ISNWK (S_IFCHR));
 verify (!S_ISNWK (S_IFDIR));
 verify (!S_ISNWK (S_IFIFO));
@@ -193,7 +218,9 @@ verify (!S_ISNWK (S_IFLNK));
 verify (!S_ISNWK (S_IFSOCK));
 #endif
 
+#ifdef S_IFBLK
 verify (!S_ISPORT (S_IFBLK));
+#endif
 verify (!S_ISPORT (S_IFCHR));
 verify (!S_ISPORT (S_IFDIR));
 verify (!S_ISPORT (S_IFIFO));
@@ -205,7 +232,9 @@ verify (!S_ISPORT (S_IFLNK));
 verify (!S_ISPORT (S_IFSOCK));
 #endif
 
+#ifdef S_IFBLK
 verify (!S_ISCTG (S_IFBLK));
+#endif
 verify (!S_ISCTG (S_IFCHR));
 verify (!S_ISCTG (S_IFDIR));
 verify (!S_ISCTG (S_IFIFO));
@@ -217,7 +246,9 @@ verify (!S_ISCTG (S_IFLNK));
 verify (!S_ISCTG (S_IFSOCK));
 #endif
 
+#ifdef S_IFBLK
 verify (!S_ISOFD (S_IFBLK));
+#endif
 verify (!S_ISOFD (S_IFCHR));
 verify (!S_ISOFD (S_IFDIR));
 verify (!S_ISOFD (S_IFIFO));
@@ -229,7 +260,9 @@ verify (!S_ISOFD (S_IFLNK));
 verify (!S_ISOFD (S_IFSOCK));
 #endif
 
+#ifdef S_IFBLK
 verify (!S_ISOFL (S_IFBLK));
+#endif
 verify (!S_ISOFL (S_IFCHR));
 verify (!S_ISOFL (S_IFDIR));
 verify (!S_ISOFL (S_IFIFO));
@@ -241,7 +274,9 @@ verify (!S_ISOFL (S_IFLNK));
 verify (!S_ISOFL (S_IFSOCK));
 #endif
 
+#ifdef S_IFBLK
 verify (!S_ISWHT (S_IFBLK));
+#endif
 verify (!S_ISWHT (S_IFCHR));
 verify (!S_ISWHT (S_IFDIR));
 verify (!S_ISWHT (S_IFIFO));
@@ -278,8 +313,10 @@ invalid UTIME macros
 
 /* Check the existence of some types.  */
 nlink_t t1;
+off_t t2;
+mode_t t3;
 
-struct timespec t2;
+struct timespec st;
 
 int
 main (void)
diff --git a/gnulib/tests/test-sys_time.c b/gnulib/tests/test-sys_time.c
new file mode 100644 (file)
index 0000000..44e21a2
--- /dev/null
@@ -0,0 +1,33 @@
+/* Test of <sys/time.h> substitute.
+   Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   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>, 2007.  */
+
+#include <config.h>
+
+#include <sys/time.h>
+
+/* Check that the 'struct timeval' type is defined.  */
+struct timeval a;
+
+/* Check that &a.tv_sec is a 'time_t *', ignoring signedness issues.  */
+typedef int verify_tv_sec_type[sizeof (a.tv_sec) == sizeof (time_t) ? 1 : -1];
+
+int
+main (void)
+{
+  return 0;
+}
diff --git a/gnulib/tests/test-sys_types.c b/gnulib/tests/test-sys_types.c
new file mode 100644 (file)
index 0000000..c2af992
--- /dev/null
@@ -0,0 +1,34 @@
+/* Test of <sys/types.h> substitute.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   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>, 2011.  */
+
+#include <config.h>
+
+#include <sys/types.h>
+
+/* Check that the types are all defined.  */
+pid_t t1;
+size_t t2;
+ssize_t t3;
+off_t t4;
+mode_t t5;
+
+int
+main (void)
+{
+  return 0;
+}
index dce89c6..3ed2e2e 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <sys/wait.h> substitute.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 3c9b322..d3726df 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of macros shared between <sys/wait.h> and <stdlib.h>.
-   Copyright (C) 2010-2011 Free Software Foundation, Inc.
+   Copyright (C) 2010-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/gnulib/tests/test-thread_create.c b/gnulib/tests/test-thread_create.c
new file mode 100644 (file)
index 0000000..0f86771
--- /dev/null
@@ -0,0 +1,78 @@
+/* Test of gl_thread_create () macro.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   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>, 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_POSIX_THREADS || USE_SOLARIS_THREADS || USE_PTH_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/gnulib/tests/test-thread_self.c b/gnulib/tests/test-thread_self.c
new file mode 100644 (file)
index 0000000..707f7fe
--- /dev/null
@@ -0,0 +1,34 @@
+/* Test of gl_thread_self () macro.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   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>, 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.  */
+  main_thread = gl_thread_self ();
+
+  return 0;
+}
index 0c78f36..11a4208 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <time.h> substitute.
-   Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 #include "verify.h"
 
-struct timespec a;
+/* Check that the types are all defined.  */
+struct timespec t1;
+#if 0
+/* POSIX:2008 does not require pid_t in <time.h> unconditionally, and indeed
+   it's missing on Mac OS X 10.5, FreeBSD 6.4, OpenBSD 4.9, mingw.  */
+pid_t t2;
+#endif
 
 /* Check that NULL can be passed through varargs as a pointer type,
    per POSIX 2008.  */
index be1ae06..e53fd7a 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <unistd.h> substitute.
-   Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 9c9443b..926526d 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests of unsetenv.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 6b2a0ff..4e548b1 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of vasnprintf() and asnprintf() functions.
-   Copyright (C) 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 6882d18..4d7635b 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of vasprintf() and asprintf() functions.
-   Copyright (C) 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 512c021..5ab9c58 100644 (file)
@@ -1,6 +1,6 @@
 /* Test the "verify" module.
 
-   Copyright (C) 2005, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -55,9 +55,9 @@ function (int n)
   verify (1 == 1); verify (1 == 1); /* should be ok */
 
   if (n)
-    return ((void) verify_true (1 == 1), verify_true (1 == 1) + 7); /* should be ok */
+    return ((void) verify_expr (1 == 1, 1), verify_expr (1 == 1, 8)); /* should be ok */
 #if EXP_FAIL == 5
-  return (verify_true (1 == 2), 5); /* should give ERROR */
+  return verify_expr (1 == 2, 5); /* should give ERROR */
 #endif
   return 0;
 }
index 2d3bad7..0d72005 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <wchar.h> substitute.
-   Copyright (C) 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 0b09498..9342f78 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of conversion of wide character to multibyte character.
-   Copyright (C) 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index a50817f..99e427d 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of conversion of wide character to multibyte character.
-   Copyright (C) 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index aed3b77..467f05b 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <wctype.h> substitute.
-   Copyright (C) 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 215bba0..ddbe9a4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995-2002, 2005-2011 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995-2002, 2005-2012 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
@@ -36,7 +36,7 @@
 #endif
 
 #if _LIBC
-/* This lock protects against simultaneous modifications of `environ'.  */
+/* This lock protects against simultaneous modifications of 'environ'.  */
 # include <bits/libc-lock.h>
 __libc_lock_define_initialized (static, envlock)
 # define LOCK   __libc_lock_lock (envlock)
@@ -97,6 +97,13 @@ weak_alias (__unsetenv, unsetenv)
 #else /* HAVE_UNSETENV */
 
 # undef unsetenv
+# if !HAVE_DECL_UNSETENV
+#  if VOID_UNSETENV
+extern void unsetenv (const char *);
+#  else
+extern int unsetenv (const char *);
+#  endif
+# endif
 
 /* Call the underlying unsetenv, in case there is hidden bookkeeping
    that needs updating beyond just modifying environ.  */
index cc26afc..0885c1b 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert wide character to unibyte character.
-   Copyright (C) 2008, 2010-2011 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2010-2012 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
index 4e95de6..68264cf 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert wide character to multibyte character.
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2011.
 
    This program is free software: you can redistribute it and/or modify
index 889a3c6..736a7c7 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert wide character to multibyte character.
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2011.
 
    This program is free software: you can redistribute it and/or modify
index beeb3da..9c060e7 100644 (file)
@@ -1,5 +1,5 @@
 /* Return a pointer to a zero-size object in memory.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 4ea5e0c..39920d3 100644 (file)
@@ -8,7 +8,7 @@ About: Reference
   Some examples of valid entries can be found in access.conf or "man access.conf"
 
 About: License
-  This file is licensed under the LGPLv2+, like the rest of Augeas.
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
   Sample usage of this lens in augtool
@@ -48,10 +48,14 @@ let colon     = del (Rx.opt_space . ":" . Rx.opt_space) " : "
  *)
 let access    = label "access" . store /[+-]/
 
+(* Variable: identifier_re
+   Regex for user/group identifiers *)
+let identifier_re = /[A-Za-z0-9_.\\-]+/
+
 (* View: user_re
  * Regex for user/netgroup fields
  *)
-let user_re = Rx.word - /[Ee][Xx][Cc][Ee][Pp][Tt]/
+let user_re = identifier_re - /[Ee][Xx][Cc][Ee][Pp][Tt]/
 
 (* View: user
  * user can be a username, username@hostname or a group
@@ -65,7 +69,7 @@ let user      = [ label "user"
  * Format is (GROUP)
  *)
 let group     = [ label "group"
-                  . Util.del_str "(" . store Rx.word . Util.del_str ")" ]
+                  . Util.del_str "(" . store identifier_re . Util.del_str ")" ]
 
 (* View: netgroup
  * Format is @NETGROUP[@@NISDOMAIN]
diff --git a/lenses/activemq_conf.aug b/lenses/activemq_conf.aug
new file mode 100644 (file)
index 0000000..191d811
--- /dev/null
@@ -0,0 +1,61 @@
+(*
+Module: ActiveMQ_Conf
+  ActiveMQ / FuseMQ conf module for Augeas
+
+Author: Brian Redbeard <redbeard@dead-city.org>
+
+About: Reference
+  This lens ensures that conf files included in ActiveMQ /FuseMQ are properly
+  handled by Augeas.
+
+About: License
+  This file is licensed under the LGPL License.
+
+About: Lens Usage
+  Sample usage of this lens in augtool:
+
+    * Get your current setup
+      > print /files/etc/activemq.conf
+      ...
+
+    * Change ActiveMQ Home
+      > set /files/etc/activemq.conf/ACTIVEMQ_HOME /usr/share/activemq
+
+  Saving your file:
+
+      > save
+
+About: Configuration files
+  This lens applies to relevant conf files located in  /etc/activemq/ and 
+  the file /etc/activemq.conf . See <filter>.
+
+*)
+
+module ActiveMQ_Conf =
+        autoload xfm
+
+(* Variable: blank_val *)
+let blank_val = del /^\z/
+
+(* View: entry *)
+let entry =
+  Build.key_value_line Rx.word Sep.space_equal Quote.any_opt
+
+(* View: empty_entry *)
+let empty_entry = Build.key_value_line Rx.word Sep.equal  Quote.dquote_opt_nil
+
+(* View: lns *)
+let lns = (Util.empty | Util.comment | entry | empty_entry )*
+
+(* Variable: filter *)
+let filter = incl "/etc/activemq.conf"
+           . incl "/etc/activemq/*"
+           . excl "/etc/activemq/*.xml"
+           . excl "/etc/activemq/jmx.*"
+           . excl "/etc/activemq/jetty-realm.properties"
+           . excl "/etc/activemq/*.ts"
+           . excl "/etc/activemq/*.ks"
+           . excl "/etc/activemq/*.cert"
+           . Util.stdexcl
+
+let xfm = transform lns filter
diff --git a/lenses/activemq_xml.aug b/lenses/activemq_xml.aug
new file mode 100644 (file)
index 0000000..df2a222
--- /dev/null
@@ -0,0 +1,41 @@
+(*
+Module: ActiveMQ_XML
+  ActiveMQ / FuseMQ XML module for Augeas
+
+Author: Brian Redbeard <redbeard@dead-city.org>
+
+About: Reference
+  This lens ensures that XML files included in ActiveMQ / FuseMQ are properly
+  handled by Augeas.
+
+About: License
+  This file is licensed under the LGPL License.
+
+About: Lens Usage
+  Sample usage of this lens in augtool:
+
+    * Get your current setup
+      > print /files/etc/activemq/activemq.xml
+      ...
+
+    * Change OpenShift domain
+      > set /files/etc/openshift/broker.conf/CLOUD_DOMAIN ose.example.com
+
+  Saving your file:
+
+      > save
+
+About: Configuration files
+  This lens applies to relevant XML files located in  /etc/activemq/ . See <filter>.
+
+*)
+
+module ActiveMQ_XML =
+        autoload xfm
+
+let lns = Xml.lns
+
+let filter = (incl "/etc/activemq/*.xml") 
+           . Util.stdexcl
+
+let xfm = transform lns filter
index 89dec94..10c2d66 100644 (file)
@@ -8,7 +8,7 @@ About: Reference
   This lens tries to keep as close as possible to `man 5 aliases` where possible.
 
 About: License
-   This file is licenced under the LGPLv2+, like the rest of Augeas.
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
    See <lns>.
@@ -38,7 +38,7 @@ module Aliases =
     * a command can contain spaces, if enclosed in double quotes, the case
     * without spaces is taken care with <word>
     *)
-   let command = /\|([^", \t\n]+|"[^"\n]+")/
+   let command = /(\|([^", \t\n]+|"[^"\n]+"))|("\|[^"\n]+")/
 
    (* Group: Comments and empty lines *)
 
@@ -53,7 +53,7 @@ module Aliases =
    (* View: colon
     * Separation between the alias and it's destinations
     *)
-   let colon = del /[ \t]*:[ \t]+/ ":\t"
+   let colon = del /[ \t]*:[ \t]*/ ":\t"
    (* View: comma
     * Separation between multiple destinations
     *)
diff --git a/lenses/anacron.aug b/lenses/anacron.aug
new file mode 100644 (file)
index 0000000..e7aa5ca
--- /dev/null
@@ -0,0 +1,87 @@
+(*
+Module: Anacron
+ Parses /etc/anacrontab
+
+Author: Raphael Pinson <raphink@gmail.com>
+
+About: Reference
+ This lens tries to keep as close as possible to `man 5 anacrontab` where
+ possible.
+
+About: License
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+
+About: Configuration files
+  This lens applies to /etc/anacrontab. See <filter>.
+
+About: Examples
+   The <Test_Anacron> file contains various examples and tests.
+*)
+
+module Anacron =
+  autoload xfm
+
+(************************************************************************
+ * Group:                       ENTRIES
+ *************************************************************************)
+
+
+(************************************************************************
+ * View: shellvar
+ *   A shell variable in crontab
+ *************************************************************************)
+
+let shellvar = Cron.shellvar
+
+
+(* View: period *)
+let period = [ label "period" . store Rx.integer ]
+
+(* Variable: period_name_re
+     The valid values for <period_name>. Currently only "monthly" *)
+let period_name_re = "monthly"
+
+(************************************************************************
+ * View: period_name
+ *   In the format "@keyword"
+ *************************************************************************)
+let period_name = [ label "period_name" . Util.del_str "@"
+                  . store period_name_re ]
+
+(************************************************************************
+ * View: delay
+ *   The delay for an <entry>
+ *************************************************************************)
+let delay = [ label "delay" . store Rx.integer ]
+
+(************************************************************************
+ * View: job_identifier
+ *   The job_identifier for an <entry>
+ *************************************************************************)
+let job_identifier = [ label "job-identifier" . store Rx.word ]
+
+(************************************************************************
+ * View: entry
+ *   An anacrontab entry
+ *************************************************************************)
+
+let entry = [ label "entry" . Util.indent
+            . ( period | period_name )
+            . Sep.space . delay
+            . Sep.space . job_identifier
+            . Sep.space . store Rx.space_in . Util.eol ]
+
+
+(*
+ * View: lns
+ *   The anacron lens
+ *)
+let lns = ( Util.empty | Util.comment | shellvar | entry )*
+
+
+(* Variable: filter *)
+let filter = incl "/etc/anacrontab"
+
+let xfm = transform lns filter
index 32b56d6..a482d1a 100644 (file)
@@ -8,7 +8,7 @@ About: Reference
   This lens tries to keep as close as possible to `man 5 approx.conf` where possible.
 
 About: License
-   This file is licenced under the LGPLv2+, like the rest of Augeas.
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
    See <lns>.
diff --git a/lenses/apt_update_manager.aug b/lenses/apt_update_manager.aug
new file mode 100644 (file)
index 0000000..f1c361d
--- /dev/null
@@ -0,0 +1,47 @@
+(*
+Module: Apt_Update_Manager
+  Parses files in /etc/update-manager
+
+Author: Raphael Pinson <raphael.pinson@camptocamp.com>
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to files in /etc/update-manager. See <filter>.
+
+About: Examples
+   The <Test_Apt_Update_Manager> file contains various examples and tests.
+*)
+module Apt_Update_Manager =
+
+autoload xfm
+
+(* View: comment *)
+let comment = IniFile.comment IniFile.comment_re IniFile.comment_default
+
+(* View: sep *)
+let sep = IniFile.sep IniFile.sep_re IniFile.sep_default
+
+(* View: title *)
+let title = IniFile.title Rx.word
+
+(* View: entry *)
+let entry = IniFile.entry Rx.word sep comment
+
+(* View: record *)
+let record = IniFile.record title entry
+
+(* View: lns *)
+let lns = IniFile.lns record comment
+
+(* Variable: filter *)
+let filter = incl "/etc/update-manager/meta-release"
+           . incl "/etc/update-manager/release-upgrades"
+           . incl "/etc/update-manager/release-upgrades.d/*"
+           . Util.stdexcl
+
+let xfm = transform lns filter
diff --git a/lenses/aptcacherngsecurity.aug b/lenses/aptcacherngsecurity.aug
new file mode 100644 (file)
index 0000000..204ea5b
--- /dev/null
@@ -0,0 +1,25 @@
+(* Module: AptCacherNGSecurity
+
+   Lens for config files like the one found in
+   /etc/apt-cacher-ng/security.conf
+
+
+   About: License
+   Copyright 2013 Erik B. Andersen; this file is licenced under the LGPL v2+.
+*)
+module AptCacherNGSecurity =
+       autoload xfm
+
+       (* Define a Username/PW pair *)
+       let authpair = [ key /[^ \t:\/]*/ . del /:/ ":" . store /[^: \t\n]*/ ]
+
+       (* Define a record. So far as I can tell, the only auth level supported is Admin *)
+       let record = [ key "AdminAuth". del /[ \t]*:[ \t]*/ ": ". authpair . Util.del_str "\n"]
+
+       (* Define the basic lens *)
+       let lns = ( record | Util.empty | Util.comment )*
+
+       let filter = incl "/etc/apt-cacher-ng/security.conf"
+               . Util.stdexcl
+
+       let xfm = transform lns filter
index 2338c39..8683c7a 100644 (file)
@@ -9,7 +9,7 @@ About: Reference
 where possible.
 
 About: License
-  This file is licenced under the LGPLv2+, like the rest of Augeas.
+  This file is licenced under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
   To be documented
index 3f57d0b..0c3c84c 100644 (file)
@@ -1,49 +1,69 @@
-(* Apt/preferences module for Augeas          *)
-(* Author: Raphael Pinson <raphink@gmail.com> *)
+(*
+Module: AptPreferences
+  Apt/preferences module for Augeas
+
+Author: Raphael Pinson <raphael.pinson@camptocamp.com>
+*)
 
 module AptPreferences =
-   autoload xfm
+autoload xfm
+
+(************************************************************************
+ * Group: Entries
+ ************************************************************************)
+
+(* View: colon *)
+let colon        = del /:[ \t]*/ ": "
+
+(* View: pin_gen
+     A generic pin
 
-   (* Define useful primitives *)
-   let colon        = del /:[ \t]*/ ": "
-   let eol          = del /[ \t]*\n/ "\n"
-   let value_to_eol = store /([^ \t\n].*[^ \t\n]|[^ \t\n])/
-   let value_to_spc = store /[^, \t\n]+/
-   let comma = del /,[ \t]*/ ", "
-   let equal = Util.del_str "="
-   let spc   = Util.del_ws_spc
+   Parameters:
+     lbl:string - the label *)
+let pin_gen (lbl:string) = store lbl
+                        . [ label lbl . Sep.space . store Rx.no_spaces ]
 
-   (* Define empty *)
-   let empty = [ del /[ \t]*\n/ "\n" ]
+(* View: pin_keys *)
+let pin_keys =
+     let space_in = store /[^, \r\t\n][^,\n]*[^, \r\t\n]|[^, \t\n\r]/
+  in Build.key_value /[aclnov]/ Sep.equal space_in
 
-   (* Define record *)
+(* View: pin_options *)
+let pin_options =
+    let comma = Util.delim ","
+ in store "release" . Sep.space
+                    . Build.opt_list pin_keys comma
 
-   let simple_entry (kw:string) = [ key kw . colon . value_to_eol . eol ]
+(* View: version_pin *)
+let version_pin = pin_gen "version"
 
-   let key_value (kw:string)    = [ key kw . equal . value_to_spc ]
-   let pin_keys = key_value "a"
-                | key_value "c"
-                | key_value "l"
-                | key_value "o"
-                | key_value "v"
+(* View: origin_pin *)
+let origin_pin = pin_gen "origin"
 
-   let pin_options = store "release" . spc . pin_keys . ( comma . pin_keys )*
-   let version_pin = store "version" . [ label "version" . spc . store /[^ \t\n]+/ ]
-   let origin_pin = store "origin" . [ label "origin" . spc . store /[^ \t\n]+/ ]
+(* View: pin *)
+let pin =
+     let pin_value = pin_options | version_pin | origin_pin
+  in Build.key_value_line "Pin" colon pin_value
 
-   let pin = [ key "Pin" . colon . (pin_options | version_pin | origin_pin) . eol ]
+(* View: entries *)
+let entries = Build.key_value_line ("Explanation"|"Package"|"Pin-Priority")
+                                   colon (store Rx.space_in)
+            | pin
+            | Util.comment
 
-   let entries = simple_entry "Explanation"
-               | simple_entry "Package"
-               | simple_entry "Pin-Priority"
-               | pin
+(* View: record *)
+let record = [ seq "record" . entries+ ]
 
-   let record = [ seq "record" . entries+ ]
+(************************************************************************
+ * Group: Lens
+ ************************************************************************)
 
-   (* Define lens *)
-   let lns = (eol* . ( record . eol+ )* . record . eol* ) | eol
+(* View: lns *)
+let lns = Util.empty* . (Build.opt_list record Util.eol+ . Util.empty*)?
 
-   let filter = incl "/etc/apt/preferences"
-              . Util.stdexcl
+(* View: filter *)
+let filter = incl "/etc/apt/preferences"
+           . incl "/etc/apt/preferences.d/*"
+           . Util.stdexcl
 
-   let xfm = transform lns filter
+let xfm = transform lns filter
index c3b03ef..10c8325 100644 (file)
@@ -1,17 +1,32 @@
-(* Parsing /etc/apt/sources.list *)
+(*
+Module: Aptsources
+  Parsing /etc/apt/sources.list
+*)
 
 module Aptsources =
   autoload xfm
 
+(************************************************************************
+ * Group: Utility variables/functions
+ ************************************************************************)
+  (* View:  sep_ws *)
   let sep_ws = del /[ \t]+/ " "
 
+  (* View: eol *)
   let eol = Util.del_str "\n"
 
+  (* View: comment *)
   let comment = Util.comment
+  (* View: empty *)
   let empty = Util.empty
 
+  (* View: word *)
   let word = /[^# \n\t]+/
 
+(************************************************************************
+ * Group: Keywords
+ ************************************************************************)
+  (* View: record *)
   let record = [ Util.indent . seq "source" . [ label "type" . store word ] . sep_ws .
                                 [ label "uri"  . store word ] . sep_ws .
                                 [ label "distribution" . store word ]  .
@@ -19,8 +34,13 @@ module Aptsources =
                                 del /[ \t]*(#.*)?/ ""
                  . eol ]
 
+(************************************************************************
+ * Group: Lens
+ ************************************************************************)
+  (* View: lns *)
   let lns = ( comment | empty | record ) *
 
+  (* View: filter *)
   let filter = (incl "/etc/apt/sources.list")
       . (incl "/etc/apt/sources.list.d/*")
       . Util.stdexcl
diff --git a/lenses/authorized_keys.aug b/lenses/authorized_keys.aug
new file mode 100644 (file)
index 0000000..97552c5
--- /dev/null
@@ -0,0 +1,70 @@
+(*
+Module: Authorized_Keys
+  Parses SSH authorized_keys
+
+Author: Raphael Pinson <raphael.pinson@camptocamp.com>
+
+About: Reference
+  This lens tries to keep as close as possible to `man 5 authorized_keys` where possible.
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to SSH authorized_keys. See <filter>.
+
+About: Examples
+   The <Test_Authorized_Keys> file contains various examples and tests.
+*)
+
+
+module Authorized_Keys =
+
+autoload xfm
+
+(* View: option
+   A key option *)
+let option =
+     let kv_re   = "command" | "environment" | "from"
+                 | "permitopen" | "principals" | "tunnel"
+  in let flag_re = "cert-authority" | "no-agent-forwarding"
+                 | "no-port-forwarding" | "no-pty" | "no-user-rc"
+                 | "no-X11-forwarding"
+  in let option_value = Util.del_str "\"" . store /[^\n"]+/ . Util.del_str "\""
+  in Build.key_value kv_re Sep.equal option_value
+   | Build.flag flag_re
+
+(* View: key_options
+   A list of key <option>s *)
+let key_options = [ label "options" . Build.opt_list option Sep.comma ]
+
+(* View: key_type *)
+let key_type =
+  let key_type_re = /ecdsa-sha2-nistp[0-9]+/ | /ssh-[a-z0-9]+/
+  in [ label "type" . store key_type_re ]
+
+(* View: key_comment *)
+let key_comment = [ label "comment" . store Rx.space_in ]
+
+(* View: authorized_key *)
+let authorized_key =
+   [ label "key"
+     . (key_options . Sep.space)?
+     . key_type . Sep.space
+     . store Rx.no_spaces
+     . (Sep.space . key_comment)?
+     . Util.eol ]
+
+(* View: lns
+     The authorized_keys lens
+*)
+let lns = ( Util.empty | Util.comment | authorized_key)*
+
+(* Variable: filter *)
+let filter = incl (Sys.getenv("HOME") . "/.ssh/authorized_keys")
+
+let xfm = transform lns filter
+
diff --git a/lenses/automaster.aug b/lenses/automaster.aug
new file mode 100644 (file)
index 0000000..e63bbf9
--- /dev/null
@@ -0,0 +1,125 @@
+(*
+Module: Automaster
+  Parses autofs' auto.master files
+
+Author: Dominic Cleal <dcleal@redhat.com>
+
+About: Reference
+  See auto.master(5)
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to /etc/auto.master, auto_master and /etc/auto.master.d/*
+   files.
+
+About: Examples
+   The <Test_Automaster> file contains various examples and tests.
+*)
+
+module Automaster =
+autoload xfm
+
+(************************************************************************
+ * Group:                 USEFUL PRIMITIVES
+ *************************************************************************)
+
+(* View: eol *)
+let eol = Util.eol
+
+(* View: empty *)
+let empty   = Util.empty
+
+(* View: comment *)
+let comment = Util.comment
+
+(* View mount *)
+let mount = /[^+ \t\n#]+/
+
+(* View: type
+   yp, file, dir etc but not ldap *)
+let type = Rx.word - /ldap/
+
+(* View: format
+   sun, hesoid *)
+let format = Rx.word
+
+(* View: name *)
+let name = /[^: \t\n]+/
+
+(* View: host *)
+let host = /[^:# \n\t]+/
+
+(* View: dn *)
+let dn = /[^:# \n\t]+/
+
+(* An option label can't contain comma, comment, equals, or space *)
+let optlabel = /[^,#= \n\t]+/
+let spec    = /[^,# \n\t][^ \n\t]*/
+
+(* View: optsep *)
+let optsep = del /[ \t,]+/ ","
+
+(************************************************************************
+ * Group:                 ENTRIES
+ *************************************************************************)
+
+(* View: map_format *)
+let map_format = [ label "format" . store format ]
+
+(* View: map_type *)
+let map_type = [ label "type" . store type ]
+
+(* View: map_name *)
+let map_name = [ label "map" . store name ]
+
+(* View: map_generic
+   Used for all except LDAP maps which are parsed further *)
+let map_generic = ( map_type . ( Sep.comma . map_format )?  . Sep.colon )?
+                    . map_name
+
+(* View: map_ldap_name
+   Split up host:dc=foo into host/map nodes *)
+let map_ldap_name = ( [ label "host" . store host ] . Sep.colon )?
+                      . [ label "map" . store dn ]
+
+(* View: map_ldap *)
+let map_ldap      = [ label "type" . store "ldap" ]
+                      . ( Sep.comma . map_format )? . Sep.colon
+                      . map_ldap_name
+
+(* View: comma_spc_sep_list
+   Parses options either for filesystems or autofs *)
+let comma_spc_sep_list (l:string) =
+  let value = [ label "value" . Util.del_str "=" . store Rx.neg1 ] in
+    let lns = [ label l . store optlabel . value? ] in
+       Build.opt_list lns optsep
+
+(* View: map_mount 
+   Mountpoint and whitespace, followed by the map info *)
+let map_mount  = [ seq "map" . store mount . Util.del_ws_tab
+                   . ( map_generic | map_ldap )
+                   . ( Util.del_ws_spc . comma_spc_sep_list "opt" )?
+                   . Util.eol ]
+
+(* map_master
+   "+" to include more master entries and optional whitespace *)
+let map_master = [ seq "map" . store "+" . Util.del_opt_ws ""
+                   . ( map_generic | map_ldap )
+                   . ( Util.del_ws_spc . comma_spc_sep_list "opt" )?
+                   . Util.eol ]
+
+(* View: lns *)
+let lns = ( empty | comment | map_mount | map_master ) *
+
+(* Variable: filter *)
+let filter = incl "/etc/auto.master"
+           . incl "/etc/auto_master"
+           . incl "/etc/auto.master.d/*"
+           . Util.stdexcl
+
+let xfm = transform lns filter
diff --git a/lenses/automounter.aug b/lenses/automounter.aug
new file mode 100644 (file)
index 0000000..f830c7d
--- /dev/null
@@ -0,0 +1,131 @@
+(*
+Module: Automounter
+  Parses automounter file based maps
+
+Author: Dominic Cleal <dcleal@redhat.com>
+
+About: Reference
+  See autofs(5)
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to /etc/auto.*, auto_*, excluding known scripts.
+
+About: Examples
+   The <Test_Automounter> file contains various examples and tests.
+*)
+
+module Automounter =
+autoload xfm
+
+(************************************************************************
+ * Group:                 USEFUL PRIMITIVES
+ *************************************************************************)
+
+(* View: eol *)
+let eol = Util.eol
+
+(* View: empty *)
+let empty   = Util.empty
+
+(* View: comment *)
+let comment = Util.comment
+
+(* View: path *)
+let path = /[^-+#: \t\n][^#: \t\n]*/
+
+(* View: hostname *)
+let hostname = /[^-:#\(\), \n\t][^:#\(\), \n\t]*/
+
+(* An option label can't contain comma, comment, equals, or space *)
+let optlabel = /[^,#:\(\)= \n\t]+/
+let spec    = /[^,#:\(\)= \n\t][^ \n\t]*/
+
+(* View: weight *)
+let weight = Rx.integer
+
+(* View: map_name *)
+let map_name = /[^: \t\n]+/
+
+(* View: entry_multimount_sep
+   Separator for multimount entries, permits line spanning with "\" *)
+let entry_multimount_sep = del /[ \t]+(\\\\[ \t]*\n[ \t]+)?/ " "
+
+(************************************************************************
+ * Group:                 ENTRIES
+ *************************************************************************)
+
+(* View: entry_key
+   Key for a map entry *)
+let entry_mkey = store path
+
+(* View: entry_path
+   Path component of an entry location *)
+let entry_path = [ label "path" . store path ]
+
+(* View: entry_host
+   Host component with optional weight of an entry location *)
+let entry_host = [ label "host" . store hostname
+                   . ( Util.del_str "(" . [ label "weight"
+                       . store weight ] . Util.del_str ")" )? ]
+
+(* View: comma_sep_list
+   Parses options for filesystems *)
+let comma_sep_list (l:string) =
+  let value = [ label "value" . Util.del_str "=" . store Rx.neg1 ] in
+    let lns = [ label l . store optlabel . value? ] in
+       Build.opt_list lns Sep.comma
+
+(* View: entry_options *)
+let entry_options = Util.del_str "-" . comma_sep_list "opt" . Util.del_ws_tab
+
+(* View: entry_location
+   A single location with one or more hosts, and one path *)
+let entry_location = ( entry_host . ( Sep.comma . entry_host )* )?
+                       . Sep.colon . entry_path
+
+(* View: entry_locations 
+   Multiple locations (each with one or more hosts), separated by spaces *)
+let entry_locations = [ label "location" . counter "location"
+                        . [ seq "location" . entry_location ]
+                        . ( [ Util.del_ws_spc . seq "location" . entry_location ] )* ]
+
+(* View: entry_multimount
+   Parses one of many mountpoints given for a multimount line *)
+let entry_multimount = entry_mkey . Util.del_ws_tab . entry_options? . entry_locations
+
+(* View: entry_multimounts
+   Parses multiple mountpoints given on an entry line *)
+let entry_multimounts = [ label "mount" . counter "mount"
+                          . [ seq "mount" . entry_multimount ]
+                          . ( [ entry_multimount_sep . seq "mount" . entry_multimount ] )* ]
+
+(* View: entry
+   A single map entry from start to finish, including multi-mounts *)
+let entry = [ seq "entry" . entry_mkey . Util.del_ws_tab . entry_options?
+              . ( entry_locations | entry_multimounts ) . Util.eol ]
+
+(* View: include
+   An include line starting with a "+" and a map name *)
+let include = [ seq "entry" . store "+" . Util.del_opt_ws ""
+                . [ label "map" . store map_name ] . Util.eol ]
+
+(* View: lns *)
+let lns = ( empty | comment | entry | include ) *
+
+(* Variable: filter
+   Exclude scripts/executable maps from here *)
+let filter = incl "/etc/auto.*"
+           . incl "/etc/auto_*"
+           . excl "/etc/auto.master"
+           . excl "/etc/auto_master"
+           . excl "/etc/auto.net"
+           . excl "/etc/auto.smb"
+           . Util.stdexcl
+
+let xfm = transform lns filter
diff --git a/lenses/avahi.aug b/lenses/avahi.aug
new file mode 100644 (file)
index 0000000..3c2bf19
--- /dev/null
@@ -0,0 +1,45 @@
+(*
+Module: Avahi
+ Avahi module for Augeas
+
+ Author: Athir Nuaimi <athir@nuaimi.com>
+
+ avahi-daemon.conf is a standard INI File.
+*)
+
+module Avahi =
+  autoload xfm
+
+(************************************************************************
+ * Group: INI File settings
+ * avahi-daemon.conf only supports "# as commentary and "=" as separator
+ *************************************************************************)
+(* View: comment *)
+let comment    = IniFile.comment "#" "#"
+(* View: sep *)
+let sep        = IniFile.sep "=" "="
+
+(************************************************************************
+ * Group: Entry
+ *************************************************************************)
+(* View: entry *)
+let entry   = IniFile.indented_entry IniFile.entry_re sep comment
+
+(************************************************************************
+ * Group: Record
+ *************************************************************************)
+(* View: title *)
+let title   = IniFile.indented_title IniFile.record_re
+(* View: record *)
+let record  = IniFile.record title entry
+
+(************************************************************************
+ * Group: Lens and filter
+ *************************************************************************)
+(* View: lns *)
+let lns     = IniFile.lns record comment
+
+(* View: filter *)
+let filter = (incl "/etc/avahi/avahi-daemon.conf")
+
+let xfm = transform lns filter
index d66f09b..7324135 100644 (file)
@@ -6,7 +6,7 @@ About: Reference
   This lens tries to keep as close as possible to `man backuppc` where possible.
 
 About: License
-   This file is licenced under the LGPLv2+, like the rest of Augeas.
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
    To be documented
index c28a42f..cec029b 100644 (file)
@@ -38,33 +38,62 @@ module BBhosts =
                             )?
                             ]
 
+    (* DOWNTIME=[columns:]day:starttime:endtime:cause[,day:starttime:endtime:cause] *)
+    let host_test_downtime =
+          let probe = [ label "probe" . store (Rx.word | "*") ]
+      in let probes = Build.opt_list probe Sep.comma
+      in let day = [ label "day" . store (Rx.word | "*") ]
+      in let starttime = [ label "starttime" . store Rx.integer ]
+      in let endtime = [ label "endtime" . store Rx.integer ]
+      in let cause = [ label "cause" . Util.del_str "\"" . store /[^"]*/ . Util.del_str "\"" ]
+      in [ key "DOWNTIME" . Sep.equal
+          . (probes . Sep.colon)?
+          . day . Sep.colon
+          . starttime . Sep.colon
+          . endtime . Sep.colon
+          . cause
+          ]
+
     let host_test_flag_value = [ label "value" . Util.del_str ":"
                               . store Rx.word ]
 
-    let host_test_flag (kw:string) = [ store /!?/ . key kw
+    let host_test_flag (kw:regexp) = [ store /!?/ . key kw
                                      . host_test_flag_value? ]
 
     let host_test = host_test_cont "cont"
-                  | host_test_cont "contInsecure"
-                  | host_test_cont "dns"
-                  | host_test_flag "CDB"
-                  | host_test_flag "ftp"
-                  | host_test_flag "front"
-                  | host_test_flag "GTM"
-                 | host_test_flag "noping"
-                 | host_test_flag "noconn"
-                 | host_test_flag "ssh"
-                 | host_test_flag "ssh2"
-                 | host_test_flag "smtp"
-                 | host_test_flag "pop3"
-                 | host_test_flag "imap2"
-                 | host_test_flag "telnet"
+                 | host_test_cont "contInsecure"
+                 | host_test_cont "dns"
                  | host_test_flag "BBDISPLAY"
                  | host_test_flag "BBNET"
                  | host_test_flag "BBPAGER"
+                 | host_test_flag "CDB"
+                 | host_test_flag "GTM"
                  | host_test_flag "XYMON"
-                  | host_test_url
-
+                 | host_test_flag "ajp13"
+                 | host_test_flag "bbd"
+                 | host_test_flag "clamd"
+                 | host_test_flag "cupsd"
+                 | host_test_flag "front"
+                 | host_test_flag /ftps?/
+                 | host_test_flag /imap[2-4s]?/
+                 | host_test_flag /ldaps?/
+                 | host_test_flag /nntps?/
+                 | host_test_flag "noconn"
+                 | host_test_flag "nocont"
+                 | host_test_flag "noping"
+                 | host_test_flag "notrends"
+                 | host_test_flag "oratns"
+                 | host_test_flag /pop-?[2-3]?s?/
+                 | host_test_flag "qmqp"
+                 | host_test_flag "qmtp"
+                 | host_test_flag "rsync"
+                 | host_test_flag /smtps?/
+                 | host_test_flag "spamd"
+                 | host_test_flag /ssh[1-2]?/
+                 | host_test_flag /telnets?/
+                 | host_test_flag "vnc"
+                 | host_test_url
+                 | host_test_downtime
 
     let host_test_list = Build.opt_list host_test sep_spc
 
@@ -96,7 +125,6 @@ module BBhosts =
     let lns = (comment | empty)* . page*
 
     let filter = incl "/etc/bb/bb-hosts"
-               . Util.stdexcl
 
     let xfm = transform lns filter
 
diff --git a/lenses/bootconf.aug b/lenses/bootconf.aug
new file mode 100644 (file)
index 0000000..2f9c82b
--- /dev/null
@@ -0,0 +1,130 @@
+(*
+Module: BootConf
+    Parses (Open)BSD-stype /etc/boot.conf
+
+Author: Jasper Lievisse Adriaanse <jasper@jasper.la>
+
+About: Reference
+    This lens is used to parse the second-stage bootstrap configuration
+    file, /etc/boot.conf as found on OpenBSD. The format is largely MI,
+    with MD parts included:
+    http://www.openbsd.org/cgi-bin/man.cgi?query=boot.conf&arch=i386
+
+About: Usage Example
+    To be documented
+
+About: License
+    This file is licensed under the LGPL v2+, like the rest of Augeas.
+
+About: Configuration files
+  This lens applies to /etc/boot.conf.
+See <filter>.
+*)
+
+module BootConf =
+autoload xfm
+
+(************************************************************************
+ * Utility variables/functions
+ ************************************************************************)
+
+(* View: comment *)
+let comment = Util.comment
+(* View:  empty *)
+let empty   = Util.empty
+(* View: eol *)
+let eol     = Util.eol
+(* View: fspath *)
+let fspath  = Rx.fspath
+(* View: space *)
+let space   = Sep.space
+(* View: word *)
+let word    = Rx.word
+
+(************************************************************************
+ * View: key_opt_value_line
+ *   A subnode with a keyword, an optional part consisting of a separator
+ *   and a storing lens, and an end of line
+ *
+ *   Parameters:
+ *     kw:regexp - the pattern to match as key
+ *     sto:lens  - the storing lens
+ ************************************************************************)
+let key_opt_value_line (kw:regexp) (sto:lens) =
+    [ key kw . (space . sto)? . eol ]
+
+(************************************************************************
+ * Commands
+ ************************************************************************)
+
+(* View: single_command
+   single command such as 'help' or 'time' *)
+let single_command =
+    let line_re = /help|time|reboot/
+      in [ Util.indent . key line_re . eol ]
+
+(* View: ls
+   ls [directory] *)
+let ls = Build.key_value_line
+               "ls" space (store fspath)
+
+let set_cmd = "addr"
+            | "debug"
+            | "device"
+            | "howto"
+            | "image"
+            | "timeout"
+            | "tty"
+
+(* View: set
+   set [varname [value]] *)
+let set = Build.key_value
+               "set" space
+              (key_opt_value_line set_cmd (store Rx.space_in))
+
+(* View: stty
+  stty [device [speed]] *)
+let stty =
+    let device = [ label "device" . store fspath ]
+      in let speed = [ label "speed" . store Rx.integer ]
+        in key_opt_value_line "stty" (device . (space . speed)?)
+
+(* View: echo
+   echo [args] *)
+let echo = Build.key_value_line
+                 "echo" space (store word)
+
+(* View: boot
+   boot [image [-acds]]
+   XXX: the last arguments are not always needed, so make them optional *)
+let boot =
+    let image = [ label "image" . store fspath ]
+      in let arg = [ label "arg" . store word ]
+        in Build.key_value_line "boot" space (image . space . arg)
+
+(* View: machine
+   machine [command] *)
+let machine =
+      let machine_entry = Build.key_value ("comaddr"|"memory") 
+                                          space (store word)
+                        | Build.flag ("diskinfo"|"regs")
+            in Build.key_value_line
+                    "machine" space
+                    (Build.opt_list
+                           machine_entry
+                           space)
+
+(************************************************************************
+ * Lens
+ ************************************************************************)
+
+(* View: command *)
+let command = boot | echo | ls | machine | set | stty
+
+(* View: lns *)
+let lns = ( empty | comment | command | single_command )*
+
+(* Variable: filter *)
+let filter = (incl "/etc/boot.conf")
+
+let xfm = transform lns filter
index 5e92226..f5c153e 100644 (file)
@@ -5,7 +5,7 @@ Module: Build
 Author: Raphael Pinson <raphink@gmail.com>
 
 About: License
-  This file is licensed under the LGPLv2+, like the rest of Augeas.
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
 
 About: Reference
   This file provides generic functions to build Augeas lenses
@@ -162,3 +162,243 @@ let flag (kw:regexp) = [ key kw ]
  ************************************************************************)
 let flag_line (kw:regexp) = [ key kw . eol ]
 
+
+(************************************************************************
+ * Group:                   BLOCK CONSTRUCTIONS
+ ************************************************************************)
+
+(************************************************************************
+ * View: block_generic
+ *   A block enclosed in brackets
+ *
+ *   Parameters:
+ *     entry:lens                - the entry to be stored inside the block.
+ *                                 This entry should include <Util.empty>
+ *                                 or its equivalent if necessary.
+ *     entry_noindent:lens       - the entry to be stored inside the block,
+ *                                 without indentation.
+ *                                 This entry should not include <Util.empty>
+ *     entry_noeol:lens          - the entry to be stored inside the block,
+ *                                 without eol.
+ *                                 This entry should not include <Util.empty>
+ *     entry_noindent_noeol:lens - the entry to be stored inside the block,
+ *                                 without indentation or eol.
+ *                                 This entry should not include <Util.empty>
+ *     comment:lens              - the comment lens used in the block
+ *     comment_noindent:lens     - the comment lens used in the block,
+ *                                 without indentation.
+ *     ldelim_re:regexp          - regexp for the left delimiter
+ *     rdelim_re:regexp          - regexp for the right delimiter
+ *     ldelim_default:string     - default value for the left delimiter
+ *     rdelim_default:string     - default value for the right delimiter
+ ************************************************************************)
+let block_generic
+     (entry:lens) (entry_noindent:lens)
+     (entry_noeol:lens) (entry_noindent_noeol:lens)
+     (comment:lens) (comment_noindent:lens)
+     (ldelim_re:regexp) (rdelim_re:regexp)
+     (ldelim_default:string) (rdelim_default:string) =
+     let block_single = entry_noindent_noeol | comment_noindent
+  in let block_start  = entry_noindent | comment_noindent
+  in let block_middle = (entry | comment)*
+  in let block_end    = entry_noeol | comment
+  in del ldelim_re ldelim_default
+     . ( ( block_start . block_middle . block_end )
+       | block_single )
+     . del rdelim_re rdelim_default
+
+(************************************************************************
+ * View: block_setdefault
+ *   A block enclosed in brackets
+ *
+ *   Parameters:
+ *     entry:lens - the entry to be stored inside the block.
+ *                  This entry should not include <Util.empty>,
+ *                  <Util.comment> or <Util.comment_noindent>,
+ *                  should not be indented or finish with an eol.
+ *     ldelim_re:regexp      - regexp for the left delimiter
+ *     rdelim_re:regexp      - regexp for the left delimiter
+ *     ldelim_default:string - default value for the left delimiter
+ *     rdelim_default:string - default value for the right delimiter
+ ************************************************************************)
+let block_setdelim (entry:lens)
+                     (ldelim_re:regexp)
+                     (rdelim_re:regexp)
+                     (ldelim_default:string)
+                     (rdelim_default:string) =
+    block_generic (Util.empty | Util.indent . entry . eol)
+                  (entry . eol) (Util.indent . entry) entry
+                  Util.comment Util.comment_noindent
+                  ldelim_re rdelim_re
+                  ldelim_default rdelim_default
+
+(* Variable: block_ldelim_re *)
+let block_ldelim_re = /[ \t\n]+\{[ \t\n]*/
+
+(* Variable: block_rdelim_re *)
+let block_rdelim_re = /[ \t\n]*\}/
+
+(* Variable: block_ldelim_default *)
+let block_ldelim_default = " {\n"
+
+(* Variable: block_rdelim_default *)
+let block_rdelim_default = "}"
+
+(************************************************************************
+ * View: block
+ *   A block enclosed in brackets
+ *
+ *   Parameters:
+ *     entry:lens - the entry to be stored inside the block.
+ *                  This entry should not include <Util.empty>,
+ *                  <Util.comment> or <Util.comment_noindent>,
+ *                  should not be indented or finish with an eol.
+ ************************************************************************)
+let block (entry:lens) = block_setdelim entry
+                         block_ldelim_re block_rdelim_re
+                         block_ldelim_default block_rdelim_default
+
+(* Variable: block_ldelim_newlines_re *)
+let block_ldelim_newlines_re = /[ \t\n]+\{([ \t\n]*\n)?/
+
+(* Variable: block_rdelim_newlines_re *)
+let block_rdelim_newlines_re = /[ \t]*\}/
+
+(* Variable: block_ldelim_newlines_default *)
+let block_ldelim_newlines_default = "\n{\n"
+
+(* Variable: block_rdelim_newlines_default *)
+let block_rdelim_newlines_default = "}"
+
+(************************************************************************
+ * View: block_newline
+ *   A block enclosed in brackets, with newlines forced
+ *   and indentation defaulting to a tab.
+ *
+ *   Parameters:
+ *     entry:lens - the entry to be stored inside the block.
+ *                  This entry should not include <Util.empty>,
+ *                  <Util.comment> or <Util.comment_noindent>,
+ *                  should be indented and finish with an eol.
+ ************************************************************************)
+let block_newlines (entry:lens) (comment:lens) =
+   del block_ldelim_newlines_re block_ldelim_newlines_default
+ . ((entry | comment) . (Util.empty | entry | comment)*)?
+ . del block_rdelim_newlines_re block_rdelim_newlines_default
+
+(************************************************************************
+ * View: named_block
+ *   A named <block> enclosed in brackets
+ *
+ *   Parameters:
+ *     kw:regexp  - the regexp for the block name
+ *     entry:lens - the entry to be stored inside the block
+ *                   this entry should not include <Util.empty>
+ ************************************************************************)
+let named_block (kw:regexp) (entry:lens) = [ key kw . block entry . eol ]
+
+
+(************************************************************************
+ * Group:               COMBINATORICS
+ ************************************************************************)
+
+(************************************************************************
+ * View: combine_two_ord
+ *   Combine two lenses, ensuring first lens is first
+ *
+ *   Parameters:
+ *     a:lens - the first lens
+ *     b:lens - the second lens
+ ************************************************************************)
+let combine_two_ord (a:lens) (b:lens) = a . b
+
+(************************************************************************
+ * View: combine_two
+ *   Combine two lenses
+ *
+ *   Parameters:
+ *     a:lens - the first lens
+ *     b:lens - the second lens
+ ************************************************************************)
+let combine_two (a:lens) (b:lens) =
+  combine_two_ord a b | combine_two_ord b a
+
+(************************************************************************
+ * View: combine_two_opt_ord
+ *   Combine two lenses optionally, ensuring first lens is first
+ *   (a, and optionally b)
+ *
+ *   Parameters:
+ *     a:lens - the first lens
+ *     b:lens - the second lens
+ ************************************************************************)
+let combine_two_opt_ord (a:lens) (b:lens) = a . b?
+
+(************************************************************************
+ * View: combine_two_opt
+ *   Combine two lenses optionally
+ *   (either a, b, or both, in any order)
+ *
+ *   Parameters:
+ *     a:lens - the first lens
+ *     b:lens - the second lens
+ ************************************************************************)
+let combine_two_opt (a:lens) (b:lens) =
+  combine_two_opt_ord a b | combine_two_opt_ord b a
+
+(************************************************************************
+ * View: combine_three_ord
+ *   Combine three lenses, ensuring first lens is first
+ *   (a followed by either b, c, in any order)
+ *
+ *   Parameters:
+ *     a:lens - the first lens
+ *     b:lens - the second lens
+ *     c:lens - the third lens
+ ************************************************************************)
+let combine_three_ord (a:lens) (b:lens) (c:lens) =
+  combine_two_ord a (combine_two b c)
+
+(************************************************************************
+ * View: combine_three
+ *   Combine three lenses
+ *
+ *   Parameters:
+ *     a:lens - the first lens
+ *     b:lens - the second lens
+ *     c:lens - the third lens
+ ************************************************************************)
+let combine_three (a:lens) (b:lens) (c:lens) =
+    combine_three_ord a b c
+  | combine_three_ord b a c
+  | combine_three_ord c b a
+
+
+(************************************************************************
+ * View: combine_three_opt_ord
+ *   Combine three lenses optionally, ensuring first lens is first
+ *   (a followed by either b, c, or any of them, in any order)
+ *
+ *   Parameters:
+ *     a:lens - the first lens
+ *     b:lens - the second lens
+ *     c:lens - the third lens
+ ************************************************************************)
+let combine_three_opt_ord (a:lens) (b:lens) (c:lens) =
+  combine_two_opt_ord a (combine_two_opt b c)
+
+(************************************************************************
+ * View: combine_three_opt
+ *   Combine three lenses optionally
+ *   (either a, b, c, or any of them, in any order)
+ *
+ *   Parameters:
+ *     a:lens - the first lens
+ *     b:lens - the second lens
+ *     c:lens - the third lens
+ ************************************************************************)
+let combine_three_opt (a:lens) (b:lens) (c:lens) =
+    combine_three_opt_ord a b c
+  | combine_three_opt_ord b a c
+  | combine_three_opt_ord c b a
+
diff --git a/lenses/cachefilesd.aug b/lenses/cachefilesd.aug
new file mode 100644 (file)
index 0000000..64fa35a
--- /dev/null
@@ -0,0 +1,89 @@
+(*
+Module: Cachefilesd
+  Parses /etc/cachefilesd.conf
+
+Author: Pat Riehecky <riehecky@fnal.gov>
+
+About: Reference
+  This lens tries to keep as close as possible to `man 5 cachefilesd.conf` where possible.
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   See <lns>.
+
+About: Configuration files
+   This lens applies to /etc/cachefilesd.conf.
+
+About: Examples
+   The <Test_Cachefilesd> file contains various examples and tests.
+*)
+
+module Cachefilesd =
+   autoload xfm
+
+   (************************************************************************
+    * Group:                 USEFUL PRIMITIVES
+    *************************************************************************)
+
+   (* Group: Comments and empty lines *)
+
+   (* View: eol *)
+   let eol   = Util.eol
+   (* View: comment *)
+   let comment = Util.comment
+   (* View: empty *)
+   let empty = Util.empty
+
+   (* Group: separators *)
+
+   (* View: space
+    * Separation between key and value
+    *)
+   let space = Util.del_ws_spc
+
+   (* View: colon
+    * Separation between selinux attributes
+    *)
+   let colon = Sep.colon
+
+   (* Group: entries *)
+
+   (* View: entry_key
+    * The key for an entry in the config file
+    *)
+   let entry_key = Rx.word
+
+   (* View: entry_value
+    * The value for an entry may contain all sorts of things
+    *)
+   let entry_value = /[A-Za-z0-9_.-:%]+/
+
+   (* View: nocull
+    * The nocull key has different syntax than the rest
+    *)
+   let nocull = /nocull/i
+
+   (* Group: config *)
+
+   (* View: cacheconfig
+    * This is a simple "key value" setup
+    *)
+   let cacheconfig = [ key (entry_key - nocull) . space
+                     . store entry_value . eol ]
+
+   (* View: nocull
+    * This is a either present, and therefore active or missing and
+    * not active
+    *)
+   let nocull_entry = [ key nocull . eol ]
+
+  (* View: lns *)
+  let lns = (empty | comment | cacheconfig | nocull_entry)*
+
+  let xfm = transform lns (incl "/etc/cachefilesd.conf")
+
+(* Local Variables: *)
+(* mode: caml *)
+(* End: *)
diff --git a/lenses/carbon.aug b/lenses/carbon.aug
new file mode 100644 (file)
index 0000000..8567a88
--- /dev/null
@@ -0,0 +1,54 @@
+(*
+Module: Carbon
+    Parses Carbon's configuration files
+
+Author: Marc Fournier <marc.fournier@camptocamp.com>
+
+About: Reference
+    This lens is based on the conf/*.conf.example files from the Carbon
+    package.
+
+About: Configuration files
+    This lens applies to most files in /etc/carbon/. See <filter>.
+    NB: whitelist.conf and blacklist.conf use a different syntax. This lens
+    doesn't support them.
+
+About: Usage Example
+(start code)
+    $ augtool
+    augtool> ls /files/etc/carbon/carbon.conf/
+    cache/ = (none)
+    relay/ = (none)
+    aggregator/ = (none)
+
+    augtool> get /files/etc/carbon/carbon.conf/cache/ENABLE_UDP_LISTENER
+    /files/etc/carbon/carbon.conf/cache/ENABLE_UDP_LISTENER = False
+
+    augtool> set /files/etc/carbon/carbon.conf/cache/ENABLE_UDP_LISTENER True
+    augtool> save
+    Saved 1 file(s)
+(end code)
+   The <Test_Carbon> file also contains various examples.
+
+About: License
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
+*)
+module Carbon =
+autoload xfm
+
+let comment = IniFile.comment "#" "#"
+let sep     = IniFile.sep "=" "="
+
+let entry   = IniFile.entry IniFile.entry_re sep comment
+let title   = IniFile.title IniFile.record_re
+let record  = IniFile.record title entry
+
+let lns     = IniFile.lns record comment
+
+let filter  = incl "/etc/carbon/carbon.conf"
+            . incl "/etc/carbon/relay-rules.conf"
+            . incl "/etc/carbon/rewrite-rules.conf"
+            . incl "/etc/carbon/storage-aggregation.conf"
+            . incl "/etc/carbon/storage-schemas.conf"
+
+let xfm     = transform lns filter
index d42db14..6a5b860 100644 (file)
@@ -7,7 +7,7 @@ Author:
     Raphael Pinson          <raphink@gmail.com>
 
 About: Licence
-    This file is licensed under the LGPLv2+, like the rest of Augeas.
+    This file is licensed under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
     Sample usage of this lens in augtool
@@ -28,10 +28,11 @@ module Cgconfig =
 
    let id        = /[a-zA-Z0-9_\/.-]+/
    let name      = /[^#= \n\t{}\/]+/
-   let cont_name = /(cpuacct|cpu|devices|ns|cpuset|memory|freezer|net_cls)/
+   let cont_name = /(cpuacct|cpu|devices|ns|cpuset|memory|freezer|net_cls|blkio|hugetlb|perf_event)/
    let role_name = /(admin|task)/
    let id_name   = /(uid|gid)/
    let address   = /[^#; \n\t{}]+/
+   let qaddress  = address|/"[^#;"\n\t{}]+"/
 
    let lbracket = del /[ \t\n]*\{/ " {"
    let rbracket = del /[ \t]*\}/ "}"
@@ -77,7 +78,7 @@ module Cgconfig =
        |(a_info . ce . (t_info . ce)?))? in
      brack_entry_key "perm" perm_info_lns
 
-   let variable_setting = key_value name address
+   let variable_setting = key_value name qaddress
 
 (* controllers setting *)
    let controller_info =
@@ -87,7 +88,7 @@ module Cgconfig =
 
 (* group { ... } *)
    let group_data  =
-     let lnsa = key "group" . indent . store id in
+     let lnsa = key "group" . Util.del_ws_spc . store id in
      let lnsb = ( perm_info | controller_info | comment | empty )* in
      brack_entry_base lnsa lnsb
 
index 6917d1f..7816949 100644 (file)
@@ -7,7 +7,7 @@ Author:
     Ivana Hutarova Varekova <varekova@redhat.com>
 
 About: Licence
-    This file is licensed under the LGPLv2+, like the rest of Augeas.
+    This file is licensed under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
     Sample usage of this lens in augtool:
diff --git a/lenses/channels.aug b/lenses/channels.aug
new file mode 100644 (file)
index 0000000..50ab280
--- /dev/null
@@ -0,0 +1,155 @@
+(*
+Module: Channels
+  Parses channels.conf files
+
+Author: Raphael Pinson <raphink@gmail.com>
+
+About: Reference
+  See http://linuxtv.org/vdrwiki/index.php/Syntax_of_channels.conf
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to channels.conf files.
+
+About: Examples
+   The <Test_Channels> file contains various examples and tests.
+*)
+
+module Channels =
+
+(************************************************************************
+ * Group:                 USEFUL PRIMITIVES
+ *************************************************************************)
+
+(* View: eol *)
+let eol = Util.eol
+
+(* View: comment *)
+let comment = Util.comment_generic /;[ \t]*/ "; "
+
+
+(* View: equal *)
+let equal = Sep.equal
+
+(* View: colon *)
+let colon = Sep.colon
+
+(* View: comma *)
+let comma = Sep.comma
+
+(* View: semicol *)
+let semicol = Util.del_str ";"
+
+(* View: plus *)
+let plus = Util.del_str "+"
+
+(* View: arroba *)
+let arroba = Util.del_str "@"
+
+(* View: no_colon *)
+let no_colon = /[^: \t\n][^:\n]*[^: \t\n]|[^:\n]/
+
+(* View: no_semicolon *)
+let no_semicolon = /[^;\n]+/
+
+
+(************************************************************************
+ * Group:                 FUNCTIONS
+ *************************************************************************)
+
+(* View: field
+   A generic field *)
+let field (name:string) (sto:regexp) = [ label name . store sto ]
+
+(* View: field_no_colon
+   A <field> storing <no_colon> *)
+let field_no_colon (name:string) = field name no_colon
+
+(* View: field_int
+   A <field> storing <Rx.integer> *)
+let field_int (name:string) = field name Rx.integer
+
+(* View: field_word
+   A <field> storing <Rx.word> *)
+let field_word (name:string) = field name Rx.word
+
+
+(************************************************************************
+ * Group:                 ENTRIES
+ *************************************************************************)
+
+(* View: vpid *)
+let vpid =
+   let codec = 
+           [ equal . label "codec" . store Rx.integer ]
+   in let vpid_entry (lbl:string) =
+           [ label lbl . store Rx.integer . codec? ]
+   in vpid_entry "vpid"
+    . ( plus . vpid_entry "vpid_pcr" )?
+
+
+(* View: langs *)
+let langs =
+   let lang =
+           [ label "lang" . store Rx.word ]
+   in Build.opt_list lang plus
+
+
+(* View: apid *)
+let apid =
+   let codec =
+           [ arroba . label "codec" . store Rx.integer ]
+   in let options =
+           equal . ( (langs . codec?) | codec )
+   in let apid_entry (lbl:string) =
+           [ label lbl . store Rx.integer . options? ]
+   in Build.opt_list (apid_entry "apid") comma
+    . ( semicol
+      . Build.opt_list (apid_entry "apid_dolby") comma )?
+  
+(* View: tpid *)
+let tpid =
+   let tpid_bylang =
+           [ label "tpid_bylang" . store Rx.integer
+           . (equal . langs)? ]
+   in field_int "tpid"
+      . ( semicol . Build.opt_list tpid_bylang comma )?
+
+(* View: caid *)
+let caid =
+   let caid_entry =
+           [ label "caid" . store Rx.word ]
+   in Build.opt_list caid_entry comma
+
+(* View: entry *)
+let entry = [ label "entry" . store no_semicolon
+             . (semicol . field_no_colon "provider")? . colon
+             . field_int "frequency" . colon
+             . field_word "parameter" . colon
+             . field_word "signal_source" . colon
+             . field_int "symbol_rate" . colon
+             . vpid . colon
+             . apid . colon
+             . tpid . colon
+             . caid . colon
+             . field_int "sid" . colon
+             . field_int "nid" . colon
+             . field_int "tid" . colon
+             . field_int "rid" . eol ]
+
+(* View: entry_or_comment *)
+let entry_or_comment = entry | comment
+
+(* View: group *)
+let group =
+      [ Util.del_str ":" . label "group"
+      . store no_colon . eol
+      . entry_or_comment* ]
+
+(* View: lns *)
+let lns = entry_or_comment* . group*
diff --git a/lenses/chrony.aug b/lenses/chrony.aug
new file mode 100644 (file)
index 0000000..ede2c94
--- /dev/null
@@ -0,0 +1,266 @@
+(*
+Module: Chrony
+  Parses the chrony config file
+
+Author: Pat Riehecky <riehecky@fnal.gov>
+
+About: Reference
+  This lens tries to keep as close as possible to chrony config syntax
+
+  See http://chrony.tuxfamily.org/manual.html#Configuration-file
+
+About: Limitations
+  Does not (currently) support
+    - include
+    - manual
+    - refclock
+    - tempcomp
+
+About: License
+  This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+  To be documented
+
+About: Configuration files
+  This lens applies to /etc/chrony.conf
+
+  See <filter>.
+*)
+
+module Chrony =
+  autoload xfm
+
+(************************************************************************
+ * Group: Import provided expressions
+ ************************************************************************)
+    (* View: empty *)
+    let empty   = Util.empty
+
+    (* View: eol *)
+    let eol     = Util.eol
+
+    (* View: space *)
+    let space   = Sep.space
+
+    (* Variable: email_addr *)
+    let email_addr = Rx.email_addr
+
+    (* Variable: word *)
+    let word       = Rx.word
+
+    (* Variable: integer *)
+    let integer    = Rx.integer
+
+    (* Variable: decimal *)
+    let decimal    = Rx.decimal
+
+    (* Variable: ip *)
+    let ip         = Rx.ip
+
+(************************************************************************
+ * Group: Create required expressions
+ ************************************************************************)
+    (* Variable: number *)
+    let number = integer | decimal
+
+    (* Variable: address_re *)
+    let address_re = Rx.ip | Rx.hostname
+
+    (*
+       View: comment
+            from 4.2.1 of the upstream doc
+            Chrony comments start with: ! ; # or % and must be on their own line
+    *)
+    let comment = Util.comment_generic /[ \t]*[!;#%][ \t]*/ "# "
+
+    (* Variable: no_space
+         No spaces or comment characters
+    *)
+    let no_space   = /[^ \t\r\n!;#%]+/
+
+    (* Variable: cmd_options
+         Server/Peer options with values
+    *)
+    let cmd_options = "key"
+                    | /maxdelay((dev)?ratio)?/
+                    | /(min|max)poll/
+                    | "polltarget"
+                    | "port"
+                    | "presend"
+
+    (* Variable: cmd_flags
+         Server/Peer options without values
+    *)
+    let cmd_flags = "auto_offline"|"iburst"|"noselect"|"offline"|"prefer"
+
+    (* Variable: server_peer
+         Server/Peer key names
+    *)
+    let server_peer = "server"|"peer"
+
+    (* Variable: flags
+         Options without values
+    *)
+    let flags = "dumponexit"
+              | "generatecommandkey"
+              | "lock_all"
+              | "noclientlog"
+              | "rtconutc"
+              | "rtcsync"
+
+    (* Variable: log_flags
+        log has a specific options list
+    *)
+    let log_flags = /measurments|statistics|tracking|rtc|refclocks|tempcomp/
+
+    (* Variable: simple_keys
+         Options with single values
+    *)
+    let simple_keys = "acquisitionport" | "allow" | "bindaddress"
+                    | "bindcmdaddress" | "cmdallow" | "cmddeny"
+                    | "combinelimit" | "commandkey" | "cmdport"
+                    | "corrtimeratio" | "deny" | "driftfile"
+                    | "dumpdir" | "keyfile" | "leapsectz" | "linux_hz"
+                    | "linux_freq_scale" | "logbanner" | "logchange"
+                    | "logdir" | "maxclockerror" | "maxsamples"
+                    | "maxupdateskew" | "minsamples" | "clientloglimit"
+                    | "pidfile" | "port" | "reselectdist" | "rtcdevice"
+                    | "rtcfile" | "sched_priority" | "stratumweight" | "user"
+
+(************************************************************************
+ * Group: Make some sub-lenses for use in later lenses
+ ************************************************************************)
+    (* View: host_flags *)
+    let host_flags = [ space . key cmd_flags ]
+    (* View: host_options *)
+    let host_options = [ space . key cmd_options . space . store integer ]
+    (* View: log_flag_list *)
+    let log_flag_list = [ space . key log_flags ]
+    (* View: store_address *)
+    let store_address = [ label "address" . store address_re ]
+
+(************************************************************************
+ * Group: Lenses for parsing out sections
+ ************************************************************************)
+    (* View: all_flags
+        match all flags using Build.flag_line
+    *)
+    let all_flags = Build.flag_line flags
+
+    (* View: kv
+        options with only one arg can be directly mapped to key = value
+    *)
+    let kv = Build.key_value_line_comment simple_keys space (store no_space) comment
+
+    (* Property: Options with multiple values
+    
+      Each of these gets their own parsing block
+      - server|peer <address> <options>
+      - log <options>
+      - broadcast <interval> <address> <optional port>
+      - fallbackdrift <min> <max>
+      - initstepslew <threshold> <addr> <optional extra addrs>
+      - local stratum <int>
+      - mailonchange <emailaddress> <threshold>
+      - makestep <threshold> <limit>
+      - maxchange <threshold> <delay> <limit>
+    *)
+
+    (* View: host_list
+        Find all ntp servers/peers and their flags/options
+    *)
+    let host_list = [ Util.indent . key server_peer
+                         . space . store address_re
+                         . ( host_flags | host_options )*
+                         . eol ]
+
+    (* View: log_list
+        log has a specific options list
+    *)
+    let log_list = [ Util.indent . key "log" . log_flag_list+ . eol ]
+
+    (* View: bcast
+         broadcast has specific syntax
+    *)
+    let bcast = [ Util.indent . key "broadcast"
+                      . space . [ label "interval" . store integer ]
+                      . space . store_address
+                      . ( space . [ label "port" . store integer] | eol) ]
+
+    (* View: fdrift
+         fallbackdrift has specific syntax
+    *)
+    let fdrift = [ Util.indent . key "fallbackdrift"
+                      . space . [ label "min" . store integer ]
+                      . space . [ label "max" . store integer ]
+                      . eol ]
+
+    (* View: istepslew
+         initstepslew has specific syntax
+    *)
+    let istepslew = [ Util.indent . key "initstepslew" 
+                         . space . [ label "threshold" . store number ]
+                         . ( space . store_address )+
+                         . eol ]
+
+    (* View: local
+         local has specific syntax
+    *)
+    let local = [ Util.indent . key "local" . space
+                     . [ key "stratum" . space . store integer ]
+                     . eol ]
+
+    (* View: email
+         mailonchange has specific syntax
+    *)
+    let email = [ Util.indent . key "mailonchange" . space
+                     . [ label "emailaddress" . store email_addr ]
+                     . space
+                     . [ label "threshold" . store number ]
+                     . eol ]
+
+    (* View: makestep
+         makestep has specific syntax
+    *)
+    let makestep = [ Util.indent . key "makestep"
+                      . space
+                      . [ label "threshold" . store number ]
+                      . space
+                      . [ label "limit" . store integer ]
+                      . eol ]
+
+    (* View: maxchange
+         maxchange has specific syntax
+    *)
+    let maxchange = [ Util.indent . key "maxchange"
+                      . space
+                      . [ label "threshold" . store number ]
+                      . space
+                      . [ label "delay" . store integer ]
+                      . space
+                      . [ label "limit" . store integer ]
+                      . eol ]
+
+(************************************************************************
+ * Group: Final lense summary
+ ************************************************************************)
+(* View: settings
+ *   All supported chrony settings
+ *)
+let settings = host_list | log_list | bcast | fdrift | istepslew
+             | local | email | makestep | maxchange | kv | all_flags
+
+(*
+ * View: lns
+ *   The crony lens
+ *)
+let lns = ( empty | comment | settings )*
+
+(* View: filter
+ *   The files parsed by default
+ *)
+let filter = incl "/etc/chrony.conf"
+
+let xfm = transform lns filter
+
index 66edbca..2c74f94 100644 (file)
@@ -17,7 +17,7 @@
     Author: Bryan Kearney
 
     About: License
-      This file is licensed under the LGPLv2+, like the rest of Augeas.
+      This file is licensed under the LGPL v2+, like the rest of Augeas.
 *)
 module CobblerSettings =
     autoload xfm
diff --git a/lenses/collectd.aug b/lenses/collectd.aug
new file mode 100644 (file)
index 0000000..bbd48b9
--- /dev/null
@@ -0,0 +1,36 @@
+(*
+Module: Collectd
+  Parses collectd configuration files
+
+Author: Raphael Pinson <raphink@gmail.com>
+
+About: Reference
+  This lens tries to keep as close as possible to `man 5 collectd.conf` where possible.
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to collectd configuration files. See <filter>.
+
+About: Examples
+   The <Test_Collectd> file contains various examples and tests.
+*)
+
+module Collectd =
+
+autoload xfm
+
+(* View: lns
+    Collectd is essentially Httpd-compliant configuration files *)
+let lns = Httpd.lns
+
+(* Variable: filter *)
+let filter = incl "/etc/collectd.conf"
+           . incl "/etc/collectd/*.conf"
+           . incl "/usr/share/doc/collectd/examples/collection3/etc/collection.conf"
+
+let xfm = transform lns filter
diff --git a/lenses/cpanel.aug b/lenses/cpanel.aug
new file mode 100644 (file)
index 0000000..f311826
--- /dev/null
@@ -0,0 +1,39 @@
+(*
+Module: CPanel
+  Parses cpanel.config
+
+Author: Raphael Pinson <raphink@gmail.com>
+
+About: Reference
+  This lens parses cpanel.config files
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to cpanel.config files. See <filter>.
+
+About: Examples
+   The <Test_CPanel> file contains various examples and tests.
+*)
+module CPanel =
+
+autoload xfm
+
+(* View: kv
+    A key-value pair, supporting flags and empty values *)
+let kv = [ key /[A-Za-z0-9:_.-]+/
+         . (Sep.equal . store (Rx.space_in?))?
+         . Util.eol ]
+
+(* View: lns
+    The <CPanel> lens *)
+let lns = (Util.comment | Util.empty | kv)* 
+
+(* View: filter *)
+let filter = incl "/var/cpanel/cpanel.config"
+
+let xfm = transform lns filter
index 3037e10..4787814 100644 (file)
@@ -9,7 +9,7 @@ About: Reference
  possible.
 
 About: License
-  This file is licensed under the LGPLv2+, like the rest of Augeas.
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
   Sample usage of this lens in augtool
@@ -51,6 +51,8 @@ let alpha      = /[A-Za-z]{3}/
 (* Variable: alphanum *)
 let alphanum   = (num|alpha) . ("-" . (num|alpha))?
 
+(* Variable: entry_prefix *)
+let entry_prefix = /-/
 
 (* Group: Separators *)
 
@@ -73,10 +75,12 @@ let sep_eq  = Util.del_str "="
  *************************************************************************)
 
 let shellvar =
-  let key_re = Shellvars.key_re - "entry" in
+  let key_re = /[A-Za-z-1-9_]+(\[[0-9]+\])?/ - "entry" in
   let sto_to_eol = store /[^\n]*[^ \t\n]/ in
   [ key key_re . sep_eq . sto_to_eol . eol ]
 
+(* View: - prefix of an entry *)
+let prefix     = [ label "prefix"       . store entry_prefix ]
 
 (* View: minute *)
 let minute     = [ label "minute"       . store num ]
@@ -124,6 +128,7 @@ let schedule    = [ label "schedule" . Util.del_str "@"
  *************************************************************************)
 
 let entry       = [ label "entry" . indent
+                   . prefix?
                    . ( time | schedule )
                    . sep_spc . user
                    . sep_spc . store Rx.space_in . eol ]
@@ -140,6 +145,10 @@ let lns = ( empty | comment | shellvar | entry )*
 let filter =
   incl "/etc/cron.d/*" .
   incl "/etc/crontab" .
+  excl "/etc/cron.d/at.allow" .
+  excl "/etc/cron.d/at.deny" .
+  excl "/etc/cron.d/cron.allow" .
+  excl "/etc/cron.d/cron.deny" .
   Util.stdexcl
 
 let xfm = transform lns filter
index 19b1163..cf54fb8 100644 (file)
@@ -1,4 +1,4 @@
-(* -*- coding: utf-8 -*-
+(*
 Module: Crypttab
   Parses /etc/crypttab from the cryptsetup package.
 
@@ -8,7 +8,7 @@ About: Reference
   This lens tries to keep as close as possible to `man crypttab` where possible.
 
 About: License
-  This file is licensed under the LGPLv2+, like the rest of Augeas.
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
   Sample usage of this lens in augtool
@@ -101,3 +101,5 @@ module Crypttab =
   let filter = (incl "/etc/crypttab")
 
   let xfm = transform lns filter
+
+(* coding: utf-8 *)
diff --git a/lenses/cups.aug b/lenses/cups.aug
new file mode 100644 (file)
index 0000000..7a9430d
--- /dev/null
@@ -0,0 +1,27 @@
+(*
+Module: Cups
+  Parses cups configuration files
+
+Author: Raphael Pinson <raphink@gmail.com>
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Examples
+   The <Test_Cups> file contains various examples and tests.
+*)
+
+module Cups =
+
+autoload xfm
+
+(* View: lns *)
+let lns = Httpd.lns
+
+(* Variable: filter *)
+let filter = incl "/etc/cups/*.conf"
+
+let xfm = transform lns filter
diff --git a/lenses/cyrus_imapd.aug b/lenses/cyrus_imapd.aug
new file mode 100644 (file)
index 0000000..6df1311
--- /dev/null
@@ -0,0 +1,49 @@
+(*
+Cyrus_Imapd module for Augeas
+
+Author: Free Ekanayaka <free@64studio.com>
+*)
+
+module Cyrus_Imapd =
+
+   autoload xfm
+
+(************************************************************************
+ *                           USEFUL PRIMITIVES
+ *************************************************************************)
+
+let eol        = Util.eol
+let indent     = del /[ \t]*(\n[ \t]+)?/ " "
+let comment    = Util.comment
+let empty      = Util.empty
+let eq         = del /[ \t]*:/ ":"
+let word       = /[A-Za-z0-9_.-]+/
+
+(* The value of a parameter, after the '=' sign. Postfix allows that
+ * lines are continued by starting continuation lines with spaces.
+ * The definition needs to make sure we don't add indented comment lines
+ * into values *)
+let value =
+  let chr = /[^# \t\n]/ in
+  let any = /.*/ in
+  let line = (chr . any* . chr | chr) in
+  let lines = line . (/\n[ \t]+/ . line)* in
+    store lines
+
+(************************************************************************
+ *                               ENTRIES
+ *************************************************************************)
+
+let entry     = [ key word . eq . (indent . value)? . eol ]
+
+(************************************************************************
+ *                                LENS
+ *************************************************************************)
+
+let lns        = (comment|empty|entry) *
+
+let filter     = (incl "/etc/imapd.conf")
+               . (incl "/etc/imap/*.conf")
+               . Util.stdexcl
+
+let xfm        = transform lns filter
index 6a3a876..a41a948 100644 (file)
@@ -25,6 +25,5 @@ let record  = IniFile.record title entry
 let lns    = IniFile.lns record comment
 
 let filter = (incl "/etc/darkice.cfg")
-           . Util.stdexcl
 
 let xfm = transform lns filter
index cdb7adc..02a1aab 100644 (file)
@@ -62,7 +62,8 @@ let multi_line_array_entry (k:regexp) (v:lens) =
 let version_depends =
     [ label "version"
      . [   del / *\( */ " ( " . label "relation" . store /[<>=]+/ ]
-     . [   del_ws_spc . label "number" . store /[a-zA-Z0-9_.-]+/
+     . [   del_ws_spc . label "number"
+           . store ( /[a-zA-Z0-9_.-]+/ | /\$\{[a-zA-Z0-9:]+\}/ )
          . del / *\)/ " )" ]
     ]
 
@@ -92,7 +93,7 @@ let uploaders  =
 
 let simple_src_keyword = "Source" | "Section" | "Priority"
     | "Standards\-Version" | "Homepage" | /Vcs\-Svn/ | /Vcs\-Browser/
-    | "Maintainer"
+    | "Maintainer" | "DM-Upload-Allowed" | /XS?-Python-Version/
 let depend_src_keywords = /Build\-Depends/ | /Build\-Depends\-Indep/
 
 let src_entries = (   simple_entry simple_src_keyword
@@ -101,12 +102,6 @@ let src_entries = (   simple_entry simple_src_keyword
 
 
 (* package paragraph *)
-
-let simple_bin_keyword = "Package" | "Architecture" |  "Section"
-    | "Priority" | "Essential" | "Homepage"
-
-let simple_bin_entry = simple_entry simple_bin_keyword
-
 let multi_line_entry (k:string) =
      let line = /.*[^ \t\n].*/ in
       [ label k .  del / / " " .  store line . hardeol ] *
@@ -119,8 +114,9 @@ let description
 
 
 (* binary package *)
-let simple_bin_keywords = "Package" | "Architecture"
-let depend_bin_keywords = "Depends" | "Recommends" | "Suggests"
+let simple_bin_keywords = "Package" | "Architecture" |  "Section"
+    | "Priority" | "Essential" | "Homepage" | "XB-Python-Version"
+let depend_bin_keywords = "Depends" | "Recommends" | "Suggests" | "Provides"
 
 let bin_entries = ( simple_entry simple_bin_keywords
                   | dependency_list depend_bin_keywords
index 7a3a8c7..b020f8e 100644 (file)
@@ -11,7 +11,7 @@ Reference: Freedesktop.org
    http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
 
 About: License
-   This file is licenced under the LGPLv2+, like the rest of Augeas.
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
 *)
 
 
@@ -34,11 +34,11 @@ let title = IniFile.title IniFile.record_re
 
 let sep = IniFile.sep "=" "="
 
-let setting = Rx.word
+let setting = /[A-Za-z0-9_.-]+([][@A-Za-z0-9_.-]+)?/
 
 (* Variable: sto_to_comment
 Store until comment *)
-let sto_to_comment = Sep.opt_space . store /[^# \t\n][^#\n]*[^# \t\n]|[^# \t\n]/
+let sto_to_comment = Sep.opt_space . store /[^# \t\r\n][^#\r\n]*[^# \t\r\n]|[^# \t\r\n]/
 
 (* Entries can have comments at their end and so they are modified to represent as such *)
 let entry = [ key setting . sep . sto_to_comment? . (comment|IniFile.eol) ] | comment
index 090edd5..bd1825d 100644 (file)
@@ -12,7 +12,7 @@ module Device_map =
   let empty   = Util.empty
 
   let dev_name = /(h|f|c)d[0-9]+(,[0-9a-zA-Z]+){0,2}/
-  let dev_hex  = /0x[0-9a-fA-F]+/
+  let dev_hex  = Rx.hex
   let dev_dec  = /[0-9]+/
 
   let device = del_str "(" . key ( dev_name | dev_hex | dev_dec ) .  del_str ")"
@@ -21,7 +21,7 @@ module Device_map =
 
   let lns = ( empty | comment | map ) *
 
-  let xfm = transform lns (incl "/boot/grub/device.map")
+  let xfm = transform lns (incl "/boot/*/device.map")
 
 (* Local Variables: *)
 (* mode: caml *)
index d7c87e4..692985d 100644 (file)
@@ -9,8 +9,6 @@
    configuration files as statements get usually splitted across several
    lines, rather than merged in a single one.
 
-   TODO: support the "default", "supersede", "append" and "prepend"
-   statements
 *)
 
 module Dhclient =
@@ -43,10 +41,12 @@ let word              = /[A-Za-z0-9_.-]+(\[[0-9]+\])?/
 
 (* TODO: there could be a " " in the middle of a value ... *)
 let sto_to_spc        = store /[^\\#,;{}" \t\n]+|"[^\\#"\n]+"/
-let sto_to_scl        = store /[^ \t][^;\n]+[^ \t]|[^ \t;\n]+/
+let sto_to_spc_noeval = store /[^=\\#,;{}" \t\n]|[^=\\#,;{}" \t\n][^\\#,;{}" \t\n]*|"[^\\#"\n]+"/
+let sto_to_scl        = store /[^ \t\n][^;\n]+[^ \t]|[^ \t;\n]+/
 let rfc_code          = [ key "code" . sep_spc . store word ]
                       . sep_eq
                       . [ label "value" . sto_to_scl ]
+let eval              = [ label "#eval" . Sep.equal . sep_spc . sto_to_scl ]
 let sto_number        = store /[0-9][0-9]*/
 
 (************************************************************************
@@ -89,15 +89,23 @@ let stmt_array        = [ key stmt_array_re
  *                          HASH STATEMENTS
  *************************************************************************)
 
+
 let stmt_hash_re      = "send"
                       | "option"
 
 let stmt_hash         = [ key stmt_hash_re
                         . sep_spc
-                        . [ key word . sep_spc . (sto_to_spc|rfc_code) ]
+                        . [ key word . sep_spc . (sto_to_spc_noeval|rfc_code|eval) ]
                         . sep_scl
                         . comment_or_eol ]
 
+let stmt_opt_mod_re   = "append"
+                      | "prepend"
+                      | "default"
+                      | "supersede"
+
+let stmt_opt_mod      = [ key stmt_opt_mod_re . sep_spc . stmt_hash ]
+
 (************************************************************************
  *                         BLOCK STATEMENTS
  *************************************************************************)
@@ -143,6 +151,7 @@ let stmt_block_arg    = sep_spc . sto_to_spc
 let stmt_block_entry  = sep_spc
                       . ( stmt_array
                         | stmt_hash
+                        | stmt_opt_mod
                         | stmt_block_opt
                         | stmt_block_date )
 
@@ -157,13 +166,14 @@ let stmt_block        = [ key stmt_block_re
  *                              LENS & FILTER
  *************************************************************************)
 
-let statement = (stmt_simple|stmt_array|stmt_hash|stmt_block)
+let statement = (stmt_simple|stmt_opt_mod|stmt_array|stmt_hash|stmt_block)
 
 let lns               = ( empty
                         | comment
                         | statement )*
 
 let filter            = incl "/etc/dhcp3/dhclient.conf"
-                      . Util.stdexcl
+                      . incl "/etc/dhcp/dhclient.conf"
+                      . incl "/etc/dhclient.conf"
 
 let xfm                = transform lns filter
index 40e8394..f84a409 100644 (file)
@@ -65,12 +65,12 @@ let eos               = comment?
 let sep_spc           = del /[ \t]+/ " "
 let sep_osp           = del /[ \t]*/ ""
 let sep_scl           = del /[ \t]*;([ \t]*\n)*/ ";\n"
-let sep_obr           = del /[ \t]*\{([ \t]*\n)*/ " {\n"
+let sep_obr           = del /[ \t\n]*\{([ \t]*\n)*/ " {\n"
 let sep_cbr           = del /[ \t]*\}([ \t]*\n)*/ "}\n"
 let sep_com           = del /[ \t\n]*,[ \t\n]*/ ", "
 let sep_slh           = del "\/" "/"
 let sep_col           = del ":" ":"
-let sep_eq            = del /[ \t]*=[ \t]*/ "="
+let sep_eq            = del /[ \t\n]*=[ \t\n]*/ "="
 let scl               = del ";" ";"
 
 (* Define basic types *)
@@ -92,10 +92,13 @@ let ip                = Rx.ipv4
    *   squot - strings that contain an unescaped double quote
    *)
   let bare = del qchar? "" . store (bchar+) . del qchar? ""
-  let dquot =
-    del qchar "\"" . store (bchar* . /[ \t'\/]/ . bchar*)+ . del qchar "\""
-  let squot =
-    dels "'" . store ((bchar|/[ \t\/]/)* . "\"" . (bchar|/[ \t\/]/)*)+ . dels "'"
+  let quote = Quote.do_quote (store (bchar* . /[ \t'\/]/ . bchar*)+)
+  let dquote = Quote.do_dquote (store (bchar+))
+  (* these two are for special cases.  bare_to_scl is for any bareword that is
+   * space or semicolon terminated.  dquote_any allows almost any character in
+   * between the quotes. *)
+  let bare_to_scl = Quote.do_dquote_opt (store /[^" \t\n;]+/)
+  let dquote_any = Quote.do_dquote (store /[^"\n]*[ \t]+[^"\n]*/)
 
 let sto_to_spc        = store /[^\\#,;\{\}" \t\n]+|"[^\\#"\n]+"/
 let sto_to_scl        = store /[^ \t;][^;\n=]+[^ \t;]|[^ \t;=]+/
@@ -159,7 +162,6 @@ let stmt_string_re    = "ddns-update-style"
                       | "ddns-domainname"
                       | "ddns-rev-domainname"
                       | "log-facility"
-                      | "filename"
                       | "server-name"
                       | "fixed-address"
                       | /failover[ ]+peer/
@@ -194,15 +196,19 @@ let stmt_string_re    = "ddns-update-style"
                       | "use-host-decl-names"
                       | "use-lease-addr-for-default-route"
                       | "vendor-option-space"
+                      | "primary"
+                      | "omapi-key"
 
-let stmt_string_tpl (l:lens) = [ indent
-                        . key stmt_string_re
+let stmt_string_tpl (kw:regexp) (l:lens) = [ indent
+                        . key kw
                         . sep_spc
                         . l
                         . sep_scl
                         . eos ]
 
-let stmt_string  = stmt_string_tpl bare |stmt_string_tpl squot | stmt_string_tpl dquot
+let stmt_string  = stmt_string_tpl stmt_string_re bare
+                 | stmt_string_tpl stmt_string_re quote
+                 | stmt_string_tpl "filename" dquote
 
 (************************************************************************
  *                         RANGE STATEMENTS
@@ -224,25 +230,50 @@ let stmt_range        = [ indent
 let stmt_hardware     = [ indent
                         . key "hardware"
                         . sep_spc
-                        . [ label "type" . store /ethernet|tokenring/ ]
+                        . [ label "type" . store /ethernet|tokenring|fddi/ ]
                         . sep_spc
                         . [ label "address" . store /[a-fA-F0-9:-]+/ ]
                         . sep_scl
                         . eos ]
 
 (************************************************************************
+ *                         SET STATEMENTS
+ *************************************************************************)
+let stmt_set          = [ indent
+                        . key "set"
+                        . sep_spc
+                        . store word
+                        . sep_spc
+                        . Sep.equal
+                        . sep_spc
+                        . [ label "value" . sto_to_scl ]
+                        . sep_scl
+                        . eos ]
+
+(************************************************************************
  *                         OPTION STATEMENTS
  *************************************************************************)
 (* The general case is considering options as a list *)
 
+
+let stmt_option_value = /((array of[ \t]+)?(((un)?signed[ \t]+)?integer (8|16|32)|string|ip6?-address|boolean|domain-list|text)|encapsulate [A-Za-z0-9_.-]+)/
+
+let stmt_option_list  = ([ label "arg" . bare ] | [ label "arg" . quote ])
+                        . ( sep_com . ([ label "arg" . bare ] | [ label "arg" . quote ]))*
+
+let del_trail_spc = del /[ \t\n]*/ ""
+
+let stmt_record = counter "record" . Util.del_str "{"
+                . sep_spc
+                . ([seq "record" . store stmt_option_value . sep_com]*
+                .  [seq "record" . store stmt_option_value . del_trail_spc])?
+                . Util.del_str "}"
+
 let stmt_option_code  = [ label "label" . store word . sep_spc ]
                         . [ key "code" . sep_spc . store word ]
                         . sep_eq
-                        . [ label "type" . store word ]
-
-
-let stmt_option_list  = ([ label "arg" . bare ] | [ label "arg" . dquot ] | [ label "arg" . squot ])
-                        . ( sep_com . ([ label "arg" . bare ] | [ label "arg" . dquot ] | [ label "arg" . squot ]))*
+                        . ([ label "type" . store stmt_option_value ]
+                          |[ label "record" . stmt_record ]) 
 
 let stmt_option_basic = [ key word . sep_spc . stmt_option_list ]
 let stmt_option_extra = [ key word . sep_spc . store /true|false/ . sep_spc . stmt_option_list ]
@@ -271,11 +302,13 @@ let stmt_option = stmt_option1 | stmt_option2
 (* this statement is not well documented in the manual dhcpd.conf
    we support basic use case *)
 
-let stmt_subclass = [ indent . key "subclass" . sep_spc .
-                      ([ label "name" . dquot ]|
-                       [ label "name" . squot ]|
-                       [ label "name" . bare ]) . sep_spc .
-                       [ label "value" . bare ] . sep_scl . eos ]
+let stmt_subclass = [ indent . key "subclass" . sep_spc 
+                      . ( [ label "name" .  bare_to_scl ]|[ label "name" .  dquote_any ] )
+                      . sep_spc 
+                      . ( [ label "value" . bare_to_scl ]|[ label "value" . dquote_any ] ) 
+                      . sep_scl 
+                      . eos ]
+
 
 (************************************************************************
  *                         ALLOW/DENY STATEMENTS
@@ -283,10 +316,18 @@ let stmt_subclass = [ indent . key "subclass" . sep_spc .
 (* We have to use special key for allow/deny members of
   to avoid ambiguity in the put direction *)
 
-let allow_deny_re     = "unknown-clients"
+let allow_deny_re     = /unknown(-|[ ]+)clients/
+                      | /known(-|[ ]+)clients/
+                      | /all[ ]+clients/
                       | /dynamic[ ]+bootp[ ]+clients/
                       | /authenticated[ ]+clients/
                       | /unauthenticated[ ]+clients/
+                      | "bootp"
+                      | "booting"
+                      | "duplicates"
+                      | "declines"
+                      | "client-updates"
+                      | "leasequery"
 
 let stmt_secu_re      = "allow"
                       | "deny"
@@ -294,10 +335,17 @@ let stmt_secu_re      = "allow"
 let del_allow = del /allow[ ]+members[ ]+of/ "allow members of"
 let del_deny  = del /deny[ \t]+members[ \t]+of/ "deny members of"
 
+(* bare is anything but whitespace, quote marks or semicolon.
+ * technically this should be locked down to mostly alphanumerics, but the
+ * idea right now is just to make things work.  Also ideally I would use
+ * dquote_space but I had a whale of a time with it.  It doesn't like
+ * semicolon termination and my attempts to fix that led me to 3 hours of
+ * frustration and back to this :)
+ *)
 let stmt_secu_tpl (l:lens) (s:string) =
-                  [ indent . l . sep_spc . label s . bare . sep_scl . eos ] |
-                  [ indent . l . sep_spc . label s . squot . sep_scl . eos ] |
-                  [ indent . l . sep_spc . label s . dquot . sep_scl . eos ]
+                  [ indent . l . sep_spc . label s . bare_to_scl . sep_scl . eos ] |
+                  [ indent . l . sep_spc . label s . dquote_any . sep_scl . eos ]
+
 
 let stmt_secu         = [ indent . key stmt_secu_re . sep_spc .
                           store allow_deny_re . sep_scl . eos ] |
@@ -308,17 +356,62 @@ let stmt_secu         = [ indent . key stmt_secu_re . sep_spc .
  *                         MATCH STATEMENTS
  *************************************************************************)
 
-let sto_fct = store (word . /[ \t]*\([^)]*\)/)
-let sto_option = store (/option[ ]+/ . word)
 let sto_com = /[^ \t\n,\(\)][^,\(\)]*[^ \t\n,\(\)]|[^ \t\n,\(\)]+/ | word . /[ \t]*\([^)]*\)/
-let fct_re = "substring" | "binary-to-ascii"
+(* this is already the most complicated part of this module and it's about to
+ * get worse.  match statements can be way more complicated than this
+ *
+ * examples:
+ *      using or:
+ *      match if ((option vendor-class-identifier="Banana Bready") or (option vendor-class-identifier="Cherry Sunfire"));
+ *      unneeded parenthesis:
+ *      match if (option vendor-class-identifier="Hello");
+ *
+ *      and of course the fact that the above two rules used one of infinately
+ *      many potential options instead of a builtin function.
+ *)
+(* sto_com doesn't support quoted strings as arguments.  It also doesn't
+   support single arguments (needs to match a comma) It will need to be
+   updated for lcase, ucase and log to be workable.
+
+   it also doesn't support no arguments, so gethostbyname() doesn't work.
+
+   option and config-option are considered operators.  They should be matched
+   in stmt_entry but also available under "match if" and "if" conditionals
+   leased-address, host-decl-name, both take no args and return a value.  We
+   might need to treat them as variable names in the parser.
+
+   things like this may be near-impossible to parse even with recursion
+   because we have no way of knowing when or if a subfunction takes arguments
+   set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
+
+   even if we could parse it, they could get arbitrarily complicated like:
+   binary-to-ascii(16, 8, ":", substring(hardware, 1, 6) and substring(hardware, 2, 3));
+
+   so at some point we may need to programmatically knock it off and tell
+   people to put weird stuff in an include file that augeas doesn't parse.
+
+   the other option is to change the API to not parse the if statement at all,
+   just pull in the conditional as a string.
+ *)
+
+let fct_re = "substring" | "binary-to-ascii" | "suffix" | "lcase" | "ucase"
+             | "gethostbyname" | "packet"
+             | "concat" | "reverse" | "encode-int"
+             | "extract-int" | "lease-time" | "client-state" | "exists" | "known" | "static"
+             | "pick-first-value" | "log" | "execute"
+
+(* not needs to be different because it's a negation of whatever happens next *)
+let op_re = "~="|"="|"~~"|"and"|"or"
 
 let fct_args = [ label "args" . dels "(" . sep_osp .
                  ([ label "arg" . store sto_com ] . [ label "arg" . sep_com . store sto_com ]+) .
                         sep_osp . dels ")" ]
 
-let stmt_match_if = [ dels "if" . sep_spc . store fct_re . sep_osp . label "function" . fct_args ] .
-                      sep_eq . ([ label "value" . bare ]|[ label "value" . squot ]|[ label "value" . dquot ])
+let stmt_match_ifopt = [ dels "if" . sep_spc . key "option" . sep_spc . store word .
+                      sep_eq . ([ label "value" . bare_to_scl ]|[ label "value" . dquote_any ]) ]
+
+let stmt_match_func = [ store fct_re . sep_osp . label "function" . fct_args ] .
+                      sep_eq . ([ label "value" . bare_to_scl ]|[ label "value" . dquote_any ])
 
 let stmt_match_pfv = [ label "function" . store "pick-first-value" . sep_spc .
                        dels "(" . sep_osp .
@@ -329,7 +422,7 @@ let stmt_match_pfv = [ label "function" . store "pick-first-value" . sep_spc .
 
 let stmt_match_tpl (l:lens) = [ indent . key "match" . sep_spc . l . sep_scl . eos ]
 
-let stmt_match = stmt_match_tpl (stmt_match_if | stmt_match_pfv )
+let stmt_match = stmt_match_tpl (dels "if" . sep_spc . stmt_match_func | stmt_match_pfv | stmt_match_ifopt)
 
 (************************************************************************
  *                         BLOCK STATEMENTS
@@ -345,12 +438,11 @@ let stmt_entry        =   stmt_secu
                         | stmt_noarg
                         | stmt_match
                         | stmt_subclass
+                        | stmt_set
                         | empty
                         | comment
 
-let stmt_block_noarg_re = "pool"
-                        | "group"
-                        | "allow-update"
+let stmt_block_noarg_re = "pool" | "group"
 
 let stmt_block_noarg (body:lens)
                         = [ indent
@@ -364,16 +456,14 @@ let stmt_block_arg_re = "host"
                       | "shared-network"
                       | /failover[ ]+peer/
                       | "zone"
-                      | "key"
+                      | "group"
+                      | "on"
 
 let stmt_block_arg (body:lens)
-                      = [ indent
-                        . key stmt_block_arg_re
-                        . sep_spc
-                        . sto_to_spc
-                        . sep_obr
-                        . body*
-                        . sep_cbr ]
+                      = ([ indent . key stmt_block_arg_re . sep_spc . dquote_any . sep_obr . body* . sep_cbr ]
+                         |[ indent . key stmt_block_arg_re . sep_spc . bare_to_scl . sep_obr . body* . sep_cbr ]
+                         |[ indent . del /key/ "key" . label "key_block" . sep_spc . dquote_any . sep_obr . body* . sep_cbr . del /(;([ \t]*\n)*)?/ ""  ]
+                         |[ indent . del /key/ "key" . label "key_block" . sep_spc . bare_to_scl . sep_obr . body* . sep_cbr . del /(;([ \t]*\n)*)?/ "" ])
 
 let stmt_block_subnet (body:lens)
                       = [ indent
@@ -386,11 +476,37 @@ let stmt_block_subnet (body:lens)
                         . body*
                         . sep_cbr ]
 
+let conditional (body:lens) =
+     let condition         = /[^{ \r\t\n][^{\n]*[^{ \r\t\n]|[^{ \t\n\r]/
+  in let elsif = [ indent
+                 . Build.xchgs "elsif" "@elsif"
+                 . sep_spc
+                 . store condition
+                 . sep_obr
+                 . body*
+                 . sep_cbr ]
+  in let else = [  indent
+                 . Build.xchgs "else" "@else"
+                 . sep_obr
+                 . body*
+                 . sep_cbr ]
+  in [ indent
+     . Build.xchgs "if" "@if"
+     . sep_spc
+     . store condition
+     . sep_obr
+     . body*
+     . sep_cbr
+     . elsif*
+     . else? ]
+
+
 let all_block (body:lens) =
     let lns1 = stmt_block_subnet body in
     let lns2 = stmt_block_arg body in
     let lns3 = stmt_block_noarg body in
-    (lns1 | lns2 | lns3 | stmt_entry)
+    let lns4 = conditional body in
+    (lns1 | lns2 | lns3 | lns4 | stmt_entry)
 
 let rec lns_staging = stmt_entry|all_block lns_staging
 let lns = (lns_staging)*
@@ -398,6 +514,5 @@ let lns = (lns_staging)*
 let filter = incl "/etc/dhcp3/dhcpd.conf"
            . incl "/etc/dhcp/dhcpd.conf"
            . incl "/etc/dhcpd.conf"
-           . Util.stdexcl
 
 let xfm = transform lns filter
index b9d6833..e19aab8 100644 (file)
@@ -40,7 +40,6 @@ let lns = (comment|empty|entry) *
 
 let filter            = incl "/etc/dnsmasq.conf"
                       . incl "/etc/dnsmasq.d/*"
-                      . excl "#*#"
                       . excl ".*"
                       . Util.stdexcl
 
diff --git a/lenses/dovecot.aug b/lenses/dovecot.aug
new file mode 100644 (file)
index 0000000..e3558d0
--- /dev/null
@@ -0,0 +1,133 @@
+(*
+Module: Dovecot
+  Parses dovecot configuration files.
+
+Author: Serge Smetana <serge.smetana@gmail.com>
+  Acunote http://www.acunote.com
+  Pluron, Inc. http://pluron.com
+
+About: License
+  This file is licensed under the LGPL v2+.
+
+About: Configuration files
+  This lens applies to /etc/dovecot/dovecot.conf and files in 
+  /etc/dovecot/conf.d/. See <filter>.
+
+About: Examples
+  The <Test_Dovecot> file contains various examples and tests.
+
+About: TODO
+  Support for multiline values like queries in dict-sql.conf 
+*)
+
+module Dovecot =
+   
+  autoload xfm
+
+(******************************************************************
+ * Group:                 USEFUL PRIMITIVES
+ ******************************************************************)
+
+(* View: indent *)
+let indent = Util.indent
+
+(* View: eol *)
+let eol = Util.eol
+
+(* View: empty
+Map empty lines. *)
+let empty = Util.empty
+
+(* View: comment
+Map comments in "#comment" nodes. *)
+let comment = Util.comment
+
+(* View: eq *)
+let eq = del /[ \t]*=/ " ="
+
+(* Variable: any *)
+let any = Rx.no_spaces
+
+(* Variable: value 
+Match any value after " =".
+Should not start and end with spaces. May contain spaces inside *)
+let value = any . (Rx.space . any)* 
+
+(* View: command_start *)
+let command_start = Util.del_str "!"
+
+
+(******************************************************************
+ * Group:                        ENTRIES
+ ******************************************************************)
+
+(* Variable: commands *)
+let commands = /include|include_try/
+
+(* Variable: block_names *)
+let block_names = /dict|userdb|passdb|protocol|service|plugin|namespace|map|fields|unix_listener|fifo_listener|inet_listener/
+
+(* Variable: keys 
+Match any possible key except commands and block names. *)
+let keys = Rx.word - (commands | block_names)
+
+(* View: entry
+Map simple "key = value" entries including "key =" entries with empty value. *)
+let entry = [ indent . key keys. eq . (Sep.opt_space . store value)? . eol ]
+
+(* View: command
+Map commands started with "!". *)
+let command = [ command_start . key commands . Sep.space . store Rx.fspath . eol ]
+
+(*
+View: dquote_spaces
+  Make double quotes mandatory if value contains spaces,
+  and optional if value doesn't contain spaces.
+
+Based off Quote.dquote_spaces
+
+Parameters:
+  lns1:lens - the lens before
+  lns2:lens - the lens after
+*)
+let dquote_spaces (lns1:lens) (lns2:lens) =
+     (* bare has no spaces, and is optionally quoted *)
+     let bare = Quote.do_dquote_opt (store /[^" \t\n]+/)
+     (* quoted has at least one space, and must be quoted *)
+  in let quoted = Quote.do_dquote (store /[^"\n]*[ \t]+[^"\n]*/)
+  in [ lns1 . bare . lns2 ] | [ lns1 . quoted . lns2 ]
+
+let mailbox = indent
+            . dquote_spaces
+               (key /mailbox/ . Sep.space)
+               (Build.block_newlines (entry) comment . eol)
+
+let block_ldelim_newlines_re = /[ \t]+\{([ \t\n]*\n)?/
+
+let block_newlines (entry:lens) (comment:lens) =
+      let indent = del Rx.opt_space "\t"
+   in del block_ldelim_newlines_re Build.block_ldelim_default
+ . ((entry | comment) . (Util.empty | entry | comment)*)?
+ . del Build.block_rdelim_newlines_re Build.block_rdelim_newlines_default
+
+(* View: block
+Map block enclosed in brackets recursively. 
+Block may be indented and have optional argument.
+Block body may have entries, comments, empty lines, and nested blocks recursively. *)
+let rec block = [ indent . key block_names . (Sep.space . Quote.do_dquote_opt (store /[\/A-Za-z0-9_-]+/))? . block_newlines (entry|block|mailbox) comment . eol ]
+
+
+(******************************************************************
+ * Group:                   LENS AND FILTER
+ ******************************************************************)
+
+(* View: lns
+The Dovecot lens *)
+let lns = (comment|empty|entry|command|block)*
+
+(* Variable: filter *)
+let filter = incl "/etc/dovecot/dovecot.conf"
+           . (incl "/etc/dovecot/conf.d/*.conf")
+           . Util.stdexcl
+
+let xfm = transform lns filter
index 58ba0ca..a0867cc 100644 (file)
@@ -62,8 +62,7 @@ let record  = IniFile.record title entry
 let lns    = IniFile.lns record comment
 
 let filter = (incl "/etc/dput.cf")
-           . (incl "~/.dput.cf")
-           . Util.stdexcl
+           . (incl (Sys.getenv("HOME") . "/.dput.cf"))
 
 let xfm = transform lns filter
 
diff --git a/lenses/erlang.aug b/lenses/erlang.aug
new file mode 100644 (file)
index 0000000..8fa51b6
--- /dev/null
@@ -0,0 +1,161 @@
+(*
+Module: Erlang
+  Parses Erlang configuration files
+
+Author: Raphael Pinson <raphael.pinson@camptocamp.com>
+
+About: Reference
+  This lens tries to keep as close as possible to `http://www.erlang.org/doc/man/config.html` where possible.
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to Erlang configuration files. See <filter>.
+
+About: Examples
+   The <Test_Erlang> file contains various examples and tests.
+*)
+module Erlang =
+
+
+(* Group: Spacing Functions *)
+
+(* View: lspace
+     Add spaces to the left of char *)
+let lspace (char:string) = del (/[ \t\n]*/ . char) char
+
+(* View: rspace
+     Add spaces to the right of char *)
+let rspace (char:string) = del (char . /[ \t\n]*/ ) char
+
+(* View: lrspace
+     Add spaces to the left or right of char *)
+let lrspace (char:string) = del (/[ \t\n]*/ . char . /[ \t\n]*/ ) char
+
+
+(* Group: Separators *)
+
+(* Variable: lbrace
+     Left square bracket *)
+let lbrace = "{"
+
+(* Variable: rbrace
+     Right square bracket *)
+let rbrace = "}"
+
+(* Variable: lbrack
+     Left curly brackets *)
+let lbrack = "["
+
+(* Variable: rbrack
+     Right curly brackets *)
+let rbrack = "]"
+
+(* Variable: lglob
+     Left glob separator *)
+let lglob = "<<\""
+
+(* Variable: rglob
+     Right glob separator *)
+let rglob = "\">>"
+
+(* Variable: comma *)
+let comma = ","
+
+
+(* Group: Value types *)
+
+(* View: opt_list
+     An optional list of elements, in square brackets *)
+let opt_list (lns:lens) = rspace lbrack
+                        . Build.opt_list lns (lrspace comma)
+                        . lspace rbrack
+
+(* View: integer
+     Store a <Rx.integer> *)
+let integer = store Rx.integer
+
+(* View: decimal
+     Store a decimal value *)
+let decimal = store /[0-9]+(.[0-9]+)?/
+
+(* View: quoted
+     Store a quoted value *)
+let quoted = Quote.do_quote (store /[^,\n}{]+/)
+
+(* View: bare
+     Store a bare <Rx.word> *)
+let bare = store Rx.word
+
+(* View: boolean
+     Store a boolean value *)
+let boolean = store /true|false/
+
+(* View: path
+     Store a path (<quoted>) *)
+let path = quoted
+
+(* View: glob
+     Store a glob *)
+let glob = Util.del_str lglob . store /[^\n"]+/ . Util.del_str rglob
+
+(* View: make_value
+     Make a "value" subnode for arrays/tuples *)
+let make_value (lns:lens) = [ label "value" . lns ]
+
+
+(* Group: Store types *)
+
+(* View: value
+     A single value *)
+let value (kw:regexp) (sto:lens) =
+  [ rspace lbrace
+  . key kw
+  . lrspace comma
+  . sto
+  . lspace rbrace ]
+
+(* View: value
+     A tuple of values *)
+let tuple (one:lens) (two:lens) =
+  [ rspace lbrace
+  . label "tuple"
+  . [ label "value" . one ]
+  . lrspace comma
+  . [ label "value" . two ]
+  . lspace rbrace ]
+
+(* View: list
+     A list of lenses *)
+let list (kw:regexp) (lns:lens) =
+  [ rspace lbrace
+  . key kw
+  . lrspace comma
+  . opt_list lns
+  . lspace rbrace ]
+
+(* View: value_list
+     A <list> of seq entries *)
+let value_list (kw:regexp) (sto:lens) =
+  list kw (make_value sto)
+
+(* View: application *)
+let application (name:regexp) (parameter:lens) =
+  list name parameter
+
+(* View: comment *)
+let comment = Util.comment_generic /%[ \t]*/ "% "
+
+(* View: config
+     A top-level config *)
+let config (app:lens) =
+    (Util.empty | comment)*
+  . rspace lbrack
+  . Build.opt_list app (lrspace comma)
+  . lrspace rbrack
+  . Util.del_str "." . Util.eol
+  . (Util.empty | comment)*
index 4e134c8..3de0de1 100644 (file)
@@ -76,7 +76,7 @@ About: Limitations
 module Exports =
   autoload xfm
 
-  let client_re = /[a-zA-Z0-9.@*?\/-]+/
+  let client_re = /[a-zA-Z0-9.@*?\/:-]+/
 
   let eol = Util.eol
   let lbracket  = Util.del_str "("
index 034c9d4..a87de30 100644 (file)
@@ -9,7 +9,7 @@ About: Reference
  http://wiki.fai-project.org/wiki/Setup-storage#New_configuration_file_syntax
 
 About: License
-  This file is licensed under the LGPLv2+, like the rest of Augeas.
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
 
 About: Examples
    The <Test_FAI_DiskConfig> file contains various examples and tests.
@@ -92,7 +92,7 @@ let size = [ label "size" . store size_kw . resize? ]
 let filesystem_kw = "-"
          | "swap"
          (* NOTE: Restraining this regexp would improve perfs *)
-         | (Rx.no_spaces - "-" - "swap") (* mkfs.xxx must exist *)
+         | (Rx.no_spaces - ("-" | "swap")) (* mkfs.xxx must exist *)
 
 (* Variable: filesystem *)
 let filesystem = [ label "filesystem" . store filesystem_kw ]
@@ -267,8 +267,9 @@ let cryptoption =
 
 (* Variable: disk_config *)
 let disk_config =
-    let other_label = Rx.fspath - "lvm" - "raid" - "end" - /disk[0-9]+/
-                                - "cryptsetup" - "tmpfs" in
+    let excludes = "lvm" | "raid" | "end" | /disk[0-9]+/
+                 | "cryptsetup" | "tmpfs" in
+    let other_label = Rx.fspath - excludes in
                   disk_config_entry "lvm" lvmoption volume_lvm
                 | disk_config_entry "raid" raidoption volume_raid
                 | disk_config_entry "tmpfs" option volume_tmpfs
diff --git a/lenses/fonts.aug b/lenses/fonts.aug
new file mode 100644 (file)
index 0000000..17d7a09
--- /dev/null
@@ -0,0 +1,37 @@
+(*
+Module: Fonts
+  Parses the /etc/fonts directory
+
+Author: Raphael Pinson <raphink@gmail.com>
+
+About: Reference
+  This lens tries to keep as close as possible to `man 5 fonts-conf` where possible.
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to files in the /etc/fonts directory. See <filter>.
+
+About: Examples
+   The <Test_Fonts> file contains various examples and tests.
+*)
+
+module Fonts =
+
+autoload xfm
+
+(* View: lns *)
+let lns = Xml.lns
+
+(* Variable: filter *)
+let filter = incl "/etc/fonts/fonts.conf"
+           . incl "/etc/fonts/conf.avail/*"
+           . incl "/etc/fonts/conf.d/*"
+           . excl "/etc/fonts/*/README"
+           . Util.stdexcl
+
+let xfm = transform lns filter
index eb81de6..bceaddd 100644 (file)
@@ -18,18 +18,18 @@ module Fstab =
   let spec    = /[^,# \n\t][^ \n\t]*/
 
   let comma_sep_list (l:string) =
-    let value = [ label "value" . Util.del_str "=" . store Rx.neg1 ] in
+    let value = [ label "value" . Util.del_str "=" . ( store Rx.neg1 )? ] in
       let lns = [ label l . store optlabel . value? ] in
          Build.opt_list lns comma
 
   let record = [ seq "mntent" .
                    [ label "spec" . store spec ] . sep_tab .
                    [ label "file" . store file ] . sep_tab .
-                   comma_sep_list "vfstype" . sep_tab .
-                   comma_sep_list "opt" .
-                   (sep_tab . [ label "dump" . store /[0-9]+/ ] .
-                    ( sep_spc . [ label "passno" . store /[0-9]+/ ])? )?
-                 . eol ]
+                   comma_sep_list "vfstype" .
+                   (sep_tab . comma_sep_list "opt" .
+                    (sep_tab . [ label "dump" . store /[0-9]+/ ] .
+                     ( sep_spc . [ label "passno" . store /[0-9]+/ ])? )? )?
+                 . Util.comment_or_eol ]
 
   let lns = ( empty | comment | record ) *
   let filter = (incl "/etc/fstab")
diff --git a/lenses/fuse.aug b/lenses/fuse.aug
new file mode 100644 (file)
index 0000000..cf08154
--- /dev/null
@@ -0,0 +1,45 @@
+(*
+Module: Fuse
+  Parses /etc/fuse.conf
+
+Author: Raphael Pinson <raphink@gmail.com>
+
+About: Reference
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to /etc/fuse.conf. See <filter>.
+
+About: Examples
+   The <Test_Fuse> file contains various examples and tests.
+*)
+
+
+module Fuse =
+autoload xfm
+
+(* Variable: equal *)
+let equal = del /[ \t]*=[ \t]*/ " = "
+
+(* View: mount_max *)
+let mount_max = Build.key_value_line "mount_max" equal (store Rx.integer)
+
+(* View: user_allow_other *)
+let user_allow_other = Build.flag_line "user_allow_other"
+
+
+(* View: lns
+     The fuse.conf lens
+*)
+let lns = ( Util.empty | Util.comment | mount_max | user_allow_other )*
+
+(* Variable: filter *)
+let filter = incl "/etc/fuse.conf"
+
+let xfm = transform lns filter
+
index 0b47683..e94fde1 100644 (file)
@@ -42,7 +42,7 @@ let record_anon = [ label ".anon" . ( entry | empty )+ ]
 let lns    = record_anon? . record*
 
 let filter = (incl "/etc/gdm/gdm.conf*")
-             . Util.stdexcl
+           . (incl "/etc/gdm/custom.conf")
+           . Util.stdexcl
 
 let xfm = transform lns filter
-
index 1fbec6d..cb515ed 100644 (file)
@@ -16,11 +16,14 @@ module Group =
 let eol        = Util.eol
 let comment    = Util.comment
 let empty      = Util.empty
+let dels       = Util.del_str
 
 let colon      = Sep.colon
 let comma      = Sep.comma
 
 let sto_to_spc = store Rx.space_in
+let sto_to_col  = store /[^:\n]+/
+let sto_to_eol = store /([^ \t\n].*[^ \t\n]|[^ \t\n])/
 
 let word    = Rx.word
 let password = /[A-Za-z0-9_.!*-]*/
@@ -37,14 +40,21 @@ let params    = [ label "password" . store password  . colon ]
                 . user_list?
 let entry     = Build.key_value_line word colon params
 
+let nisdefault =
+  let overrides =
+        colon
+      . [ label "password" . store word?    . colon ]
+      . [ label "gid"      . store integer? . colon ]
+      . user_list? in
+  [ dels "+" . label "@nisdefault" . overrides? . eol ]
+
+
 (************************************************************************
  *                                LENS
  *************************************************************************)
 
-let lns        = (comment|empty|entry) *
+let lns        = (comment|empty|entry|nisdefault) *
 
-let filter
-               = incl "/etc/group"
-               . Util.stdexcl
+let filter     = incl "/etc/group"
 
 let xfm        = transform lns filter
index accc92c..d587606 100644 (file)
@@ -5,7 +5,7 @@ Module: Grub
 Author: David Lutterkort <lutter@redhat.com>
 
 About: License
-   This file is licenced under the LGPLv2+, like the rest of Augeas.
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
    To be documented
@@ -78,15 +78,16 @@ module Grub =
       [ command kw indent . value_sep dflt_sep . value_to_eol . eol ]
 
     (* View: kw_boot_arg *)
-    let kw_boot_arg (kw:string) = kw_arg kw "\t" " "
+    let kw_boot_arg (kw:regexp) = kw_arg kw "\t" " "
 
     (* View: kw_menu_arg *)
-    let kw_menu_arg (kw:string) = kw_arg kw "" " "
+    let kw_menu_arg (kw:regexp) = kw_arg kw "" " "
 
     (* View: password_arg *)
     let password_arg = [ key "password" .
       (spc . [ switch "md5" ])? .
-      spc . store (/[^ \t\n]+/ - "--md5") .
+      (spc . [ switch "encrypted" ])? .
+      spc . store (/[^ \t\n]+/ - /--[^ \t\n]+/) .
       (spc . [ label "file" . store /[^ \t\n]+/ ])? .
       eol ]
 
@@ -101,8 +102,8 @@ module Grub =
      *  This is a shell-only directive in upstream grub; the grub versions
      *  in at least Fedora/RHEL use this to find devices for UEFI boot *)
     let device =
-         [ command "device" "" . Sep.space . store /\([A-Za-z0-9_.-]+\)/ . spc .
-                 [ label "file" . value_to_eol ] . Util.eol ]
+      [ command "device" "" . Sep.space . store /\([A-Za-z0-9_.-]+\)/ . spc .
+        [ label "file" . value_to_eol ] . Util.eol ]
 
     (* View: color *)
     let color =
@@ -131,6 +132,12 @@ module Grub =
           |[ spc . switch_arg /timeout|lines/ ])* .
           [ spc . key /console|serial|hercules/ ]* . eol ]
 
+    (* View: setkey *)
+    let setkey = [ command "setkey" "" .
+      ( spc . [ label "to" . store Rx.no_spaces ] .
+        spc . [ label "from" . store Rx.no_spaces ] )? .
+      eol ]
+
     (* View: menu_setting *)
     let menu_setting = kw_menu_arg "default"
                      | kw_menu_arg "fallback"
@@ -138,12 +145,15 @@ module Grub =
                      | kw_menu_arg "timeout"
                      | kw_menu_arg "splashimage"
                      | kw_menu_arg "gfxmenu"
+                     | kw_menu_arg "foreground"
                      | kw_menu_arg "background"
+                     | kw_menu_arg "verbose"
                      | serial
                      | terminal
                      | password_arg
                      | color
-                    | device
+                     | device
+                     | setkey
 
     (* View: title *)
     let title = del /title[ \t=]+/ "title " . value_to_eol . eol
@@ -197,19 +207,19 @@ module Grub =
 
     (* View: boot_setting
         <boot> entries *)
-    let boot_setting = kw_boot_arg "root"
-                     | kernel
-                     | kw_boot_arg "initrd"
-                     | kw_boot_arg "rootnoverify"
-                     | chainloader
-                     | kw_boot_arg "uuid"
-                     | kw_boot_arg "findroot"  (* Solaris extension *)
-                     | kw_boot_arg "bootfs"    (* Solaris extension *)
-                     | kw_pres "quiet"  (* Seems to be a Ubuntu extension *)
-                     | savedefault
-                     | configfile
-                     | module_line
-                     | map_line
+    let boot_setting =
+          let boot_arg_re = "root" | "initrd" | "rootnoverify" | "uuid"
+                          | "findroot" | "bootfs" (* Solaris extensions *)
+       in kw_boot_arg boot_arg_re
+        | kernel
+        | chainloader
+        | kw_pres "quiet"  (* Seems to be a Ubuntu extension *)
+        | savedefault
+        | configfile
+        | module_line
+        | map_line
+        | kw_pres "lock"
+        | kw_pres "makeactive"
 
     (* View: boot *)
     let boot =
@@ -274,7 +284,8 @@ module Grub =
     let lns = (comment | empty | menu_setting | boot | debian)*
 
     (* View: filter *)
-    let filter = incl "/boot/grub/menu.lst"
+    let filter = incl "/boot/grub/grub.conf"
+               . incl "/boot/grub/menu.lst"
                . incl "/etc/grub.conf"
 
     let xfm = transform lns filter
diff --git a/lenses/gshadow.aug b/lenses/gshadow.aug
new file mode 100644 (file)
index 0000000..c5e8947
--- /dev/null
@@ -0,0 +1,80 @@
+(*
+ Module: Gshadow
+ Parses /etc/gshadow
+
+ Author: Lorenzo M. Catucci <catucci@ccd.uniroma2.it>
+
+ Original Author: Free Ekanayaka <free@64studio.com>
+
+ About: Reference
+   - man 5 gshadow
+
+ About: License
+   This file is licensed under the LGPL v2+, like the rest of Augeas.
+
+ About:
+
+ Each line in the gshadow files represents the additional shadow-defined
+ attributes for the corresponding group, as defined in the group file.
+
+*)
+
+module Gshadow =
+
+   autoload xfm
+
+(************************************************************************
+ *                           USEFUL PRIMITIVES
+ *************************************************************************)
+
+let eol        = Util.eol
+let comment    = Util.comment
+let empty      = Util.empty
+
+let colon      = Sep.colon
+let comma      = Sep.comma
+
+let sto_to_spc = store Rx.space_in
+
+let word    = Rx.word
+let password = /[A-Za-z0-9_.!*-]*/
+let integer = Rx.integer
+
+(************************************************************************
+ * Group:                        ENTRIES
+ *************************************************************************)
+
+(* View: member *)
+let member       = [ label "member" . store word ]
+(* View: member_list
+         the member list is a comma separated list of
+         users allowed to chgrp to the group without
+         being prompted for the group's password *)
+let member_list  = Build.opt_list member comma
+
+(* View: admin *)
+let admin      = [ label "admin" . store word ]
+(* View: admin_list
+         the admin_list is a comma separated list of
+         users allowed to change the group's password
+         and the member_list *)
+let admin_list = Build.opt_list admin comma
+
+(* View: params *)
+let params     = [ label "password"  . store password  . colon ]
+                .  admin_list?     . colon
+                 .  member_list?
+
+let entry      = Build.key_value_line word colon params
+
+(************************************************************************
+ *                                LENS
+ *************************************************************************)
+
+let lns        = (comment|empty|entry) *
+
+let filter
+               = incl "/etc/gshadow"
+               . Util.stdexcl
+
+let xfm        = transform lns filter
diff --git a/lenses/gtkbookmarks.aug b/lenses/gtkbookmarks.aug
new file mode 100644 (file)
index 0000000..9421b4c
--- /dev/null
@@ -0,0 +1,36 @@
+(*
+Module: GtkBookmarks
+  Parses $HOME/.gtk-bookmarks
+
+Author: Raphael Pinson <raphael.pinson@camptocamp.com>
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to $HOME/.gtk-bookmarks. See <filter>.
+
+About: Examples
+   The <Test_GtkBookmarks> file contains various examples and tests.
+*)
+module GtkBookmarks =
+
+autoload xfm
+
+(* View: empty
+   Comment are not allowed, even empty comments *)
+let empty = Util.empty_generic Rx.opt_space
+
+(* View: entry *)
+let entry = [ label "bookmark" . store Rx.no_spaces
+            . (Sep.space . [ label "label" . store Rx.space_in ])?
+            . Util.eol ]
+
+(* View: lns *)
+let lns = (empty | entry)*
+
+(* View: xfm *)
+let xfm = transform lns (incl (Sys.getenv("HOME") . "/.gtk-bookmarks"))
index 028e43a..00a3492 100644 (file)
@@ -8,7 +8,7 @@ About: Reference
   This lens tries to keep as close as possible to `man 5 host.conf` where possible.
 
 About: License
-   This file is licenced under the LGPLv2+, like the rest of Augeas.
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
    To be documented
index 797c240..5aa4a65 100644 (file)
@@ -5,7 +5,7 @@ Module: Hostname
 Author: Raphael Pinson <raphink@gmail.com>
 
 About: License
-   This file is licenced under the LGPLv2+, like the rest of Augeas.
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
 *)
 
 
index 7b90e86..2ae450a 100644 (file)
@@ -5,10 +5,10 @@ Module: Hosts_Access
 Author: Raphael Pinson <raphink@gmail.com>
 
 About: Reference
-  This lens tries to keep as close as possible to `man 5 hosts_access` where possible.
+  This lens tries to keep as close as possible to `man 5 hosts_access` and `man 5 hosts_options` where possible.
 
 About: License
-   This file is licenced under the LGPLv2+, like the rest of Augeas.
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
    To be documented
@@ -26,13 +26,58 @@ autoload xfm
  *************************************************************************)
 
 (* View: colon *)
-let colon = del /[ \t]*:[ \t]*/ ": "
-
-(* View: comma *)
-let comma = del /([ \t]|(\\\\\n))*,([ \t]|(\\\\\n))*/ ", "
-
-(* View: sto_to_eol *)
-let sto_to_eol = store /[^ \t\n:][^\n]*[^ \t\n]|[^ \t\n:]/
+let colon = del /[ \t]*(\\\\[ \t]*\n[ \t]+)?:[ \t]*(\\\\[ \t]*\n[ \t]+)?/ ": "
+
+(* Variable: comma_sep *)
+let comma_sep = /([ \t]|(\\\\\n))*,([ \t]|(\\\\\n))*/
+
+(* Variable: ws_sep *)
+let ws_sep = / +/
+
+(* View: list_sep *)
+let list_sep = del ( comma_sep | ws_sep ) ", "
+
+(* View: list_item *)
+let list_item = store ( Rx.word - /EXCEPT/i )
+
+(* View: client_host_item
+   Allows @ for netgroups, supports [ipv6] syntax *)
+let client_host_item =
+  let client_hostname_rx = /[A-Za-z0-9_.@?*-][A-Za-z0-9_.?*-]*/ in
+  let client_ipv6_rx = "[" . /[A-Za-z0-9:?*%]+/ . "]" in
+    let client_host_rx = client_hostname_rx | client_ipv6_rx in
+    let netmask = [ Util.del_str "/" . label "netmask" . store Rx.word ] in
+      store ( client_host_rx - /EXCEPT/i ) . netmask?
+
+(* View: client_file_item *)
+let client_file_item =
+  let client_file_rx = /\/[^ \t\n,:]+/ in
+    store ( client_file_rx - /EXCEPT/i )
+
+(* Variable: option_kw
+   Since either an option or a shell command can be given, use an explicit list
+   of known options to avoid misinterpreting a command as an option *)
+let option_kw = "severity"
+              | "spawn"
+              | "twist"
+              | "keepalive"
+              | "linger"
+              | "rfc931"
+              | "banners"
+              | "nice"
+              | "setenv"
+              | "umask"
+              | "user"
+              | /allow/i
+              | /deny/i
+
+(* Variable: shell_command_rx *)
+let shell_command_rx = /[^ \t\n:][^\n]*[^ \t\n]|[^ \t\n:\\\\]/
+                         - ( option_kw . /.*/ )
+
+(* View: sto_to_colon
+   Allows escaped colon sequences *)
+let sto_to_colon = store /[^ \t\n:=][^\n:]*((\\\\:|\\\\[ \t]*\n[ \t]+)[^\n:]*)*[^ \\\t\n:]|[^ \t\n:\\\\]/
 
 (* View: except
  * The except operator makes it possible to write very compact rules.
@@ -49,31 +94,39 @@ let except (lns:lens) = [ label "except" . Sep.space
 let daemon =
   let host = [ label "host"
              . Util.del_str "@"
-             . store Rx.word ] in
+             . list_item ] in
    [ label "process"
-   . store Rx.word
+   . list_item
    . host? ]
 
 (* View: daemon_list
     A list of <daemon>s *)
-let daemon_list = Build.opt_list daemon comma
+let daemon_list = Build.opt_list daemon list_sep
 
 (* View: client *)
 let client =
   let user = [ label "user"
-             . store Rx.word
+             . list_item
              . Util.del_str "@" ] in
     [ label "client"
     . user?
-    . store Rx.word ]
+    . client_host_item ]
+
+(* View: client_file *)
+let client_file = [ label "file" . client_file_item ]
 
 (* View: client_list
     A list of <client>s *)
-let client_list = Build.opt_list client comma
+let client_list = Build.opt_list ( client | client_file ) list_sep
+
+(* View: option
+   Optional extensions defined in hosts_options(5) *)
+let option = [ key option_kw
+             . ( del /([ \t]*=[ \t]*|[ \t]+)/ " " . sto_to_colon )? ]
 
 (* View: shell_command *)
 let shell_command = [ label "shell_command"
-                    . sto_to_eol ]
+                    . store shell_command_rx ]
 
 (* View: entry *)
 let entry = [ seq "line"
@@ -82,7 +135,7 @@ let entry = [ seq "line"
             . colon
             . client_list
             . (except client_list)?
-            . (colon . shell_command)?
+            . ( (colon . option)+ | (colon . shell_command)? )
             . Util.eol ]
 
 (************************************************************************
diff --git a/lenses/htpasswd.aug b/lenses/htpasswd.aug
new file mode 100644 (file)
index 0000000..6e51745
--- /dev/null
@@ -0,0 +1,41 @@
+(*
+Module: Htpasswd
+    Parses htpasswd and rsyncd.secrets files
+
+Author: Marc Fournier <marc.fournier@camptocamp.com>
+
+About: Reference
+    This lens is based on examples in htpasswd(1) and rsyncd.conf(5)
+
+About: Usage Example
+(start code)
+    augtool> set /augeas/load/Htpasswd/lens "Htpasswd.lns"
+    augtool> set /augeas/load/Htpasswd/incl "/var/www/.htpasswd"
+    augtool> load
+
+    augtool> get /files/var/www/.htpasswd/foo
+    /files/var/www/.htpasswd/foo = $apr1$e2WS6ARQ$lYhqy9CLmwlxR/07TLR46.
+
+    augtool> set /files/var/www/.htpasswd/foo bar
+    augtool> save
+    Saved 1 file(s)
+
+    $ cat /var/www/.htpasswd
+    foo:bar
+(end code)
+
+About: License
+    This file is licensed under the LGPL v2+, like the rest of Augeas.
+*)
+
+module Htpasswd =
+autoload xfm
+
+let entry = Build.key_value_line Rx.word Sep.colon (store Rx.space_in)
+let lns   = (Util.empty | Util.comment | entry)*
+
+let filter = incl "/etc/httpd/htpasswd"
+           . incl "/etc/apache2/htpasswd"
+           . incl "/etc/rsyncd.secrets"
+
+let xfm = transform lns filter
index 958324f..46336ac 100644 (file)
@@ -9,7 +9,7 @@ About: Reference
   Online Apache configuration manual: http://httpd.apache.org/docs/trunk/
 
 About: License
-    This file is licensed under the LGPLv2+.
+    This file is licensed under the LGPL v2+.
 
 About: Lens Usage
   Sample usage of this lens in augtool
@@ -45,7 +45,7 @@ autoload xfm
 let dels (s:string)     = del s s
 
 (* deal with continuation lines *)
-let sep_spc    =  del /([ \t]+|[ \t]*\\\\\n[ \t]*)/ " "
+let sep_spc    =  del /([ \t]+|[ \t]*\\\\\r?\n[ \t]*)/ " "
 
 let sep_osp             = Sep.opt_space
 let sep_eq              = del /[ \t]*=[ \t]*/ "="
@@ -54,22 +54,29 @@ let nmtoken             = /[a-zA-Z:_][a-zA-Z0-9:_.-]*/
 let word                = /[a-zA-Z][a-zA-Z0-9._-]*/
 
 let comment             = Util.comment
-let eol                 = Util.eol
-let empty               = Util.empty
+let eol                 = Util.doseol
+let empty               = Util.empty_dos
 let indent              = Util.indent
 
 (* borrowed from shellvars.aug *)
-let char_arg_dir  = /[^ '"\t\n]|\\\\"|\\\\'/
-let char_arg_sec  = /[^ '"\t\n>]|\\\\"|\\\\'/
-let dquot = /"([^"\\\n]|\\\\.)*"/
-let squot = /'([^'\\\n]|\\\\.)*'/
+let char_arg_dir  = /[^ '"\t\r\n]|\\\\"|\\\\'/
+let char_arg_sec  = /[^ '"\t\r\n>]|\\\\"|\\\\'/
+let cdot = /\\\\./
+let cl = /\\\\\n/
+let dquot =
+     let no_dquot = /[^"\\\r\n]/
+  in /"/ . (no_dquot|cdot|cl)* . /"/
+let squot =
+     let no_squot = /[^'\\\r\n]/
+  in /'/ . (no_squot|cdot|cl)* . /'/
+let comp = /[<>=]?=/
 
 (******************************************************************
  *                            Attributes
  *****************************************************************)
 
 let arg_dir = [ label "arg" . store (char_arg_dir+|dquot|squot) ]
-let arg_sec = [ label "arg" . store (char_arg_sec+|dquot|squot) ]
+let arg_sec = [ label "arg" . store (char_arg_sec+|comp|dquot|squot) ]
 
 let argv (l:lens) = l . (sep_spc . l)*
 
@@ -77,11 +84,15 @@ let directive = [ indent . label "directive" . store word .
                   (sep_spc . argv arg_dir)? . eol ]
 
 let section (body:lens) =
-    let h = (sep_spc . argv arg_sec)? . sep_osp .
-             dels ">" . eol . body* . indent . dels "</" in
-        [ indent . dels "<" . square word h . del ">" ">" . eol ]
-
-let rec content = section (content|directive|comment|empty)
+    let eol_comment = Util.comment_generic /[ \t\n]*#[ \t]*/ "# " in
+    let inner = (sep_spc . argv arg_sec)? . sep_osp .
+             dels ">" . (eol|eol_comment) . (body . (body|comment)*)? .
+             indent . dels "</" in
+    let kword = key word in
+    let dword = del word "a" in
+        [ indent . dels "<" . square kword inner dword . del ">" ">" . eol ]
+
+let rec content = section (content|directive|empty)
 
 let lns = (content|directive|comment|empty)*
 
index 6cfbdd8..edfc23a 100644 (file)
@@ -86,7 +86,7 @@ module Inetd =
 
        let del_str = Util.del_str
 
-       let address = [ seq "addrseq" . store /([a-zA-Z0-9.-]+|\*)/ ]
+       let address = [ seq "addrseq" . store /([a-zA-Z0-9.-]+|\[[A-Za-z0-9:?*%]+\]|\*)/ ]
        let address_list = ( counter "addrseq" . (address . del_str ",")* . address )
 
        let argument = [ seq "argseq" . store /[^ \t\n]+/ ]
index ba072bf..d01dcfd 100644 (file)
@@ -5,7 +5,7 @@ Module: IniFile
 Author: Raphael Pinson <raphink@gmail.com>
 
 About: License
-  This file is licensed under the LGPLv2+, like the rest of Augeas.
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
 
 About: TODO
   Things to add in the future
@@ -32,13 +32,7 @@ module IniFile  =
 Variable: eol
   End of line, inherited from <Util.eol>
 *)
-let eol                = Util.eol
-
-(*
-View: empty
-  Empty line, an <eol> subnode
-*)
-let empty              = [ eol ]
+let eol = Util.doseol
 
 
 (* Group: Separators *)
@@ -57,6 +51,17 @@ let sep (pat:regexp) (default:string)
                        = Sep.opt_space . del pat default
 
 (*
+Variable: sep_noindent
+  Generic separator, no indentation
+
+  Parameters:
+    pat:regexp - the pattern to delete
+    default:string - the default string to use
+*)
+let sep_noindent (pat:regexp) (default:string)
+                       = del pat default
+
+(*
 Variable: sep_re
   The default regexp for a separator
 *)
@@ -83,7 +88,7 @@ let sto_to_eol         = Sep.opt_space . store Rx.space_in
 Variable: to_comment_re
   Regex until comment
 *)
-let to_comment_re = /[^;# \t\n][^;#\n]*[^;# \t\n]|[^;# \t\n]/
+let to_comment_re = /[^";# \t\n][^";#\n]*[^";# \t\n]|[^";# \t\n]/
 
 (*
 Variable: sto_to_comment
@@ -91,14 +96,43 @@ Variable: sto_to_comment
 *)
 let sto_to_comment = Sep.opt_space . store to_comment_re
 
+(*
+Variable: sto_multiline
+  Store multiline values
+*)
 let sto_multiline = Sep.opt_space
          . store (to_comment_re
                . (/[ \t]*\n/ . Rx.space . to_comment_re)*)
 
+(*
+Variable: sto_multiline_nocomment
+  Store multiline values without an end-of-line comment
+*)
+let sto_multiline_nocomment = Sep.opt_space
+         . store (Rx.space_in . (/[ \t]*\n/ . Rx.space . Rx.space_in)*)
+
 
 (* Group: Define comment and defaults *)
 
 (*
+View: comment_noindent
+  Map comments into "#comment" nodes,
+  no indentation allowed
+
+  Parameters:
+    pat:regexp - pattern to delete before commented data
+    default:string - default pattern before commented data
+
+  Sample Usage:
+  (start code)
+    let comment  = IniFile.comment_noindent "#" "#"
+    let comment  = IniFile.comment_noindent IniFile.comment_re IniFile.comment_default
+  (end code)
+*)
+let comment_noindent (pat:regexp) (default:string) =
+  Util.comment_generic_seteol (pat . Rx.opt_space) default eol
+
+(*
 View: comment
   Map comments into "#comment" nodes
 
@@ -112,9 +146,9 @@ View: comment
     let comment  = IniFile.comment IniFile.comment_re IniFile.comment_default
   (end code)
 *)
-let comment (pat:regexp) (default:string)
-                       = [ label "#comment" . sep pat default
-                        . sto_to_eol? . eol ]
+let comment (pat:regexp) (default:string) =
+  Util.comment_generic_seteol (Rx.opt_space . pat . Rx.opt_space) default eol
+
 (*
 Variable: comment_re
   Default regexp for <comment> pattern
@@ -128,6 +162,29 @@ Variable: comment_default
 *)
 let comment_default    = ";"
 
+(*
+View: empty_generic
+  Empty line, including empty comments
+
+  Parameters:
+    indent:regexp     - the indentation regexp
+    comment_re:regexp - the comment separator regexp
+*)
+let empty_generic (indent:regexp) (comment_re:regexp) =
+  Util.empty_generic_dos (indent . comment_re? . Rx.opt_space)
+
+(*
+View: empty
+  Empty line
+*)
+let empty = empty_generic Rx.opt_space comment_re
+
+(*
+View: empty_noindent
+  Empty line, without indentation
+*)
+let empty_noindent = empty_generic "" comment_re
+
 
 (************************************************************************
  * Group:                     ENTRY
@@ -136,6 +193,51 @@ let comment_default    = ";"
 (* Group: entry includes comments *)
 
 (*
+View: entry_generic_nocomment
+  A very generic INI File entry, not including comments
+  It allows to set the key lens (to set indentation
+  or subnodes linked to the key) as well as the comment
+  separator regexp, used to tune the store regexps.
+
+  Parameters:
+    kw:lens           - lens to match the key, including optional indentation
+    sep:lens          - lens to use as key/value separator
+    comment_re:regexp - comment separator regexp
+    comment:lens      - lens to use as comment
+
+  Sample Usage:
+     > let entry = IniFile.entry_generic (key "setting") sep IniFile.comment_re comment
+*)
+let entry_generic_nocomment (kw:lens) (sep:lens)
+                            (comment_re:regexp) (comment:lens) =
+     let bare_re_noquot = (/[^" \t\r\n]/ - comment_re)
+  in let bare_re = (/[^\r\n]/ - comment_re)+
+  in let no_quot = /[^"\r\n]*/
+  in let bare = Quote.do_dquote_opt_nil (store (bare_re_noquot . (bare_re* . bare_re_noquot)?))
+  in let quoted = Quote.do_dquote (store (no_quot . comment_re+ . no_quot))
+  in [ kw . sep . (Sep.opt_space . bare)? . (comment|eol) ]
+   | [ kw . sep . Sep.opt_space . quoted . (comment|eol) ]
+
+(*
+View: entry_generic
+  A very generic INI File entry
+  It allows to set the key lens (to set indentation
+  or subnodes linked to the key) as well as the comment
+  separator regexp, used to tune the store regexps.
+
+  Parameters:
+    kw:lens           - lens to match the key, including optional indentation
+    sep:lens          - lens to use as key/value separator
+    comment_re:regexp - comment separator regexp
+    comment:lens      - lens to use as comment
+
+  Sample Usage:
+     > let entry = IniFile.entry_generic (key "setting") sep IniFile.comment_re comment
+*)
+let entry_generic (kw:lens) (sep:lens) (comment_re:regexp) (comment:lens) =
+  entry_generic_nocomment kw sep comment_re comment | comment
+
+(*
 View: entry
   Generic INI File entry
 
@@ -147,13 +249,8 @@ View: entry
   Sample Usage:
      > let entry = IniFile.entry setting sep comment
 *)
-let entry (kw:regexp) (sep:lens) (comment:lens)
-                       = [ key kw . sep . sto_to_comment? . (comment|eol) ] | comment
-
-
-let entry_multiline (kw:regexp) (sep:lens) (comment:lens)
-                       = [ key kw . sep . sto_multiline? . (comment|eol) ] | comment
-
+let entry (kw:regexp) (sep:lens) (comment:lens) =
+     entry_generic (key kw) sep comment_re comment
 
 (*
 View: indented_entry
@@ -168,18 +265,107 @@ View: indented_entry
   Sample Usage:
      > let entry = IniFile.indented_entry setting sep comment
 *)
-let indented_entry (kw:regexp) (sep:lens) (comment:lens)
-                       = [ Util.del_opt_ws "" .
-                           key kw . sep . sto_to_comment? .
-                           (comment|eol)
-                         ]
-                         | comment
+let indented_entry (kw:regexp) (sep:lens) (comment:lens) =
+     entry_generic (Util.indent . key kw) sep comment_re comment
+
+(*
+View: entry_multiline_generic
+  A very generic multiline INI File entry
+  It allows to set the key lens (to set indentation
+  or subnodes linked to the key) as well as the comment
+  separator regexp, used to tune the store regexps.
+
+  Parameters:
+    kw:lens           - lens to match the key, including optional indentation
+    sep:lens          - lens to use as key/value separator
+    comment_re:regexp - comment separator regexp
+    comment:lens      - lens to use as comment
+    eol:lens          - lens for end of line
+
+  Sample Usage:
+     > let entry = IniFile.entry_generic (key "setting") sep IniFile.comment_re comment comment_or_eol
+*)
+let entry_multiline_generic (kw:lens) (sep:lens) (comment_re:regexp)
+                            (comment:lens) (eol:lens) =
+     let newline = /\r?\n[ \t]+/
+  in let bare =
+          let word_re_noquot = (/[^" \t\r\n]/ - comment_re)+
+       in let word_re = (/[^\r\n]/ - comment_re)+
+       in let base_re = (word_re_noquot . (word_re* . word_re_noquot)?)
+       in let sto_re = base_re . (newline . base_re)*
+                     | (newline . base_re)+
+       in Quote.do_dquote_opt_nil (store sto_re)
+  in let quoted =
+          let no_quot = /[^"\r\n]*/
+       in let base_re = (no_quot . comment_re+ . no_quot)
+       in let sto_re = base_re . (newline . base_re)*
+                     | (newline . base_re)+
+       in Quote.do_dquote (store sto_re)
+  in [ kw . sep . (Sep.opt_space . bare)? . eol ]
+   | [ kw . sep . Sep.opt_space . quoted . eol ]
+   | comment
+  
+
+(*
+View: entry_multiline
+  Generic multiline INI File entry
+
+  Parameters:
+    kw:regexp    - keyword regexp for the label
+    sep:lens     - lens to use as key/value separator
+    comment:lens - lens to use as comment
+*)
+let entry_multiline (kw:regexp) (sep:lens) (comment:lens) =
+  entry_multiline_generic (key kw) sep comment_re comment (comment|eol)
+
+(*
+View: entry_multiline_nocomment
+  Generic multiline INI File entry without an end-of-line comment
+
+  Parameters:
+    kw:regexp    - keyword regexp for the label
+    sep:lens     - lens to use as key/value separator
+    comment:lens - lens to use as comment
+*)
+let entry_multiline_nocomment (kw:regexp) (sep:lens) (comment:lens) =
+  entry_multiline_generic (key kw) sep comment_re comment eol
+
+(*
+View: entry_list
+  Generic INI File list entry
+
+  Parameters:
+    kw:regexp     - keyword regexp for the label
+    sep:lens      - lens to use as key/value separator
+    sto:regexp    - store regexp for the values
+    list_sep:lens - lens to use as list separator
+    comment:lens  - lens to use as comment
+*)
+let entry_list (kw:regexp) (sep:lens) (sto:regexp) (list_sep:lens) (comment:lens) =
+  let list = counter "elem"
+      . Build.opt_list [ seq "elem" . store sto ] list_sep
+  in Build.key_value_line_comment kw sep (Sep.opt_space . list) comment
+
+(*
+View: entry_list_nocomment
+  Generic INI File list entry without an end-of-line comment
+
+  Parameters:
+    kw:regexp     - keyword regexp for the label
+    sep:lens      - lens to use as key/value separator
+    sto:regexp    - store regexp for the values
+    list_sep:lens - lens to use as list separator
+*)
+let entry_list_nocomment (kw:regexp) (sep:lens) (sto:regexp) (list_sep:lens) =
+  let list = counter "elem"
+      . Build.opt_list [ seq "elem" . store sto ] list_sep
+  in Build.key_value_line kw sep (Sep.opt_space . list)
 
 (*
 Variable: entry_re
   Default regexp for <entry> keyword
 *)
-let entry_re           = ( /[A-Za-z][A-Za-z0-9._-]+/ )
+let entry_re           = ( /[A-Za-z][A-Za-z0-9._-]*/ )
 
 
 (************************************************************************
@@ -250,13 +436,13 @@ let indented_title_label (name:string) (kw:regexp)
 Variable: record_re
   Default regexp for <title> keyword pattern
 *)
-let record_re          = ( /[^]\n\/]+/ - /#comment/ )
+let record_re          = ( /[^]\r\n\/]+/ - /#comment/ )
 
 (*
 Variable: record_label_re
   Default regexp for <title_label> keyword pattern
 *)
-let record_label_re    = /[^]\n]+/
+let record_label_re    = /[^]\r\n]+/
 
 
 (* Group: Record definition *)
@@ -289,7 +475,7 @@ let record (title:lens) (entry:lens)
 
 
 (************************************************************************
- * Group:                      LENS
+ * Group:                      GENERIC LENSES
  *************************************************************************)
 
 
@@ -325,3 +511,45 @@ let lns (record:lens) (comment:lens)
                        = lns_noempty record (comment|empty)
 
 
+(************************************************************************
+ * Group:                   READY-TO-USE LENSES
+ *************************************************************************)
+
+let record_anon (entry:lens) = [ label "section" . value ".anon" . ( entry | empty )+ ]
+
+(*
+View: lns_loose
+  A loose, ready-to-use lens, featuring:
+    - sections as values (to allow '/' in names)
+    - support empty lines and comments
+    - support for [#;] as comment, defaulting to ";"
+    - .anon sections
+    - don't allow multiline values
+    - allow indented titles
+    - allow indented entries
+*)
+let lns_loose = 
+     let l_comment = comment comment_re comment_default
+  in let l_sep = sep sep_re sep_default
+  in let l_entry = indented_entry entry_re l_sep l_comment
+  in let l_title = indented_title_label "section" (record_label_re - ".anon")
+  in let l_record = record l_title l_entry
+  in (record_anon l_entry)? . l_record*
+
+(*
+View: lns_loose_multiline
+  A loose, ready-to-use lens, featuring:
+    - sections as values (to allow '/' in names)
+    - support empty lines and comments
+    - support for [#;] as comment, defaulting to ";"
+    - .anon sections
+    - allow multiline values
+*)
+let lns_loose_multiline = 
+     let l_comment = comment comment_re comment_default
+  in let l_sep = sep sep_re sep_default
+  in let l_entry = entry_multiline entry_re l_sep l_comment
+  in let l_title = title_label "section" (record_label_re - ".anon")
+  in let l_record = record l_title l_entry
+  in (record_anon l_entry)? . l_record*
+
diff --git a/lenses/inputrc.aug b/lenses/inputrc.aug
new file mode 100644 (file)
index 0000000..67032ac
--- /dev/null
@@ -0,0 +1,57 @@
+(*
+Module: Inputrc
+  Parses /etc/inputrc
+
+Author: Raphael Pinson <raphink@gmail.com>
+
+About: Reference
+  This lens tries to keep as close as possible to `man 3 readline` where possible.
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to /etc/inputrc. See <filter>.
+
+About: Examples
+   The <Test_Inputrc> file contains various examples and tests.
+*)
+
+module Inputrc =
+
+autoload xfm
+
+(* View: entry
+     An inputrc mapping entry *)
+let entry =
+   let mapping = [ label "mapping" . store Rx.word ]
+   in [ label "entry"
+      . Util.del_str "\"" . store /[^" \t\n]+/
+      . Util.del_str "\":" . Sep.space
+      . mapping
+      . Util.eol ]
+
+(* View: variable
+     An inputrc variable declaration *)
+let variable = [ Util.del_str "set" . Sep.space
+               . key (Rx.word - "entry") . Sep.space
+               . store Rx.word . Util.eol ]
+
+(* View: condition
+     An "if" declaration, recursive *)
+let rec condition = [ Util.del_str "$if" . label "@if"
+                    . Sep.space . store Rx.space_in . Util.eol
+                    . (Util.empty | Util.comment | condition | variable | entry)*
+                    . Util.del_str "$endif" . Util.eol ]
+
+(* View: lns
+     The inputrc lens *)
+let lns = (Util.empty | Util.comment | condition | variable | entry)*
+
+(* Variable: filter *)
+let filter = incl "/etc/inputrc"
+
+let xfm = transform lns filter
index 4dc280f..2051213 100644 (file)
@@ -36,21 +36,27 @@ let empty      = Util.empty
 let stanza_id    (t:string) = key t . sep_spc . sto_to_spc
 let stanza_param (l:string) = [ sep_spc . label l . sto_to_spc ]
 
-(* Define reseverved words *)
-let stanza_word = /(iface|auto|allow-[a-z-]+|mapping)/
+(* Define reseverved words and multi-value options*)
+let stanza_word =
+   /(source|iface|auto|allow-[a-z-]+|mapping|bond-slaves|bridge-ports)/
+
+(* Define stanza option indentation *)
+let stanza_indent = del /[ \t]*/ "   "
 
 (* Define additional lines for multi-line stanzas *)
-let stanza_option = [  del /[ \t]*/ "   "
-                     . key  ( /[a-z_-]+/ - stanza_word )
+let stanza_option = [  stanza_indent
+                     . key  ( /[a-z0-9_-]+/ - stanza_word )
                      . sep_spc
                      . sto_to_eol ]
 
+(* Define space-separated array *)
+let array (r:regexp) (t:string) =  del r t . label t . counter t
+   . [ sep_spc . seq t . sto_to_spc ]+
+
 (************************************************************************
  *                              AUTO
  *************************************************************************)
 
-let array (r:regexp) (t:string) =  del r t . label t . counter t
-   . [ sep_spc . seq t . sto_to_spc ]+
 let auto = [ array /(allow-)?auto/ "auto" . eol ]
 
 (************************************************************************
@@ -74,12 +80,24 @@ let mapping = [ stanza_id "mapping"
  *                              IFACE
  *************************************************************************)
 
+let multi_option (t:string) = [ stanza_indent . array t t . eol ]
+
 let iface   = [ Util.indent
               . stanza_id    "iface"
               . stanza_param "family"
               . stanza_param "method"
               . eol
-              . (stanza_option|comment|empty)* ]
+              . ( stanza_option
+                | multi_option "bond-slaves"
+                | multi_option "bridge-ports"
+                | comment
+                | empty )* ]
+
+(************************************************************************
+ *                              SOURCE
+ *************************************************************************)
+
+let source = [ key "source" . sep_spc . sto_to_eol ]
 
 (************************************************************************
  *                              STANZAS
@@ -91,7 +109,7 @@ let iface   = [ Util.indent
    come after an auto or hotplug stanza, otherwise they are considered part
    of a iface or mapping block *)
 
-let stanza_single = (auto|allow) . (comment|empty)*
+let stanza_single = (auto|allow|source) . (comment|empty)*
 let stanza_multi  = iface|mapping
 
 (************************************************************************
@@ -100,7 +118,8 @@ let stanza_multi  = iface|mapping
 
    let lns = (comment|empty)* . (stanza_multi | stanza_single)*
 
-   let filter = incl "/etc/network/interfaces"
-              . Util.stdexcl
+   let filter = (incl "/etc/network/interfaces")
+                . (incl "/etc/network/interfaces.d/*")
+                . Util.stdexcl
 
    let xfm = transform lns filter
diff --git a/lenses/iproute2.aug b/lenses/iproute2.aug
new file mode 100644 (file)
index 0000000..fa3dcb7
--- /dev/null
@@ -0,0 +1,10 @@
+module IPRoute2 =
+  autoload xfm
+
+  let empty   = [ del /[ \t]*#?[ \t]*\n/ "\n" ]
+  let id = Rx.hex | Rx.integer
+  let record = [ key id . del /[ \t]+/ "\t" . store /[a-zA-Z0-9\/-]+/ . Util.comment_or_eol ]
+
+  let lns = ( empty | Util.comment | record ) *
+
+  let xfm = transform lns (incl "/etc/iproute2/*" . Util.stdexcl)
index e0f9450..8ad2aef 100644 (file)
@@ -83,4 +83,5 @@ let table = [ del /\*/ "*" . label "table" . store /[a-z]+/ . eol .
 
 let lns = (comment|empty|table)*
 let xfm = transform lns (incl "/etc/sysconfig/iptables"
+                       . incl "/etc/sysconfig/iptables.save"
                        . incl "/etc/iptables-save")
diff --git a/lenses/jaas.aug b/lenses/jaas.aug
new file mode 100644 (file)
index 0000000..5bf4dae
--- /dev/null
@@ -0,0 +1,28 @@
+(* Module Jaas *)
+(* Author: Simon Vocella <voxsim@gmail.com> *)
+
+module Jaas =
+
+autoload xfm
+
+let space_equal = del (/[ \t]*/ . "=" . /[ \t]*/) (" = ")
+let lbrace = del (/[ \t\n]*/ . "{") "{"
+let rbrace = del ("};") "};"
+let word = /[A-Za-z0-9_.-]+/
+
+let value_re =
+        let value_squote = /'[^\n']*'/
+        in let value_squote_2 = /'[^\n']*';/
+        in let value_dquote = /"[^\n"]*"/
+        in let value_dquote_2 = /"[^\n"]*";/
+        in value_squote | value_squote_2 | value_dquote | value_dquote_2
+
+let moduleOption = [Util.del_opt_ws "" . key word . space_equal . (store value_re . Util.comment_or_eol)]
+let flag = [label "flag" . (store word . Util.eol) . moduleOption*]
+let loginModuleClass = [Util.del_opt_ws "" . label "loginModuleClass" . (store word . Util.del_ws_spc) . flag]
+
+let content = (Util.empty | Util.comment_c_style | Util.comment_multiline | loginModuleClass)*
+let loginModule = [Util.del_opt_ws "" . label "login" . (store word . lbrace) . (content . rbrace)]
+let lns = (Util.empty | Util.comment_c_style | Util.comment_multiline | loginModule)*
+let filter = incl "/opt/shibboleth-idp/conf/login.config"
+let xfm = transform lns filter
diff --git a/lenses/jettyrealm.aug b/lenses/jettyrealm.aug
new file mode 100644 (file)
index 0000000..a3fca03
--- /dev/null
@@ -0,0 +1,56 @@
+(*
+Module: JettyRealm
+  JettyRealm Properties for Augeas
+
+Author: Brian Redbeard <redbeard@dead-city.org>
+
+About: Reference
+  This lens ensures that properties files for JettyRealms are properly
+  handled by Augeas.
+
+About: License
+  This file is licensed under the LGPL License.
+
+About: Lens Usage
+  Sample usage of this lens in augtool:
+
+    * Create a new user
+      > ins user  after /files/etc/activemq/jetty-realm.properties/user
+      > set /files/etc/activemq/jetty-realm.properties/user[last()]/username redbeard
+      > set /files/etc/activemq/jetty-realm.properties/user[last()]/password testing
+      > set /files/etc/activemq/jetty-realm.properties/user[last()]/realm admin
+      ...
+
+    * Delete the user named sample_user
+      > rm /files/etc/activemq/jetty-realm.properties/user[*][username = "sample_user"]
+
+  Saving your file:
+
+      > save
+
+About: Configuration files
+  This lens applies to jetty-realm.properties files. See <filter>.
+*)
+
+module JettyRealm =
+        autoload xfm
+
+
+(* View: comma_sep *)
+let comma_sep = del /,[ \t]*/ ", "
+
+(* View: realm_entry *)
+let realm_entry = [ label "user" .
+                    [ label "username" . store Rx.word ] . del /[ \t]*:[ \t]*/ ": " .
+                    [ label "password" . store Rx.word ] . 
+                    [ label "realm" . comma_sep . store Rx.word ]* .
+                    Util.eol ]
+
+(* View: lns *)
+let lns = ( Util.comment | Util.empty | realm_entry )*
+
+
+(* Variable: filter *)
+let filter = incl "/etc/activemq/jetty-realm.properties"
+
+let xfm = transform lns filter
diff --git a/lenses/jmxaccess.aug b/lenses/jmxaccess.aug
new file mode 100644 (file)
index 0000000..c41c892
--- /dev/null
@@ -0,0 +1,58 @@
+(*
+Module: JMXAccess
+  JMXAccess module for Augeas
+
+Author: Brian Redbeard <redbeard@dead-city.org>
+
+
+About: Reference
+  This lens ensures that files included in JMXAccess are properly
+  handled by Augeas.
+
+About: License
+  This file is licensed under the LGPL License.
+
+About: Lens Usage
+  Sample usage of this lens in augtool:
+
+    * Create a new user
+      > ins user  after /files/etc/activemq/jmx.access
+      > set /files/etc/activemq/jmx.password/user[last()]/username redbeard
+      > set /files/etc/activemq/jmx.password/user[last()]/access readonly
+      ...
+
+    * Delete the user named sample_user
+      > rm /files/etc/activemq/jmx.password/user[*][username = "sample_user"]
+
+  Saving your file:
+
+      > save
+
+About: Configuration files
+  This lens applies to relevant conf files located in  /etc/activemq/ 
+  The following views correspond to the related files:
+    * access_entry:
+      /etc/activemq/jmx.access
+  See <filter>.
+  
+
+*)
+
+module JMXAccess =
+        autoload xfm
+
+(* View: access_entry *)
+let access_entry = [ label "user" .
+                    [ label "username" . store Rx.word ] . Sep.space .
+                    [ label "access" . store /(readonly|readwrite)/i ] . Util.eol ]
+
+
+
+(* View: lns *)
+let lns = ( Util.comment | Util.empty | access_entry )*
+
+
+(* Variable: filter *)
+let filter = incl "/etc/activemq/jmx.access"
+
+let xfm = transform lns filter
diff --git a/lenses/jmxpassword.aug b/lenses/jmxpassword.aug
new file mode 100644 (file)
index 0000000..369ec1d
--- /dev/null
@@ -0,0 +1,56 @@
+(*
+Module: JMXPassword
+  JMXPassword for Augeas
+
+Author: Brian Redbeard <redbeard@dead-city.org>
+
+
+About: Reference
+  This lens ensures that files included in JMXPassword are properly
+  handled by Augeas.
+
+About: License
+  This file is licensed under the LGPL License.
+
+About: Lens Usage
+  Sample usage of this lens in augtool:
+
+    * Create a new user
+      > ins user  after /files/etc/activemq/jmx.password
+      > set /files/etc/activemq/jmx.password/user[last()]/username redbeard
+      > set /files/etc/activemq/jmx.password/user[last()]/password testing
+      ...
+
+    * Delete the user named sample_user
+      > rm /files/etc/activemq/jmx.password/user[*][username = "sample_user"]
+
+  Saving your file:
+
+      > save
+
+About: Configuration files
+  This lens applies to relevant conf files located in  /etc/activemq/ 
+  The following views correspond to the related files:
+    * pass_entry:
+      /etc/activemq/jmx.password
+  See <filter>.
+  
+
+*)
+
+module JMXPassword =
+        autoload xfm
+
+(* View: pass_entry *)
+let pass_entry = [ label "user" .
+                    [ label "username" . store Rx.word ] . Sep.space .
+                    [ label "password" . store Rx.no_spaces ] . Util.eol ]
+
+(* View: lns *)
+let lns = ( Util.comment | Util.empty | pass_entry )*
+
+
+(* Variable: filter *)
+let filter = incl "/etc/activemq/jmx.password"
+
+let xfm = transform lns filter
index c22ad90..2645806 100644 (file)
@@ -29,7 +29,7 @@ let str_store =
   let q =  del "\"" "\"" in
   q . store /[^"]*/ . q . ws             (* " Emacs, relax *)
 
-let number = [ label "number" . store /-?[0-9]+(\.[0-9]+)?([eE][+-]?[0-9]+)?/ ]
+let number = [ label "number" . store /-?[0-9]+(\.[0-9]+)?([eE][+-]?[0-9]+)?/ . ws ]
 let str = [ label "string" . str_store ]
 
 let const (r:regexp) = [ label "const" . store r . ws ]
@@ -37,9 +37,9 @@ let const (r:regexp) = [ label "const" . store r . ws ]
 let value0 = str | number | const /true|false|null/
 
 let fix_value (value:lens) =
-  let array = [ label "array" . lbrack . Build.opt_list value comma . rbrack ] in
+  let array = [ label "array" . lbrack . (Build.opt_list value comma)? . rbrack ] in
   let pair = [ label "entry" . str_store . colon . value ] in
-  let obj = [ label "dict" . lbrace . Build.opt_list pair comma . rbrace ] in
+  let obj = [ label "dict" . lbrace . (Build.opt_list pair comma)? . rbrace ] in
   (str | number | obj | array | const /true|false|null/)
 
 (* Typecheck finitely deep nesting *)
index b2db8b9..ddf50ed 100644 (file)
@@ -8,7 +8,7 @@ About: References
   manual page kdump.conf(5)
 
 About: License
-   This file is licenced under the LGPLv2+, like the rest of Augeas.
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
 
 About: Configuration files
    This lens applies to /etc/kdump.conf. See <filter>.
@@ -17,16 +17,36 @@ About: Configuration files
 module Kdump =
   autoload xfm
 
+(************************************************************************
+ * Group:                 USEFUL PRIMITIVES
+ *************************************************************************)
+
 let empty = Util.empty
 let comment = Util.comment
-let value_to_eol = store Rx.space_in
+let value_to_eol = store /[^ \t\n#][^\n#]*[^ \t\n#]|[^ \t\n#]/
+let int_to_eol = store Rx.integer
 let delimiter = Util.del_ws_spc
 let eol = Util.eol
-let value_to_spc = store Rx.no_spaces
+let value_to_spc = store Rx.neg1
 let key_to_space = key /[A-Za-z0-9_.\$-]+/
-let eq = Util.del_str "="
+let eq = Sep.equal
+
+(************************************************************************
+ * Group:                 ENTRY TYPES
+ *************************************************************************)
+
+let list (kw:string) = counter kw
+                     . Build.key_value_line_comment kw delimiter
+                         (Build.opt_list [ seq kw . value_to_spc ] delimiter)
+                         comment
+
+let mdl_key_value = [ delimiter . key_to_space . ( eq . value_to_spc)? ]
+let mdl_options = [ key_to_space . mdl_key_value+ ]
+let mod_options = [ key "options" . delimiter . mdl_options . (comment|eol) ]
 
-let simple_entry (kw:string) = [ key kw . delimiter . value_to_eol . eol ]
+(************************************************************************
+ * Group:                 ENTRIES
+ *************************************************************************)
 
 (* Got from mount(8) *)
 let fs_types = "adfs" | "affs" | "autofs" | "cifs" | "coda" | "coherent"
@@ -37,32 +57,20 @@ let fs_types = "adfs" | "affs" | "autofs" | "cifs" | "coda" | "coherent"
              | "smbfs" | "sysv" | "tmpfs" | "ubifs" | "udf" | "ufs" | "umsdos"
              | "usbfs" | "vfat" | "xenix" | "xfs" | "xiafs"
 
-let fs = [ key fs_types . delimiter . value_to_eol . eol ]
-
-let bin = [ seq "bin" . delimiter . value_to_spc ]
-let extra_bins = [ key "extra_bins" . (bin)+ . eol ]
-
-let mdl = [ seq "module" . delimiter . value_to_spc ]
-let extra_modules = [ key "extra_modules" . (mdl)+ . eol ]
+let simple_kws = "raw" | "net" | "path" | "core_collector" | "kdump_post"
+               | "kdump_pre" | "default" | "ssh" | "sshkey" | "dracut_args"
+               | "fence_kdump_args"
 
+let int_kws = "force_rebuild" | "override_resettable" | "debug_mem_level"
+            | "link_delay" | "disk_timeout"
 
-let mdl_key_value = [ delimiter . key_to_space . ( eq . value_to_spc)? ]
-let mdl_options = [ key_to_space . mdl_key_value+ ]
-let mod_options = [ key "options" . delimiter . mdl_options . eol ]
-
-
-let option = simple_entry "raw"
-           | simple_entry "net"
-           | simple_entry "path"
-           | simple_entry "disk_timeout"
-           | simple_entry "core_collector"
-           | simple_entry "link_delay"
-           | simple_entry "kdump_post"
-           | simple_entry "kdump_pre"
-           | simple_entry "default"
-           | fs
-           | extra_bins
-           | extra_modules
+let option = Build.key_value_line_comment ( simple_kws | fs_types )
+                                          delimiter value_to_eol comment
+           | Build.key_value_line_comment int_kws delimiter int_to_eol comment
+           | list "extra_bins"
+           | list "extra_modules"
+           | list "blacklist"
+           | list "fence_kdump_nodes"
            | mod_options
 
 (* View: lns
index 7748738..9fd02ff 100644 (file)
@@ -8,7 +8,7 @@ About: Reference
   This lens tries to keep as close as possible to `man 5 keepalived.conf` where possible.
 
 About: License
-   This file is licenced under the LGPLv2+, like the rest of Augeas.
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
    To be documented
@@ -42,18 +42,6 @@ let opt_eol = del /[ \t]*\n?/ " "
 (* View: sep_spc *)
 let sep_spc = Sep.space
 
-(* View: sep_opt_spc *)
-let sep_opt_spc = Sep.opt_space
-
-(* View: sep_dquot *)
-let sep_dquot = Util.del_str "\""
-
-(* View: lbracket *)
-let lbracket = Util.del_str "{"
-
-(* View: rbracket *)
-let rbracket = Util.del_str "}"
-
 (* View: comment
 Map comments in "#comment" nodes *)
 let comment = Util.comment_generic /[ \t]*[#!][ \t]*/ "# "
@@ -89,21 +77,27 @@ let sto_num = store Rx.relinteger
 let sto_to_eol = store /[^#! \t\n][^#!\n]*[^#! \t\n]|[^#! \t\n]/
 
 (* View: field *)
-let field (kw:string) (sto:lens) = indent . Build.key_value_line_comment kw sep_spc sto comment_eol
+let field (kw:regexp) (sto:lens) = indent . Build.key_value_line_comment kw sep_spc sto comment_eol
 
 (* View: flag
 A single word *)
 let flag (kw:regexp) = [ indent . key kw . comment_or_eol ]
 
+(* View: ip_port
+   An IP <space> port pair *)
+let ip_port = [ label "ip" . sto_word ] . sep_spc . [ label "port" . sto_num ]
+
 (* View: lens_block 
-A generic block with a title lens *)
-let lens_block (title:lens) (sto:lens) = [ indent . title . opt_eol . lbracket
-                                         . (sto | empty | comment)+
-                                         . indent . rbracket . eol ]
+A generic block with a title lens.
+The definition is very similar to Build.block_newlines
+but uses a different type of <comment>. *)
+let lens_block (title:lens) (sto:lens) =
+   [ indent . title
+   . Build.block_newlines sto comment . eol ]
 
 (* View: block
 A simple block with just a block title *)
-let block (kw:string) (sto:lens) = lens_block (key kw) sto
+let block (kw:regexp) (sto:lens) = lens_block (key kw) sto
 
 (* View: named_block 
 A block with a block title and name *)
@@ -133,12 +127,13 @@ let email = [ indent . label "email" . sto_email_addr . comment_or_eol ]
 
 (* View: global_defs_field
 Possible fields in the global_defs block *)
-let global_defs_field = block "notification_email" email
-                      | field "notification_email_from" sto_email_addr
-                      | field "smtp_server" sto_word
-                      | field "smtp_connect_timeout" sto_num
-                      | field "lvs_id" sto_word
-                      | field "router_id" sto_word
+let global_defs_field =
+      let word_re = "smtp_server"|"lvs_id"|"router_id"
+   in let num_re = "smtp_connect_timeout"
+   in block "notification_email" email
+    | field "notification_email_from" sto_email_addr
+    | field word_re sto_word
+    | field num_re sto_num
 
 (* View: global_defs
 A global_defs block *)
@@ -194,35 +189,30 @@ let vrrp_sync_group_field = block "group" [ indent . key word . comment_or_eol ]
 let vrrp_sync_group = named_block "vrrp_sync_group" vrrp_sync_group_field
 
 (* View: vrrp_instance_field *)
-let vrrp_instance_field = field "state" sto_word
-                        | field "interface" sto_word
-                        | field "lvs_sync_daemon_interface" sto_word
-                        | field "virtual_router_id" sto_num
-                        | field "priority" sto_num
-                        | field "advert_int" sto_num
-                        | field "garp_master_delay" sto_num
-                        | field "notify_master" sto_to_eol
-                        | field "notify_backup" sto_to_eol
-                        | field "notify_fault" sto_to_eol
-                        | flag "smtp_alert"
-                        | flag "nopreempt"
-                        | flag "ha_suspend"
-                        | flag "debug"
-                        | block "authentication" (
-                                field "auth_type" sto_word
-                              | field "auth_pass" sto_word
-                              )
-                        | block "virtual_ipaddress" static_ipaddress_field
-                        | block "track_interface" ( flag word )
-                        | block "track_script" ( flag word )
+let vrrp_instance_field =
+      let word_re = "state" | "interface" | "lvs_sync_daemon_interface"
+   in let num_re = "virtual_router_id" | "priority" | "advert_int" | "garp_master_delay"
+   in let to_eol_re = /notify_(master|backup|fault)/
+   in let flag_re = "smtp_alert" | "nopreempt" | "ha_suspend" | "debug"
+   in field word_re sto_word
+    | field num_re sto_num
+    | field to_eol_re sto_to_eol
+    | flag flag_re
+    | block "authentication" (
+         field /auth_(type|pass)/ sto_word
+         )
+    | block "virtual_ipaddress" static_ipaddress_field
+    | block /track_(interface|script)/ ( flag word )
 
 (* View: vrrp_instance *)
 let vrrp_instance = named_block "vrrp_instance" vrrp_instance_field
 
 (* View: vrrp_script_field *)
-let vrrp_script_field = field "script" sto_to_eol
-                      | field "interval" sto_num
-                      | field "weight" sto_num
+let vrrp_script_field =
+      let num_re = "interval" | "weight"
+   in let to_eol_re = "script"
+   in field to_eol_re sto_to_eol
+    | field num_re sto_num
 
 (* View: vrrp_script *)
 let vrrp_script = named_block "vrrp_script" vrrp_script_field
@@ -234,24 +224,88 @@ let vrrpd_conf = vrrp_sync_group | vrrp_instance | vrrp_script
 
 
 (************************************************************************
- * Group:                 LVS CONFIGURATION
+ * Group:                 REAL SERVER CHECKS CONFIGURATION
  *************************************************************************)
 
 (* View: tcp_check_field *)
-let tcp_check_field = field "connect_timeout" sto_num
-                    | field "connect_port" sto_num
+let tcp_check_field =
+      let word_re = "bindto"
+   in let num_re = /connect_(timeout|port)/
+   in field word_re sto_word
+    | field num_re sto_num
+
+(* View: misc_check_field *)
+let misc_check_field =
+      let flag_re = "misc_dynamic"
+   in let num_re = "misc_timeout"
+   in let to_eol_re = "misc_path"
+   in field num_re sto_num
+    | flag flag_re
+    | field to_eol_re sto_to_eol
+
+(* View: smtp_host_check_field *)
+let smtp_host_check_field =
+      let word_re = "connect_ip" | "bindto"
+   in let num_re = "connect_port"
+   in field word_re sto_word
+    | field num_re sto_num
+
+(* View: smtp_check_field *)
+let smtp_check_field =
+      let word_re = "connect_ip" | "bindto"
+   in let num_re = "connect_timeout" | "retry" | "delay_before_retry"
+   in let to_eol_re = "helo_name"
+   in field word_re sto_word
+    | field num_re sto_num
+    | field to_eol_re sto_to_eol
+    | block "host" smtp_host_check_field
+
+(* View: http_url_check_field *)
+let http_url_check_field =
+      let word_re = "digest"
+   in let num_re = "status_code"
+   in let to_eol_re = "path"
+   in field word_re sto_word
+    | field num_re sto_num
+    | field to_eol_re sto_to_eol
+
+(* View: http_check_field *)
+let http_check_field =
+      let num_re = /connect_(timeout|port)/ | "nb_get_retry" | "delay_before_retry"
+   in field num_re sto_num
+    | block "url" http_url_check_field
 
 (* View: real_server_field *)
-let real_server_field = field "weight" sto_num
-                      | block "TCP_CHECK" tcp_check_field
+let real_server_field =
+      let num_re = "weight"
+   in let flag_re = "inhibit_on_failure"
+   in let to_eol_re = /notify_(up|down)/
+   in field num_re sto_num
+    | flag flag_re
+    | field to_eol_re sto_to_eol
+    | block "TCP_CHECK" tcp_check_field
+    | block "MISC_CHECK" misc_check_field
+    | block "SMTP_CHECK" smtp_check_field
+    | block /(HTTP|SSL)_GET/ http_check_field
+
+(************************************************************************
+ * Group:                 LVS CONFIGURATION
+ *************************************************************************)
 
 (* View: virtual_server_field *)
-let virtual_server_field = field "delay_loop" sto_num
-                         | field "lb_algo" sto_word
-                         | field "lb_kind" sto_word
-                         | field "nat_mask" sto_word
-                         | field "protocol" sto_word
-                         | named_block_arg "real_server" "ip" "port" real_server_field
+let virtual_server_field =
+      let num_re = "delay_loop" | "persistence_timeout" | "quorum" | "hysteresis"
+   in let word_re = /lb_(algo|kind)/ | "nat_mask" | "protocol" | "persistence_granularity"
+                      | "virtualhost"
+   in let flag_re = "ops" | "ha_suspend" | "alpha" | "omega"
+   in let to_eol_re = /quorum_(up|down)/
+   in let ip_port_re = "sorry_server"
+   in field num_re sto_num
+    | field word_re sto_word
+    | flag flag_re
+    | field to_eol_re sto_to_eol
+    | field ip_port_re ip_port
+    | named_block_arg "real_server" "ip" "port" real_server_field
 
 (* View: virtual_server *)
 let virtual_server = named_block_arg "virtual_server" "ip" "port" virtual_server_field
@@ -278,7 +332,6 @@ let lns = ( empty | comment | global_conf | vrrpd_conf | lvs_conf )*
 
 (* Variable: filter *)
 let filter = incl "/etc/keepalived/keepalived.conf"
-    . Util.stdexcl
 
 let xfm = transform lns filter
 
diff --git a/lenses/known_hosts.aug b/lenses/known_hosts.aug
new file mode 100644 (file)
index 0000000..157edd1
--- /dev/null
@@ -0,0 +1,50 @@
+(*
+Module: Known_Hosts
+  Parses SSH known_hosts files
+
+Author: Raphaël Pinson <raphink@gmail.com>
+
+About: Reference
+  This lens ensures that conf files included in ActiveMQ /FuseMQ are properly
+  handled by Augeas.
+
+About: License
+  This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+  Sample usage of this lens in augtool:
+
+    * Get a key by name from ssh_known_hosts
+      > print /files/etc/ssh_known_hosts/*[.="foo.example.com"]
+      ...
+
+    * Change a host's key
+      > set /files/etc/ssh_known_hosts/*[.="foo.example.com"]/key "newkey"
+
+About: Configuration files
+  This lens applies to SSH known_hosts files. See <filter>.
+
+*)
+
+module Known_Hosts =
+
+autoload xfm
+
+(* View: entry
+     A known_hosts entry *)
+let entry = [ Util.indent . seq "entry" . store Rx.neg1
+            . Sep.space
+            . [ label "type" . store Rx.no_spaces ]
+            . Sep.space
+            . [ label "key" . store Rx.no_spaces ]
+            . Util.eol ]
+
+(* View: lns
+     The known_hosts lens *)
+let lns = (Util.empty | Util.comment | entry)*
+
+(* Variable: filter *)
+let filter = incl "/etc/ssh/ssh_known_hosts"
+           . incl (Sys.getenv("HOME") . "/.ssh/known_hosts")
+
+let xfm = transform lns filter
diff --git a/lenses/koji.aug b/lenses/koji.aug
new file mode 100644 (file)
index 0000000..8acd516
--- /dev/null
@@ -0,0 +1,40 @@
+(*
+Module: Koji
+  Parses koji config files
+
+Author: Pat Riehecky <riehecky@fnal.gov>
+
+About: Reference
+  This lens tries to keep as close as possible to koji config syntax
+
+About: License
+  This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+  To be documented
+
+About: Configuration files
+  This lens applies to:
+    /etc/koji.conf
+    /etc/kojid/kojid.conf
+    /etc/koji-hub/hub.conf
+    /etc/kojira/kojira.conf
+    /etc/kojiweb/web.conf
+    /etc/koji-shadow/koji-shadow.conf 
+
+  See <filter>.
+*)
+
+module Koji =
+  autoload xfm
+
+let lns     = IniFile.lns_loose_multiline
+
+let filter = incl "/etc/koji.conf"
+           . incl "/etc/kojid/kojid.conf"
+           . incl "/etc/koji-hub/hub.conf"
+           . incl "/etc/kojira/kojira.conf"
+           . incl "/etc/kojiweb/web.conf"
+           . incl "/etc/koji-shadow/koji-shadow.conf"
+
+let xfm = transform lns filter
index 0eb792c..8b4ebe4 100644 (file)
@@ -2,14 +2,15 @@ module Krb5 =
 
 autoload xfm
 
-let comment = Inifile.comment "#" "#"
+let comment = Inifile.comment IniFile.comment_re "#"
 let empty = Inifile.empty
 let eol = Inifile.eol
 let dels = Util.del_str
 
 let indent = del /[ \t]*/ ""
+let comma_or_space_sep = del /[ \t,]{1,}/ " "
 let eq = del /[ \t]*=[ \t]*/ " = "
-let eq_openbr = del /[ \t]*=[ \t\n]*\{([ \t]*\n)*/ " = {"
+let eq_openbr = del /[ \t]*=[ \t\n]*\{[ \t]*\n/ " = {\n"
 let closebr = del /[ \t]*\}/ "}"
 
 (* These two regexps for realms and apps are not entirely true
@@ -24,26 +25,48 @@ let realm_re = /[A-Z][.a-zA-Z0-9-]*/
 let app_re = /[a-z][a-zA-Z0-9_]*/
 let name_re = /[.a-zA-Z0-9_-]+/
 
-let value = store /[^;# \t\n{}]+/
-let entry (kw:regexp) (sep:lens) (comment:lens)
+let value_br = store /[^;# \t\r\n{}]+/
+let value = store /[^;# \t\r\n]+/
+let entry (kw:regexp) (sep:lens) (value:lens) (comment:lens)
     = [ indent . key kw . sep . value . (comment|eol) ] | comment
 
+let subsec_entry (kw:regexp) (sep:lens) (comment:lens)
+    = ( entry kw sep value_br comment ) | empty
+
 let simple_section (n:string) (k:regexp) =
   let title = Inifile.indented_title n in
-  let entry = entry k eq comment in
+  let entry = entry k eq value comment in
     Inifile.record title entry
 
 let record (t:string) (e:lens) =
   let title = Inifile.indented_title t in
     Inifile.record title e
 
+let v4_name_convert (subsec:lens) = [ indent . key "v4_name_convert" .
+                        eq_openbr .  subsec* . closebr . eol ]
+
+(*
+  For the enctypes this appears to be a list of the valid entries:
+       c4-hmac arcfour-hmac aes128-cts rc4-hmac
+       arcfour-hmac-md5 des3-cbc-sha1 des-cbc-md5 des-cbc-crc
+*)
+let enctype_re = /[a-zA-Z0-9-]{3,}/
+let enctypes = /permitted_enctypes|default_tgs_enctypes|default_tkt_enctypes/i
+
+(* An #eol label prevents ambiguity between "k = v1 v2" and "k = v1\n k = v2" *)
+let enctype_list (nr:regexp) (ns:string) =
+  indent . del nr ns . eq
+    . Build.opt_list [ label ns . store enctype_re ] comma_or_space_sep
+    . (comment|eol) . [ label "#eol" ]
+
 let libdefaults =
-  let option = entry (name_re - "v4_name_convert") eq comment in
+  let option = entry (name_re - ("v4_name_convert" |enctypes)) eq value comment in
+  let enctype_lists = enctype_list /permitted_enctypes/i "permitted_enctypes"
+                      | enctype_list /default_tgs_enctypes/i "default_tgs_enctypes"
+                      | enctype_list /default_tkt_enctypes/i "default_tkt_enctypes" in
   let subsec = [ indent . key /host|plain/ . eq_openbr .
-                   (entry name_re eq comment)* . closebr . eol ] in
-  let v4_name_convert = [ indent . key "v4_name_convert" . eq_openbr .
-                          subsec* . closebr . eol ] in
-  record "libdefaults" (option|v4_name_convert)
+                   (subsec_entry name_re eq comment)* . closebr . eol ] in
+  record "libdefaults" (option|enctype_lists|v4_name_convert subsec)
 
 let login =
   let keys = /krb[45]_get_tickets|krb4_convert|krb_run_aklog/
@@ -51,23 +74,26 @@ let login =
     simple_section "login" keys
 
 let appdefaults =
-  let option = entry (name_re - "realm" - "application") eq comment in
+  let option = entry (name_re - ("realm" | "application")) eq value_br comment in
   let realm = [ indent . label "realm" . store realm_re .
-                  eq_openbr . option* . closebr . eol ] in
+                  eq_openbr . (option|empty)* . closebr . eol ] in
   let app = [ indent . label "application" . store app_re .
-                eq_openbr . (realm|option)* . closebr . eol] in
+                eq_openbr . (realm|option|empty)* . closebr . eol] in
     record "appdefaults" (option|realm|app)
 
 let realms =
   let simple_option = /kdc|admin_server|database_module|default_domain/
       |/v4_realm|auth_to_local(_names)?|master_kdc|kpasswd_server/
-      |/admin_server/ in
+      |/admin_server|ticket_lifetime|pkinit_anchors/ in
   let subsec_option = /v4_instance_convert/ in
-  let option = entry simple_option eq comment in
+  let option = subsec_entry simple_option eq comment in
   let subsec = [ indent . key subsec_option . eq_openbr .
-                   (entry name_re eq comment)* . closebr . eol ] in
+                   (subsec_entry name_re eq comment)* . closebr . eol ] in
+  let v4subsec = [ indent . key /host|plain/ . eq_openbr .
+                   (subsec_entry name_re eq comment)* . closebr . eol ] in
   let realm = [ indent . label "realm" . store realm_re .
-                  eq_openbr . (option|subsec)* . closebr . eol ] in
+                  eq_openbr . (option|subsec|(v4_name_convert v4subsec))* .
+                  closebr . eol ] in
     record "realms" (realm|comment)
 
 let domain_realm =
@@ -92,7 +118,7 @@ let logging =
 let capaths =
   let realm = [ indent . key realm_re .
                   eq_openbr .
-                  (entry realm_re eq comment)* . closebr . eol ] in
+                  (entry realm_re eq value_br comment)* . closebr . eol ] in
     record "capaths" (realm|comment)
 
 let dbdefaults =
@@ -110,7 +136,7 @@ let dbmodules =
 (* This section is not documented in the krb5.conf manpage,
    but the Fermi example uses it. *)
 let instance_mapping =
-  let value = dels "\"" . store /[^;# \t\n{}]*/ . dels "\"" in
+  let value = dels "\"" . store /[^;# \t\r\n{}]*/ . dels "\"" in
   let map_node = label "mapping" . store /[a-zA-Z0-9\/*]+/ in
   let mapping = [ indent . map_node . eq .
                     [ label "value" . value ] . (comment|eol) ] in
diff --git a/lenses/ldif.aug b/lenses/ldif.aug
new file mode 100644 (file)
index 0000000..e8751c0
--- /dev/null
@@ -0,0 +1,227 @@
+(*
+Module: Ldif
+  Parses the LDAP Data Interchange Format (LDIF)
+
+Author: Dominic Cleal <dcleal@redhat.com>
+
+About: Reference
+  This lens tries to keep as close as possible to RFC2849
+    <http://tools.ietf.org/html/rfc2849>
+  and OpenLDAP's ldif(5)
+
+About: Licence
+  This file is licensed under the LGPLv2+, like the rest of Augeas.
+*)
+
+module Ldif =
+autoload xfm
+
+(************************************************************************
+ * Group:                 USEFUL PRIMITIVES
+ ************************************************************************)
+
+(* View: comment *)
+let comment = Util.comment_generic /#[ \t]*/ "# "
+
+(* View: empty
+    Map empty lines, including empty comments *)
+let empty   = [ del /#?[ \t]*\n/ "\n" ]
+
+(* View: eol
+    Only eol, don't include whitespace *)
+let eol     = Util.del_str "\n"
+
+(* View: sep_colon
+    The separator for attributes and values *)
+let sep_colon  = del /:[ \t]*/ ": "
+
+(* View: sep_base64
+    The separator for attributes and base64 encoded values *)
+let sep_base64 = del /::[ \t]*/ ":: "
+
+(* View: sep_url
+    The separator for attributes and URL-sourced values *)
+let sep_url    = del /:<[ \t]*/ ":< "
+
+(* Variable: ldapoid_re
+    Format of an LDAP OID from RFC 2251 *)
+let ldapoid_re = /[0-9][0-9\.]*/
+
+(* View: sep_modspec
+    Separator between modify operations *)
+let sep_modspec = Util.del_str "-" . eol
+
+(************************************************************************
+ * Group:                     BASIC ATTRIBUTES
+ ************************************************************************)
+
+(* Different types of values, all permitting continuation where the next line
+   begins with whitespace *)
+let attr_safe_string   =
+     let line  = /[^ \t\n:<][^\n]*/
+  in let lines = line . (/\n[ \t]+[^ \t\n][^\n]*/)*
+  in sep_colon . store lines
+
+let attr_base64_string =
+     let line  = /[a-zA-Z0-9=+]+/
+  in let lines = line . (/\n[ \t]+/ . line)*
+  in sep_base64 . [ label "@base64" . store lines ]
+
+let attr_url_string =
+     let line  = /[^ \t\n][^\n]*/
+  in let lines = line . (/\n[ \t]+/ . line)*
+  in sep_url . [ label "@url" . store lines ]
+
+let attr_intflag = sep_colon  . store /0|1/
+
+(* View: attr_version
+    version-spec = "version:" FILL version-number *)
+let attr_version = Build.key_value_line "version" sep_colon (store /[0-9]+/)
+
+(* View: attr_dn
+    dn-spec = "dn:" (FILL distinguishedName /
+                     ":" FILL base64-distinguishedName) *)
+let attr_dn = del /dn/i "dn"
+              . ( attr_safe_string | attr_base64_string )
+              . eol
+
+(* View: attr_type
+    AttributeType = ldap-oid / (ALPHA *(attr-type-chars)) *)
+let attr_type = ldapoid_re | /[a-zA-Z][a-zA-Z0-9-]*/
+                               - /dn/i
+                               - /changeType/i
+                               - /include/i
+
+(* View: attr_option
+    options = option / (option ";" options) *)
+let attr_option  = Util.del_str ";"
+                   . [ label "@option" . store /[a-zA-Z0-9-]+/ ]
+
+(* View: attr_description
+    Attribute name, possibly with options *)
+let attr_description = key attr_type . attr_option*
+
+(* View: attr_val_spec
+    Generic attribute with a value *)
+let attr_val_spec = [ attr_description
+                      . ( attr_safe_string
+                          | attr_base64_string
+                          | attr_url_string )
+                      . eol ]
+
+(* View: attr_changetype
+    Parameters:
+     t:regexp - value of changeType *)
+let attr_changetype (t:regexp) =
+  key /changeType/i . sep_colon . store t . eol
+
+(* View: attr_modspec *)
+let attr_modspec = key /add|delete|replace/ . sep_colon . store attr_type
+                     . attr_option* . eol
+
+(* View: attr_dn_value
+    Parses an attribute line with a DN on the RHS
+    Parameters:
+     k:regexp - match attribute name as key *)
+let attr_dn_value (k:regexp) =
+  [ key k . ( attr_safe_string | attr_base64_string ) . eol ]
+
+(* View: sep_line *)
+let sep_line   = empty | comment
+
+(* View: attr_include
+    OpenLDAP extension, must be separated by blank lines *)
+let attr_include = eol . [ key "include" . sep_colon
+                     . store /[^ \t\n][^\n]*/ . eol . comment* . eol ]
+
+(* View: sep_record *)
+let sep_record = ( sep_line | attr_include )*
+
+(************************************************************************
+ * Group:                     LDIF CONTENT RECORDS
+ ************************************************************************)
+
+(* View: ldif_attrval_record
+    ldif-attrval-record = dn-spec SEP 1*attrval-spec *)
+let ldif_attrval_record = [ seq "record"
+                            . attr_dn
+                            . ( sep_line* . attr_val_spec )+ ]
+
+(* View: ldif_content
+    ldif-content = version-spec 1*(1*SEP ldif-attrval-record) *)
+let ldif_content = [ label "@content"
+                     . ( sep_record . attr_version )?
+                     . ( sep_record . ldif_attrval_record )+
+                     . sep_record ]
+
+(************************************************************************
+ * Group:                     LDIF CHANGE RECORDS
+ ************************************************************************)
+
+(* View: change_add
+    change-add = "add" SEP 1*attrval-spec *)
+let change_add = [ attr_changetype "add" ] . ( sep_line* . attr_val_spec )+
+
+(* View: change_delete
+    change-delete = "add" SEP 1*attrval-spec *)
+let change_delete = [ attr_changetype "delete" ]
+
+(* View: change_modspec
+    change-modspec = add/delete/replace: AttributeDesc SEP *attrval-spec "-" *)
+let change_modspec = attr_modspec . ( sep_line* . attr_val_spec )*
+
+(* View: change_modify
+    change-modify = "modify" SEP *mod-spec *)
+let change_modify = [ attr_changetype "modify" ]
+                      . ( sep_line* . [ change_modspec
+                          . sep_line* . sep_modspec ] )+
+
+(* View: change_modrdn
+    ("modrdn" / "moddn") SEP newrdn/newsuperior/deleteoldrdn *)
+let change_modrdn =
+     let attr_deleteoldrdn = [ key "deleteoldrdn" . attr_intflag . eol ]
+  in let attrs_modrdn = attr_dn_value "newrdn"
+                        | attr_dn_value "newsuperior"
+                        | attr_deleteoldrdn
+  in [ attr_changetype /modr?dn/ ]
+     . ( sep_line | attrs_modrdn )* . attrs_modrdn
+
+(* View: change_record
+    changerecord = "changetype:" FILL (changeadd/delete/modify/moddn) *)
+let change_record = ( change_add | change_delete | change_modify
+                      | change_modrdn)
+
+(* View: change_control
+    "control:" FILL ldap-oid 0*1(1*SPACE ("true" / "false")) 0*1(value-spec) *)
+let change_control =
+     let attr_criticality = [ Util.del_ws_spc . label "criticality"
+                              . store /true|false/ ]
+  in let attr_ctrlvalue   = [ label "value" . (attr_safe_string
+                              | attr_base64_string
+                              | attr_url_string ) ]
+  in [ key "control" . sep_colon . store ldapoid_re
+       . attr_criticality? . attr_ctrlvalue? . eol ]
+
+(* View: ldif_change_record
+    ldif-change-record = dn-spec SEP *control changerecord *)
+let ldif_change_record = [ seq "record" . attr_dn
+                           . ( ( sep_line | change_control )* . change_control )?
+                           . sep_line* . change_record ]
+
+(* View: ldif_changes
+    ldif-changes = version-spec 1*(1*SEP ldif-change-record) *)
+let ldif_changes = [ label "@changes"
+                     . ( sep_record . attr_version )?
+                     . ( sep_record . ldif_change_record )+
+                     . sep_record ]
+
+(************************************************************************
+ * Group:                     LENS
+ ************************************************************************)
+
+(* View: lns *)
+let lns = sep_record | ldif_content | ldif_changes
+
+let filter = incl "/etc/openldap/schema/*.ldif"
+
+let xfm = transform lns filter
diff --git a/lenses/ldso.aug b/lenses/ldso.aug
new file mode 100644 (file)
index 0000000..d362573
--- /dev/null
@@ -0,0 +1,44 @@
+(*
+Module: Keepalived
+  Parses /etc/ld.so.conf and /etc/ld.so.conf.d/*
+
+Author: Raphael Pinson <raphink@gmail.com>
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to /etc/ld.so.conf and /etc/ld.so.conf.d/*. See <filter>.
+
+About: Examples
+   The <Test_Ldso> file contains various examples and tests.
+*)
+
+module LdSo =
+
+autoload xfm
+
+(* View: path *)
+let path = [ label "path" . store /[^# \t\n][^ \t\n]*/ . Util.eol ]
+
+(* View: include *)
+let include = Build.key_value_line "include" Sep.space (store Rx.fspath)
+
+(* View: hwcap *)
+let hwcap =
+    let hwcap_val = [ label "bit" . store Rx.integer ] . Sep.space .
+                      [ label "name" . store Rx.word ]
+  in Build.key_value_line "hwcap" Sep.space hwcap_val
+
+(* View: lns *)
+let lns = (Util.empty | Util.comment | path | include | hwcap)*
+
+(* Variable: filter *)
+let filter = incl "/etc/ld.so.conf"
+           . incl "/etc/ld.so.conf.d/*"
+           . Util.stdexcl
+
+let xfm = transform lns filter
diff --git a/lenses/lightdm.aug b/lenses/lightdm.aug
new file mode 100644 (file)
index 0000000..4a24935
--- /dev/null
@@ -0,0 +1,56 @@
+(* 
+Module: Lightdm
+  Lightdm module for Augeas for which parses /etc/lightdm/*.conf files which
+  are standard INI file format.
+
+Author: David Salmen <dsalmen@dsalmen.com>
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to /etc/lightdm/*.conf.  See <filter>.
+
+About: Tests
+   The tests/test_lightdm.aug file contains unit tests.
+*)
+
+module Lightdm =
+  autoload xfm
+
+(************************************************************************
+ * INI File settings
+ *
+ * lightdm.conf only supports "# as commentary and "=" as separator
+ *************************************************************************)
+let comment    = IniFile.comment "#" "#"
+let sep        = IniFile.sep "=" "="
+
+
+(************************************************************************
+ *                        ENTRY
+ * lightdm.conf uses standard INI File entries
+ *************************************************************************)
+let entry   = IniFile.indented_entry IniFile.entry_re sep comment
+
+
+(************************************************************************
+ *                        RECORD
+ * lightdm.conf uses standard INI File records
+ *************************************************************************)
+let title   = IniFile.indented_title IniFile.record_re
+let record  = IniFile.record title entry
+
+
+(************************************************************************
+ *                        LENS & FILTER
+ * lightdm.conf uses standard INI File records
+ *************************************************************************)
+let lns     = IniFile.lns record comment
+
+let filter = (incl "/etc/lightdm/*.conf")
+
+let xfm = transform lns filter
index 8a39514..29b8a6e 100644 (file)
@@ -5,7 +5,7 @@ Module: Login_defs
 Author: Erinn Looney-Triggs
 
 About: License
-  This file is licensed under the LGPLv2+, like the rest of Augeas.
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
 
 About: Configuration files
    This lens applies to /etc/login.defs. See <filter>.
@@ -24,6 +24,6 @@ let record =
 let lns = (record | Util.comment | Util.empty) *
 
 (* View: filter *)
-let filter = incl "/etc/login.defs" . Util.stdexcl
+let filter = incl "/etc/login.defs"
 
 let xfm = transform lns filter
index a301088..2afa0f6 100644 (file)
 module Logrotate =
    autoload xfm
 
-   let sep_spc = Util.del_ws_spc
+   let sep_spc = Sep.space
    let sep_val = del /[ \t]*=[ \t]*|[ \t]+/ " "
    let eol = Util.eol
-   let num = /[0-9]+/
+   let num = Rx.relinteger
    let word = /[^,#= \n\t{}]+/
    let filename = /\/[^,#= \n\t{}]+/
    let size = num . /[kMG]?/
 
-   (* define comments and empty lines *)
-   let comment (indent:string) =
-     let nl = Util.del_str "\n" in
-     [ label "#comment" . del /[ \t]*/ indent . del /#[ \t]*/ "# " .  store /([^ \t\n].*)?/ . nl ]
-   let empty   = [ del /[ \t]*\n/ "\n" ]
+   let indent = del Rx.opt_space "\t"
+
+   (* define omments and empty lines *)
+   let comment = Util.comment
+   let empty   = Util.empty
 
 
    (* Useful functions *)
 
    let list_item = [ sep_spc . key /[^\/+,# \n\t{}]+/ ]
-   let select_to_eol (kw:string) (select:regexp) (indent:string) = [ del /[ \t]*/ indent . label kw . store select . eol ]
-   let value_to_eol (kw:string) (value:regexp) (indent:string )  = [ del /[ \t]*/ indent . key kw . sep_val . store value . eol ]
-   let flag_to_eol (kw:string) (indent:string)                   = [ del /[ \t]*/ indent . key kw . eol ]
-   let list_to_eol (kw:string) (indent:string)                   = [ del /[ \t]*/ indent . key kw . list_item+ . eol ]
+   let select_to_eol (kw:string) (select:regexp) = [ label kw . store select ]
+   let value_to_eol (kw:string) (value:regexp)  = Build.key_value kw sep_val (store value)
+   let flag_to_eol (kw:string) = Build.flag kw
+   let list_to_eol (kw:string) = [ key kw . list_item+ ]
 
 
    (* Defaults *)
 
-   let create (indent:string ) =
+   let create =
      let mode = sep_spc . [ label "mode" . store num ] in
      let owner = sep_spc . [ label "owner" . store word ] in
      let group = sep_spc . [ label "group" . store word ] in
-     [ del /[ \t]*/ indent . key "create" .
-         ( mode | mode . owner | mode . owner . group )?
-                   . eol ]
-
-   let tabooext (indent:string) = [ del /[ \t]*/ indent . key "tabooext" . ( sep_spc . store /\+/ )? . list_item+ . eol ]
-
-   let attrs (indent:string) = select_to_eol "schedule" /(daily|weekly|monthly|yearly)/ indent
-                | value_to_eol "rotate" num indent
-               | create indent
-               | flag_to_eol "nocreate" indent
-               | value_to_eol "include" word indent
-               | select_to_eol "missingok" /(no)?missingok/ indent
-               | select_to_eol "compress" /(no)?compress/ indent
-               | select_to_eol "delaycompress" /(no)?delaycompress/ indent
-               | select_to_eol "ifempty" /(not)?ifempty/ indent
-               | select_to_eol "sharedscripts" /(no)?sharedscripts/ indent
-               | value_to_eol "size" size indent
-               | tabooext indent
-               | value_to_eol "olddir" word indent
-               | flag_to_eol "noolddir" indent
-               | value_to_eol "mail" word indent
-               | flag_to_eol "mailfirst" indent
-               | flag_to_eol "maillast" indent
-               | flag_to_eol "nomail" indent
-               | value_to_eol "errors" word indent
-               | value_to_eol "extension" word indent
-               | select_to_eol "dateext" /(no)?dateext/ indent
-               | value_to_eol "compresscmd" word indent
-               | value_to_eol "uncompresscmd" word indent
-               | value_to_eol "compressext" word indent
-               | list_to_eol "compressoptions" indent
-               | select_to_eol "copy" /(no)?copy/ indent
-               | select_to_eol "copytruncate" /(no)?copytruncate/ indent
-               | value_to_eol "maxage" num indent
-               | value_to_eol "minsize" size indent
-               | select_to_eol "shred" /(no)?shred/ indent
-               | value_to_eol "shredcycles" num indent
-               | value_to_eol "start" num indent
+     [ key "create" .
+         ( mode | mode . owner | mode . owner . group )? ]
+
+   let su =
+     let owner = sep_spc . [ label "owner" . store word ] in
+     let group = sep_spc . [ label "group" . store word ] in
+     [ key "su" .
+         ( owner | owner . group )? ]
+
+   let tabooext = [ key "tabooext" . ( sep_spc . store /\+/ )? . list_item+ ]
+
+   let attrs = select_to_eol "schedule" /(daily|weekly|monthly|yearly)/
+                | value_to_eol "rotate" num
+               | create
+               | flag_to_eol "nocreate"
+               | su
+               | value_to_eol "include" word
+               | select_to_eol "missingok" /(no)?missingok/
+               | select_to_eol "compress" /(no)?compress/
+               | select_to_eol "delaycompress" /(no)?delaycompress/
+               | select_to_eol "ifempty" /(not)?ifempty/
+               | select_to_eol "sharedscripts" /(no)?sharedscripts/
+               | value_to_eol "size" size
+               | tabooext
+               | value_to_eol "olddir" word
+               | flag_to_eol "noolddir"
+               | value_to_eol "mail" word
+               | flag_to_eol "mailfirst"
+               | flag_to_eol "maillast"
+               | flag_to_eol "nomail"
+               | value_to_eol "errors" word
+               | value_to_eol "extension" word
+               | select_to_eol "dateext" /(no)?dateext/
+               | value_to_eol "compresscmd" word
+               | value_to_eol "uncompresscmd" word
+               | value_to_eol "compressext" word
+               | list_to_eol "compressoptions"
+               | select_to_eol "copy" /(no)?copy/
+               | select_to_eol "copytruncate" /(no)?copytruncate/
+               | value_to_eol "maxage" num
+               | value_to_eol "minsize" size
+               | select_to_eol "shred" /(no)?shred/
+               | value_to_eol "shredcycles" num
+               | value_to_eol "start" num
 
    (* Define hooks *)
 
 
    let hook_lines =
      let line_re = /.*/ - /[ \t]*endscript[ \t]*/ in
-       store ( line_re . ("\n" . line_re)* )? . del "\n" "\n"
+       store ( line_re . ("\n" . line_re)* )? . Util.del_str "\n"
 
    let hooks =
      let hook_names = /(pre|post)rotate|(first|last)action/ in
-     [ del /[ \t]*/ "\t" . key hook_names . eol .
+     [ key hook_names . eol .
        hook_lines? .
-       del /[ \t]*endscript[ \t]*\n/ "\tendscript\n" ]
+       del /[ \t]*endscript/ "\tendscript" ]
 
    (* Define rule *)
 
-   let body = del /\{[ \t]*\n/ "{\n"
-                       . ( comment "\t" | attrs "\t" | hooks | empty )*
-                       . del /[ \t]*\}[ \t]*\n/ "}\n"
+   let body = Build.block_newlines
+                 (indent . (attrs | hooks) . eol)
+                 Util.comment
 
    let rule =
-     [ label "rule" . Util.indent .
-         [ label "file" . store filename ] .
-        [ del /[ \t\n]+/ " " . label "file" . store filename ]* .
-        del /[ \t\n]*/ " " . body ]
+     let filename_entry = [ label "file" . store filename ] in
+     let filename_sep = del /[ \t\n]+/ " " in
+     let filenames = Build.opt_list filename_entry filename_sep in
+     [ label "rule" . Util.indent . filenames . body . eol ]
 
-   let lns = ( comment "" | empty | attrs "" | rule )*
+   let lns = ( comment | empty | (attrs . eol) | rule )*
 
    let filter = incl "/etc/logrotate.d/*"
               . incl "/etc/logrotate.conf"
diff --git a/lenses/logwatch.aug b/lenses/logwatch.aug
new file mode 100644 (file)
index 0000000..9acf9a2
--- /dev/null
@@ -0,0 +1,46 @@
+(* Logwatch module for Augeas
+ Author: Francois Lebel <francois@flebel.com>
+ Based on the dnsmasq lens written by Free Ekanayaka.
+
+ Reference: man logwatch (8)
+
+ "Format is one option per line, legal options are the same
+  as the long options legal on the command line. See
+ "logwatch.pl --help" or "man 8 logwatch" for details."
+
+*)
+
+module Logwatch =
+
+   autoload xfm
+
+(************************************************************************
+ *                           USEFUL PRIMITIVES
+ *************************************************************************)
+
+let eol        = Util.eol
+let spc        = Util.del_ws_spc
+let comment    = Util.comment
+let empty      = Util.empty
+
+let sep_eq     = del / = / " = "
+let sto_to_eol = store /([^ \t\n].*[^ \t\n]|[^ \t\n])/
+
+(************************************************************************
+ *                               ENTRIES
+ *************************************************************************)
+
+let entry_re   = /[A-Za-z0-9._-]+/
+let entry      = [ key entry_re . sep_eq . sto_to_eol . eol ]
+
+(************************************************************************
+ *                                LENS
+ *************************************************************************)
+
+let lns = (comment|empty|entry) *
+
+let filter            = incl "/etc/logwatch/conf/logwatch.conf"
+                      . excl ".*"
+                      . Util.stdexcl
+
+let xfm                = transform lns filter
diff --git a/lenses/lvm.aug b/lenses/lvm.aug
new file mode 100644 (file)
index 0000000..40cdc6a
--- /dev/null
@@ -0,0 +1,75 @@
+(*
+Module: LVM
+  Parses LVM metadata.
+
+Author: Gabriel de Perthuis          <g2p.code+augeas@gmail.com>
+
+About: License
+  This file is licensed under the LGPL v2+.
+
+About: Configuration files
+  This lens applies to files in /etc/lvm/backup and /etc/lvm/archive.
+
+About: Examples
+  The <Test_LVM> file contains various examples and tests.
+*)
+
+module LVM =
+       autoload xfm
+
+       (* See lvm2/libdm/libdm-config.c for tokenisation;
+        * libdm uses a blacklist but I prefer the safer whitelist approach. *)
+       (* View: identifier
+        * The left hand side of a definition *)
+       let identifier = /[a-zA-Z0-9_-]+/
+
+       (* strings can contain backslash-escaped dquotes, but I don't know
+        * how to get the message across to augeas *)
+       let str = [label "str". Quote.do_dquote (store /([^\"]|\\\\.)*/)]
+       let int = [label "int". store Rx.relinteger]
+       (* View: flat_literal
+        * A literal without structure *)
+       let flat_literal = int|str
+
+       (* allow multiline and mixed int/str, used for raids and stripes *)
+       (* View: list
+        * A list containing flat literals *)
+       let list = [
+                 label "list" . counter "list"
+               . del /\[[ \t\n]*/ "["
+               .([seq "list". flat_literal . del /,[ \t\n]*/ ", "]*
+                               . [seq "list". flat_literal . del /[ \t\n]*/ ""])?
+               . Util.del_str "]"]
+
+       (* View: val
+        * Any value that appears on the right hand side of an assignment *)
+       let val = flat_literal | list
+
+       (* View: nondef
+        * A line that doesn't contain a statement *)
+       let nondef =
+                 Util.empty
+               | Util.comment
+
+       (* Build.block couldn't be reused, because of recursion and
+        * a different philosophy of whitespace handling. *)
+       (* View: def
+        * An assignment, or a block containing definitions *)
+       let rec def = [
+                 Util.indent . key identifier . (
+                          del /[ \t]*\{\n/ " {\n"
+                         .[label "dict".(nondef | def)*]
+                         . Util.indent . Util.del_str "}\n"
+                         |Sep.space_equal . val . Util.comment_or_eol)]
+
+       (* View: lns
+        * The main lens *)
+       let lns = (nondef | def)*
+
+       let filter =
+                 incl "/etc/lvm/archive/*.vg"
+               . incl "/etc/lvm/backup/*"
+               . incl "/etc/lvm/lvm.conf"
+               . Util.stdexcl
+
+       let xfm = transform lns filter
diff --git a/lenses/mcollective.aug b/lenses/mcollective.aug
new file mode 100644 (file)
index 0000000..e3099c5
--- /dev/null
@@ -0,0 +1,39 @@
+(*
+Module: MCollective
+  Parses MCollective's configuration files
+
+Author: Marc Fournier <marc.fournier@camptocamp.com>
+
+About: Reference
+    This lens is based on MCollective's default client.cfg and server.cfg.
+
+About: Usage Example
+(start code)
+    augtool> get /files/etc/mcollective/client.cfg/plugin.psk
+    /files/etc/mcollective/client.cfg/plugin.psk = unset
+
+    augtool> ls /files/etc/mcollective/client.cfg/
+    topicprefix = /topic/
+    main_collective = mcollective
+    collectives = mcollective
+    [...]
+
+    augtool> set /files/etc/mcollective/client.cfg/plugin.stomp.password example123
+    augtool> save
+    Saved 1 file(s)
+(end code)
+   The <Test_MCollective> file also contains various examples.
+
+About: License
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
+*)
+
+module MCollective =
+autoload xfm
+
+let lns = Simplevars.lns
+
+let filter = incl "/etc/mcollective/client.cfg"
+           . incl "/etc/mcollective/server.cfg"
+
+let xfm = transform lns filter
index 2f20158..d831f1a 100644 (file)
@@ -11,7 +11,7 @@ Reference:
     config.c and policy.c from mdadm-3.2.2
 
 License:
-    This file is licensed under the LGPLv2+.
+    This file is licensed under the LGPL v2+.
 
 This is a lens for /etc/mdadm.conf. It aims to parse every valid configuration
 file as of version 3.2.2, and many invalid ones too. This last point is a
@@ -75,7 +75,7 @@ let dev_partitions_re = /partitions/i
 
 let dev_containers = [ del dev_containers_re "containers" . label "containers" ]
 let dev_partitions = [ del dev_partitions_re "partitions" . label "partitions" ]
-let dev_device = [ label "name". store ( value - dev_containers_re - dev_partitions_re) ]
+let dev_device = [ label "name". store ( value - (dev_containers_re | dev_partitions_re)) ]
 
 (* Strictly there must be at least 1 device, but we err on the side of parsing
 *)
@@ -274,5 +274,6 @@ let lns = (comment
            | part_policy )*
 
 let filter     = incl "/etc/mdadm.conf"
+               . incl "/etc/mdadm/mdadm.conf"
 
 let xfm        = transform lns filter
diff --git a/lenses/memcached.aug b/lenses/memcached.aug
new file mode 100644 (file)
index 0000000..4688ce9
--- /dev/null
@@ -0,0 +1,47 @@
+(*
+Module: Memcached
+  Parses Memcached's configuration files
+
+Author: Marc Fournier <marc.fournier@camptocamp.com>
+
+About: Reference
+    This lens is based on Memcached's default memcached.conf file.
+
+About: Usage Example
+(start code)
+    augtool> get /files/etc/memcached.conf/u
+    /files/etc/memcached.conf/u = nobody
+
+    augtool> set /files/etc/memcached.conf/m 128
+    augtool> save
+    Saved 1 file(s)
+(end code)
+   The <Test_Memcached> file also contains various examples.
+
+About: License
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
+*)
+
+module Memcached =
+autoload xfm
+
+let comment     = Util.comment
+let comment_eol = Util.comment_generic /[#][ \t]*/ "# "
+let option      = /[a-zA-Z]/
+let val         = /[^# \n\t]+/
+let empty       = Util.empty
+let eol         = Util.del_str "\n"
+
+let entry       = [ Util.del_str "-" . key option
+                . ( Util.del_ws_spc . (store val) )?
+                . del /[ \t]*/ "" . (eol|comment_eol) ]
+
+let logfile     = Build.key_value_line_comment
+                  "logfile" Sep.space (store val) comment
+
+let lns         = ( entry | logfile | comment | empty )*
+
+let filter      = incl "/etc/memcached.conf"
+                . incl "/etc/memcachedb.conf"
+
+let xfm         = transform lns filter
index 6d1bdc6..dc89549 100644 (file)
@@ -8,7 +8,7 @@ About: Reference
   This lens tries to keep as close as possible to `man 5 mke2fs.conf` where possible.
 
 About: License
-   This file is licenced under the LGPLv2+, like the rest of Augeas.
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
    To be documented
@@ -78,6 +78,8 @@ let common_entry   = list_sto ("base_features"|"default_features")
 let defaults_entry = entry_sto "force_undo" ("true"|"false")
                    | entry_sto "fs_type" Rx.word
                    | entry_sto "undo_dir" Rx.fspath
+                   | list_sto "default_mntopts" (key Rx.word)
+                   | entry_sto "enable_periodic_fsck" Rx.integer
                    
 (* View: defaults_title
     Title for the <defaults> section *)
@@ -102,7 +104,8 @@ let fs_types_entry =list_sto "features"
                         (key Rx.word . Util.del_str "="
                        . store Rx.word)
                    | entry_sto "lazy_itable_init" ("true"|"false")
-                   | entry_sto "flex_bg_size" Rx.integer
+                   | entry_sto ("flex_bg_size"|"auto_64-bit_support")
+                       Rx.integer
 
 (* View: fs_types_record
      Fs group records under the <fs_types> section *)
@@ -133,7 +136,6 @@ let lns = (empty|comment)* . (defaults|fs_types)*
 
 (* Variable: filter *)
 let filter = incl "/etc/mke2fs.conf"
-    . Util.stdexcl
 
 let xfm = transform lns filter
 
index f4bb27b..bd897b9 100644 (file)
@@ -10,7 +10,7 @@ About: Reference
   This lens tries to keep as close as possible to `man 5 modprobe.conf` where possible.
 
 About: License
-   This file is licenced under the LGPLv2+, like the rest of Augeas.
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
    To be documented
@@ -38,8 +38,11 @@ let sep_space = del /([ \t]|(\\\\\n))+/ " "
 (* View: sto_no_spaces *)
 let sto_no_spaces = store /[^# \t\n\\\\]+/
 
+(* View: sto_no_colons *)
+let sto_no_colons = store /[^:# \t\n\\\\]+/
+
 (* View: sto_to_eol *)
-let sto_to_eol = store /[^# \t\n\\\\][^#\n\\\\]*[^# \t\n\\\\]|[^# \t\n\\\\]/
+let sto_to_eol = store /(([^# \t\n\\\\][^#\n\\\\]*[ \t]*\\\\[ \t]*\n[ \t]*)*([^# \t\n\\\\][^#\n\\\\]*[^# \t\n\\\\]|[^# \t\n\\\\])|[^# \t\n\\\\])/
 
 (* View: alias *)
 let alias =
@@ -55,7 +58,7 @@ let alias =
 (* View: options *)
 let options =
   let opt_value = /[^#" \t\n\\\\]+|"[^#"\n\\\\]*"/ in
-  let option = [ key Rx.word . (Util.del_str "=" . store opt_value)? ] in
+  let option = [ key Rx.word . (del /[ \t]*=[ \t]*/ "=" . store opt_value)? ] in
   [ key "options" . sep_space . sto_no_spaces
                   . (sep_space . option)* . Util.comment_or_eol ]
 
@@ -75,12 +78,22 @@ let config = Build.key_value_line_comment "config" sep_space
                        (store /binary_indexes|yes|no/)
                        comment
 
+(* View: softdep *)
+let softdep =
+  let premod  = [ label "pre" . sep_space . sto_no_colons ] in
+    let pre   = sep_space . Util.del_str "pre:" . premod+ in
+  let postmod = [ label "post" . sep_space . sto_no_colons ] in
+    let post  = sep_space . Util.del_str "post:" . postmod+ in
+  [ key "softdep" . sep_space . sto_no_colons . pre? . post?
+    . Util.comment_or_eol ]
+
 (* View: entry *)
 let entry = alias
           | options
           | kv_line_command /install|remove/
           | blacklist
           | config
+          | softdep
 
 (************************************************************************
  * Group:                 LENS AND FILTER
index 6d84b56..ce598fe 100644 (file)
@@ -6,7 +6,7 @@ About: Reference
   This lens tries to keep as close as possible to `man 5 modules` where possible.
 
 About: License
-   This file is licenced under the LGPLv2+, like the rest of Augeas.
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
    To be documented
@@ -20,8 +20,11 @@ autoload xfm
 (* View: word *)
 let word = /[^#, \n\t\/]+/
 
+(* View: sto_line *)
+let sto_line = store /[^# \t\n].*[^ \t\n]|[^# \t\n]/
+
 (* View: record *)
-let record = [ key word . (Util.del_ws_tab . Modprobe.sto_to_eol)? . Util.eol ]
+let record = [ key word . (Util.del_ws_tab . sto_line)? . Util.eol ]
 
 (* View: lns *)
 let lns = ( Util.empty | Util.comment | record ) *
index 1bf4bbd..e9ab7c1 100644 (file)
@@ -37,7 +37,6 @@ let entry =
 let lns = (comment|empty|entry)*
 
 let filter = (incl "/etc/modules.conf") .
-  (incl "/etc/conf.modules").
-  Util.stdexcl
+  (incl "/etc/conf.modules")
 
 let xfm = transform lns filter
diff --git a/lenses/mongodbserver.aug b/lenses/mongodbserver.aug
new file mode 100644 (file)
index 0000000..77d1aa4
--- /dev/null
@@ -0,0 +1,53 @@
+(*
+Module: MongoDBServer
+  Parses /etc/mongodb.conf
+
+Author: Brian Redbeard <redbeard@dead-city.org>
+
+About: Reference
+   For information on configuration options available to mongod reference one
+   of the following resources:
+    * The Mongo DB Manual - <http://docs.mongodb.org/manual/>
+    * The current options available for your operating system via:
+      > man mongos
+
+About: License
+   This file is licenced under the LGPL v2+, conforming to the other components
+   of Augeas.
+
+About: Lens Usage
+  Sample usage of this lens in augtool:
+
+    * Get your current setup
+      > print /files/etc/mongodb.conf
+      ...
+
+    * Change MongoDB port
+      > set /files/etc/mongodb.conf/port 27117
+
+  Saving your file:
+
+      > save
+
+About: Configuration files
+   This lens applies to /etc/mongodb.conf. See <filter>.
+
+About: Examples
+   The <Test_MongoDBServer> file contains various examples and tests.
+*)
+module MongoDBServer =
+
+autoload xfm
+
+(* View: entry *)
+let entry =
+  Build.key_value_line Rx.word Sep.space_equal (store Rx.space_in)
+
+(* View: lns *)
+let lns = (Util.empty | Util.comment | entry)*
+
+
+(* Variable: filter *)
+let filter = incl "/etc/mongodb.conf"
+
+let xfm = transform lns filter
index dde4573..f2f1e9e 100644 (file)
@@ -65,6 +65,6 @@ let entry      = (set|include|service)
 let lns        = (comment|empty|entry) *
 
 let filter     = incl "/etc/monit/monitrc"
-               . Util.stdexcl
+               . incl "/etc/monitrc"
 
 let xfm        = transform lns filter
index 103f184..6c72ab2 100644 (file)
@@ -44,33 +44,51 @@ let common_setting =
  |kv "failback" (Rx.integer | /immediate|manual/)
  |kv "rr_weight" /priorities|uniform/
  |kv "no_path_retry" (Rx.integer | /fail|queue/)
- |kv "rr_min_io" Rx.integer
+ |kv /rr_min_io(_rq)?/ Rx.integer
+
+let default_setting =
+  kv "polling_interval" Rx.integer
+  |kv "udev_dir" Rx.fspath
+  |qstr "selector"
+  |kv "user_friendly_names" /yes|no/
+  |kv "dev_loss_tmo" Rx.integer
+  |kv "fast_io_fail_tmo" Rx.integer
+  |kv "verbosity" /[0-6]/
+  |kv "reassign_maps" /yes|no/
+  (* These are not in the manpage but in the example multipath.conf *)
+  |kv "prio" Rx.word
+  |kv "max_fds" Rx.integer
+  (* SUSE extensions *)
+  |kv "async_timeout" Rx.integer
+  |kv "max_polling_interval" Rx.integer
+  |kv "pg_timeout" Rx.word
+  |kv "bindings_file" Rx.fspath
+  |kv "multipath_dir" Rx.fspath
+  |kv "alias_prefix" Rx.word
+  |kv "queue_without_daemon" /yes|no/
+  |kv "h_on_last_deleassign_maps" /yes|no/
+  |qstr "prio_args"
+  (* SUSE extensions SP3 *)
+  |qstr "uid_attribute"
+  |kv "wwids_file" Rx.fspath
+  |kv "log_checker_err" Rx.word
+  |kv "retain_attached_hw_handler" /yes|no/
+  |kv "detect_prio" /yes|no/
+  |kv "flush_on_last_del" /yes|no/
 
 (* A device subsection *)
 let device =
   let setting =
     qstr /vendor|product|product_blacklist|hardware_handler/
-   |common_setting in
+   |common_setting
+   |default_setting in
   section "device" setting
 
 (* The defaults section *)
 let defaults =
   let setting =
     common_setting
-   |kv "polling_interval" Rx.integer
-   |kv "udev_dir" Rx.fspath
-   |qstr "selector"
-   |kv "user_friendly_names" /yes|no/
-   |kv "dev_loss_tmo" Rx.integer
-   |kv "fast_io_fail_tmo" Rx.integer
-   |kv "verbosity" /[0-6]/
-   |kv "reassign_maps" /yes|no/
-   (* These are not in the manpage but in the example multipath.conf *)
-   |kv "prio" Rx.word
-   |kv "max_fds" Rx.integer
-   (* SUSE extensions *)
-   |kv "async_timeout" Rx.integer
-   |kv "max_polling_interval" Rx.integer
+   |default_setting
   in section "defaults" setting
 
 (* The blacklist and blacklist_exceptions sections *)
index 93f827c..eaeb34e 100644 (file)
@@ -14,10 +14,13 @@ let comment  = IniFile.comment IniFile.comment_re "#"
 
 let sep      = IniFile.sep IniFile.sep_re IniFile.sep_default
 
-let entry    = Util.indent
-             . ([ key IniFile.entry_re . sep . IniFile.sto_to_comment . (comment|IniFile.eol) ] |
-               [ key IniFile.entry_re . store // .  (comment|IniFile.eol) ]) |
-               comment
+let entry    =
+     let bare = Quote.do_dquote_opt_nil (store /[^#;" \t\r\n]+([ \t]+[^#;" \t\r\n]+)*/)
+  in let quoted = Quote.do_dquote (store /[^"\r\n]*[#;]+[^"\r\n]*/)
+  in [ Util.indent . key IniFile.entry_re . sep . Sep.opt_space . bare . (comment|IniFile.eol) ]
+   | [ Util.indent . key IniFile.entry_re . sep . Sep.opt_space . quoted . (comment|IniFile.eol) ]
+   | [ Util.indent . key IniFile.entry_re . store // .  (comment|IniFile.eol) ]
+   | comment
 
 (************************************************************************
  * sections, led by a "[section]" header
@@ -38,7 +41,6 @@ let lns    = (comment|IniFile.empty)* . (record|includedir)*
 let filter = (incl "/etc/mysql/my.cnf")
              . (incl "/etc/mysql/conf.d/*.cnf")
              . (incl "/etc/my.cnf")
-             . Util.stdexcl
 
 let xfm = transform lns filter
 
index a29e6bf..bc0be65 100644 (file)
@@ -1,44 +1,74 @@
 (*
 Module: NagiosConfig
-  Parses /etc/nagios3/*.cfg
+  Parses /etc/{nagios{3,},icinga}/*.cfg
 
 Authors: Sebastien Aperghis-Tramoni <sebastien@aperghis.net>
          Raphaël Pinson <raphink@gmail.com>
 
 About: License
-  This file is licenced under the LGPLv2+, like the rest of Augeas.
+  This file is licenced under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
   To be documented
 
 About: Configuration files
-  This lens applies to /etc/nagios3/*.cfg. See <filter>.
+  This lens applies to /etc/{nagios{3,},icinga}/*.cfg. See <filter>.
 *)
 
 module NagiosCfg =
-    autoload xfm
+autoload xfm
 
-    (* View: param_def
-        define a field *)
-    let param_def =
-               key /[A-Za-z0-9_]+/
-             . Sep.opt_space . Sep.equal
-             . Sep.opt_space . store Rx.no_spaces
+(************************************************************************
+ * Group: Utility variables/functions
+ ************************************************************************)
+(* View: param_def
+    define a field *)
+let param_def =
+     let space_in  = /[^ \t\n][^\n=]*[^ \t\n]|[^ \t\n]/
+  in key /[A-Za-z0-9_]+/
+   . Sep.space_equal
+   . store space_in
 
-    (* View: param
-        Params can have sub params *)
-    let param =
-         [ Util.indent . param_def
-         . [ Sep.space . param_def ]*
-         . Util.eol ]
+(* View: macro_def
+    Macro line, as used in resource.cfg *)
+let macro_def =
+     let macro = /\$[A-Za-z0-9]+\$/
+       in let macro_decl = Rx.word | Rx.fspath
+     in key macro . Sep.space_equal . store macro_decl
 
-    (* View: lns
-        main structure *)
-    let lns = ( Util.empty | Util.comment | param )*
+(************************************************************************
+ * Group: Entries
+ ************************************************************************)
+(* View: param
+    Params can have sub params *)
+let param =
+     [ Util.indent . param_def
+     . [ Sep.space . param_def ]*
+     . Util.eol ]
 
-    (* View: filter *)
-    let filter = incl "/etc/nagios3/*.cfg"
-               . Util.stdexcl
+(* View: macro *)
+let macro = [ Util.indent . macro_def . Util.eol ]
 
-    let xfm = transform lns filter
+(************************************************************************
+ * Group: Lens
+ ************************************************************************)
+(* View: entry
+    Define the accepted entries, such as param for regular configuration
+    files, and macro for resources.cfg .*)
+let entry = param
+         | macro
 
+(* View: lns
+    main structure *)
+let lns = ( Util.empty | Util.comment | entry )*
+
+(* View: filter *)
+let filter = incl "/etc/nagios3/*.cfg"
+           . incl "/etc/nagios/*.cfg"
+          . incl "/etc/icinga/*.cfg"
+          . excl "/etc/nagios3/commands.cfg"
+          . excl "/etc/nagios/commands.cfg"
+          . excl "/etc/nagios/nrpe.cfg"
+          . incl "/etc/icinga/commands.cfg"
+
+let xfm = transform lns filter
index 50ce6d3..db4e181 100644 (file)
@@ -1,19 +1,19 @@
 (*
 Module: NagiosObjects
-  Parses /etc/nagios3/objects/*.cfg
+  Parses /etc/{nagios{3,},icinga}/objects/*.cfg
 
 Authors: Sebastien Aperghis-Tramoni <sebastien@aperghis.net>
          Raphaël Pinson <raphink@gmail.com>
 
 About: License
-  This file is licenced under the LGPLv2+, like the rest of Augeas.
+  This file is licenced under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
   To be documented
 
 About: Configuration files
 
-  This lens applies to /etc/nagios3/objects/*.cfg. See <filter>.
+  This lens applies to /etc/{nagios{3,},icinga}/objects/*.cfg. See <filter>.
 *)
 
 module NagiosObjects =
@@ -25,11 +25,14 @@ module NagiosObjects =
 
     let keyword      = key /[A-Za-z0-9_]+/
 
+    (* optional, but preferred, whitespace *)
+    let opt_ws = del Rx.opt_space " "
+
     (* define an empty line *)
     let empty = Util.empty
 
     (* define a comment *)
-    let comment = Util.comment
+    let comment = Util.comment_generic /[ \t]*[#;][ \t]*/ "# "
 
     (* define a field *)
     let object_field    =
@@ -43,16 +46,17 @@ module NagiosObjects =
        let object_type = keyword in
           [ Util.indent
           . Util.del_str "define" . ws
-          . object_type . ws
+          . object_type . opt_ws
           . Util.del_str "{" . eol
           . ( empty | comment | object_field )*
-          . Util.del_str "}" . eol ]
+          . Util.indent . Util.del_str "}" . eol ]
 
     (* main structure *)
     let lns = ( empty | comment | object_def )*
 
     let filter = incl "/etc/nagios3/objects/*.cfg"
-               . Util.stdexcl
+               . incl "/etc/nagios/objects/*.cfg"
+              . incl "/etc/icinga/objects/*.cfg"
 
     let xfm = transform lns filter
 
diff --git a/lenses/netmasks.aug b/lenses/netmasks.aug
new file mode 100644 (file)
index 0000000..45ea879
--- /dev/null
@@ -0,0 +1,65 @@
+(*
+Module: Netmasks
+  Parses /etc/inet/netmasks on Solaris
+
+Author: Dominic Cleal <dcleal@redhat.com>
+
+About: Reference
+  This lens tries to keep as close as possible to `man 4 netmasks` where possible.
+
+About: Licence
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+
+About: Configuration files
+  This lens applies to /etc/netmasks and /etc/inet/netmasks. See <filter>.
+*)
+
+module Netmasks =
+autoload xfm
+
+(************************************************************************
+ * Group:                 USEFUL PRIMITIVES
+ ************************************************************************)
+
+(* View: comment *)
+let comment = Util.comment
+
+(* View: comment_or_eol *)
+let comment_or_eol = Util.comment_or_eol
+
+(* View: indent *)
+let indent  = Util.indent
+
+(* View: empty *)
+let empty   = Util.empty
+
+(* View: sep
+    The separator for network/mask entries *)
+let sep     = Util.del_ws_tab
+
+(************************************************************************
+ * Group:                     ENTRIES
+ ************************************************************************)
+
+(* View: entry
+   Network / netmask line *)
+let entry = [ seq "network" . indent .
+                [ label "network" . store Rx.ipv4 ] . sep .
+                [ label "netmask" . store Rx.ipv4 ] . comment_or_eol ]
+
+(************************************************************************
+ * Group:                     LENS
+ ************************************************************************)
+
+(* View: lns *)
+let lns = ( empty
+          | comment
+          | entry )*
+
+(* Variable: filter *)
+let filter = (incl "/etc/netmasks"
+            . incl "/etc/inet/netmasks")
+
+let xfm = transform lns filter
diff --git a/lenses/networkmanager.aug b/lenses/networkmanager.aug
new file mode 100644 (file)
index 0000000..81d1cb5
--- /dev/null
@@ -0,0 +1,63 @@
+(*
+Module: NetworkManager
+  Parses /etc/NetworkManager/system-connections/* files which are GLib
+  key-value setting files.
+
+Author: Raphael Pinson <raphael.pinson@camptocamp.com>
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to /etc/NetworkManager/system-connections/*. See <filter>.
+
+About: Examples
+   The <Test_NetworkManager> file contains various examples and tests.
+*)
+
+module NetworkManager =
+autoload xfm
+
+(************************************************************************
+ * INI File settings
+ *
+ * GLib only supports "# as commentary and "=" as separator
+ *************************************************************************)
+let comment    = IniFile.comment "#" "#"
+let sep        = Sep.equal
+let eol        = Util.eol
+
+(************************************************************************
+ *                        ENTRY
+ * GLib entries can contain semicolons, entry names can contain spaces and
+ * brackets
+ *************************************************************************)
+(* Variable: entry_re *)
+let entry_re   = /[A-Za-z][A-Za-z0-9:._\(\) \t-]+/
+
+(* Lens: entry *)
+let entry   = [ key entry_re . sep
+                . Quote.double_opt? . eol ]
+              | comment
+
+(************************************************************************
+ *                        RECORD
+ * GLib uses standard INI File records
+ *************************************************************************)
+let title   = IniFile.indented_title IniFile.record_re
+let record  = IniFile.record title entry
+
+
+(************************************************************************
+ *                        LENS & FILTER
+ * GLib uses standard INI File records
+ *************************************************************************)
+let lns     = IniFile.lns record comment
+
+(* Variable: filter *)
+let filter = incl "/etc/NetworkManager/system-connections/*"
+
+let xfm = transform lns filter
index ce97b06..db09022 100644 (file)
@@ -8,7 +8,7 @@ About: Reference
   This lens tries to keep as close as possible to `man 5 networks` where possible.
 
 About: License
-   This file is licenced under the LGPLv2+, like the rest of Augeas.
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
    To be documented
@@ -26,12 +26,12 @@ autoload xfm
 let ipv4 =
   let dot     = "." in
   let digits  = /(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/ in
-    digits . dot . digits . dot . digits . (dot . "0")?
+    digits . (dot . digits . (dot . digits . (dot . digits)?)?)?
 
 (*View: entry *)
 let entry =
   let alias = [ seq "alias" . store Rx.word ] in
-      [ seq "network"
+      [ seq "network" . counter "alias"
     . [ label "name" . store Rx.word ]
     . [ Sep.space . label "number" . store ipv4 ]
     . [ Sep.space . label "aliases" . Build.opt_list alias Sep.space ]?
diff --git a/lenses/nginx.aug b/lenses/nginx.aug
new file mode 100644 (file)
index 0000000..7d72c47
--- /dev/null
@@ -0,0 +1,64 @@
+(* Module: Nginx
+   Nginx module for Augeas
+
+Authors: Ian Berry <iberry@barracuda.com>
+         Raphael Pinson <raphael.pinson@camptocamp.com>
+
+About: Reference
+
+   This module was built to support a limited subset of nginx
+   configuration syntax. It works fine with simple blocks and
+   field/value lines.
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to /etc/nginx/nginx.conf. See <filter>.
+
+About: Examples
+   The <Test_Nginx> file contains various examples and tests.
+
+About: TODO
+   * Convert statement keyworks for a regex
+   * Support more advanced block syntax (location)
+*)
+
+module Nginx =
+
+autoload xfm
+
+(* Variable: block_re
+     The keywords reserved for block entries *)
+let block_re = "http" | "events"
+             | "server" | "upstream"
+             | "location" | "if"
+
+(* View: simple
+     A simple entry *)
+let simple = 
+     let kw = Rx.word - block_re
+  in let sto = store /[^ \t\n;][^;]*/ . Sep.semicolon
+  in Build.key_value_line_comment
+     kw Sep.space sto Util.comment_eol
+
+(* View: block
+     A block containing <simple> entries *)
+let block =
+     let entry = Util.indent . simple
+  in [ key block_re
+     . Build.block_newlines entry Util.comment
+     . Util.eol ]
+
+(* View: lns *)
+let lns = ( Util.comment | Util.empty | simple | block )*
+
+(* Variable: filter *)
+let filter = incl "/etc/nginx/nginx.conf"
+           . incl "/etc/nginx/conf.d/*.conf"
+           . incl "/usr/portage/www-servers/nginx/files/nginx.conf"
+
+let xfm = transform lns filter
index ee16f4c..c8b0fb4 100644 (file)
@@ -5,7 +5,7 @@ Module: Nrpe
 Author: Marc Fournier <marc.fournier@camptocamp.com>
 
 About: License
-  This file is licensed under the LGPLv2+, like the rest of Augeas.
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
 *)
 
 module Nrpe =
@@ -18,6 +18,8 @@ let eq = Sep.equal
 (* View: word *)
 let word = /[^=\n\t ]+/
 
+(* View: item_re *)
+let item_re = /[^#=\n\t\/ ]+/ - (/command\[[^]\/\n]+\]/ | "include" | "include_dir")
 
 (* View: command
     nrpe.cfg usually has many entries defining commands to run
@@ -34,26 +36,12 @@ let command =
     ]
 
 
-(* View: item_re
-     regular entries re *)
-let item_re = "server_port"
-            | "command_prefix"
-            | "server_address"
-            | "allowed_hosts"
-            | "debug"
-            | "nrpe_user"
-            | "nrpe_group"
-            | "dont_blame_nrpe"
-            | "command_timeout"
-            | "connection_timeout"
-            | "allow_weak_random_seed"
-            | "pid_file"
-            | "log_facility"
-
 (* View: item
-     regular entries *)
-let item = [ key item_re . eq . store word . eol ]
+     regular entries
 
+     > allow_bash_command_substitution=0
+*)
+let item = [ key item_re . eq . store word . eol ]
 
 (* View: include
     An include entry.
@@ -84,12 +72,11 @@ let empty = Util.empty
 
 (* View: lns
     The Nrpe lens *)
-let lns = ( command | item | include | include_dir | comment | empty ) *
+let lns = ( command | include | include_dir | item | comment | empty ) *
 
 (* View: filter
     File filter *)
-let filter = Util.stdexcl .
-             incl "/etc/nrpe.cfg" .
+let filter = incl "/etc/nrpe.cfg" .
              incl "/etc/nagios/nrpe.cfg"
 
 let xfm = transform lns (filter)
index c675f29..2d65345 100644 (file)
@@ -8,7 +8,7 @@ About: Reference
   This lens tries to keep as close as possible to `man nsswitch.conf` where possible.
 
 About: Licence
-  This file is licensed under the LGPLv2+, like the rest of Augeas.
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
 
@@ -33,6 +33,10 @@ let empty = Util.empty
     The separator for database entries *)
 let sep_colon = del /:[ \t]*/ ": "
 
+(* View: database_kw
+    The database specification like `passwd', `shadow', or `hosts' *)
+let database_kw = Rx.word
+
 (* View: service
     The service specification like `files', `db', or `nis' *)
 let service = [ label "service" . store Rx.word ]
@@ -60,35 +64,17 @@ let reaction =
 
 (* View: database *)
 let database = 
-  let database_kw = "aliases"
-                  | "automount"
-                  | "bootparams"
-                  | "ethers"
-                  | "group"
-                  | "hosts"
-                  | "netgroup"
-                  | "netmasks"
-                  | "networks"
-                  | "passwd"
-                  | "protocols"
-                  | "publickey"
-                  | "rpc"
-                  | "sendmailvars"
-                  | "services"
-                  | "shadow"
-                  | "sudoers"
-    in [ label "database" . store database_kw
-               . sep_colon
-               . (Build.opt_list
-                    (service|reaction)
-                    Sep.space)
-               . Util.eol ]
+    [ label "database" . store database_kw
+       . sep_colon
+       . (Build.opt_list
+            (service|reaction)
+            Sep.space)
+       . Util.eol ]
 
 (* View: lns *)
 let lns = ( empty | comment | database )*
 
 (* Variable: filter *)
 let filter = (incl "/etc/nsswitch.conf")
-    . Util.stdexcl
 
 let xfm = transform lns filter
index c9c4b72..c9a79a1 100644 (file)
@@ -98,7 +98,7 @@ module Ntp =
 
     (* Authentication commands, see authopt.html#cmd; incomplete *)
     let auth_command =
-      [ key /controlkey|keys|keysdir|requestkey/ .
+      [ key /controlkey|keys|keysdir|requestkey|authenticate/ .
             sep_spc . store word . eol ]
      | [ key /autokey|revoke/ . [sep_spc . store word]? . eol ]
      | [ key /trustedkey/ . [ sep_spc . label "key" . store word ]+ . eol ]
@@ -110,14 +110,24 @@ module Ntp =
       let arg = [ key arg_names . sep_spc . store Rx.decimal ] in
       [ key "tinker" . (sep_spc . arg)* . eol ]
 
+    (* tos [beacon beacon | ceiling ceiling | cohort {0 | 1} |
+            floor floor | maxclock maxclock | maxdist maxdist |
+            minclock minclock | mindist mindist | minsane minsane |
+            orphan stratum | orphanwait delay] *)
+
+    let tos =
+      let arg_names = /beacon|ceiling|cohort|floor|maxclock|maxdist|
+                      minclock|mindist|minsane|orphan|orphanwait/ in
+      let arg = [ key arg_names . sep_spc . store Rx.decimal ] in
+      [ key "tos" . (sep_spc . arg)* . eol ]
+
     (* Define lens *)
 
     let lns = ( comment | empty | command_record | fudge_record
               | restrict_record | simple_settings | statistics_record
               | filegen_record | broadcastclient
-              | auth_command | tinker )*
+              | auth_command | tinker | tos)*
 
     let filter = (incl "/etc/ntp.conf")
-        . Util.stdexcl
 
     let xfm = transform lns filter
diff --git a/lenses/ntpd.aug b/lenses/ntpd.aug
new file mode 100644 (file)
index 0000000..68b5905
--- /dev/null
@@ -0,0 +1,157 @@
+(*
+Module: Ntpd
+    Parses OpenNTPD's ntpd.conf
+
+Author: Jasper Lievisse Adriaanse <jasper@jasper.la>
+
+About: Reference
+    This lens is used to parse OpenNTPD's configuration file, ntpd.conf.
+    http://openntpd.org/
+
+About: Usage Example
+    To be documented
+
+About: License
+    This file is licensed under the LGPL v2+, like the rest of Augeas.
+
+About: Configuration files
+  This lens applies to /etc/ntpd.conf.
+See <filter>.
+*)
+
+module Ntpd =
+autoload xfm
+
+(************************************************************************
+ * Group: Utility variables/functions
+ ************************************************************************)
+
+(* View: comment *)
+let comment = Util.comment
+(* View: empty *)
+let empty   = Util.empty
+(* View: eol *)
+let eol     = Util.eol
+(* View: space *)
+let space   = Sep.space
+(* View: word *)
+let word    = Rx.word
+(* View: device_re *)
+let device_re = Rx.device_name | /\*/
+
+(* View: address_re *)
+let address_re = Rx.ip | /\*/ | Rx.hostname
+
+(* View: stratum_re
+   value between 1 and 15 *)
+let stratum_re = /1[0-5]|[1-9]/
+
+(* View: refid_re
+   string with length < 5 *)
+let refid_re = /[A-Za-z0-9_.-]{1,5}/
+
+(* View: weight_re
+   value between 1 and 10 *)
+let weight_re = /10|[1-9]/
+
+(* View: rtable_re
+   0 - RT_TABLE_MAX *)
+let rtable_re = Rx.byte
+
+(* View: correction_re
+   should actually only match between -127000000 and 127000000 *)
+let correction_re = Rx.relinteger_noplus
+
+(************************************************************************
+ * View: key_opt_rtable_line
+ *   A subnode with a keyword, an optional routing table id and an end
+ *   of line.
+ *
+ *   Parameters:
+ *     kw:regexp - the pattern to match as key
+ *     sto:lens  - the storing lens
+ ************************************************************************)
+let key_opt_rtable_line (kw:regexp) (sto:lens) =
+    let rtable = [ Util.del_str "rtable" . space . label "rtable"
+                   . store rtable_re ]
+      in [ key kw . space . sto . (space . rtable)? . eol ]
+
+(************************************************************************
+ * View: key_opt_weight_rtable_line
+ *   A subnode with a keyword, an optional routing table id, an optional
+ *   weight-value and an end of line.
+ *   of line.
+ *
+ *   Parameters:
+ *     kw:regexp - the pattern to match as key
+ *     sto:lens  - the storing lens
+ ************************************************************************)
+let key_opt_weight_rtable_line (kw:regexp) (sto:lens) =
+    let rtable = [ Util.del_str "rtable" . space . label "rtable" . store rtable_re ]
+        in let weight = [ Util.del_str "weight" . space . label "weight"
+                          . store weight_re ]
+        in [ key kw . space . sto . (space . weight)? . (space . rtable)? . eol ]
+
+(************************************************************************
+ * View: opt_value
+ *   A subnode for optional values.
+ *
+ *   Parameters:
+ *     s:string - the option name and subtree label
+ *     r:regexp  - the pattern to match as store
+ ************************************************************************)
+let opt_value (s:string) (r:regexp) =
+  Build.key_value s space (store r)
+
+(************************************************************************
+ * Group: Keywords
+ ************************************************************************)
+
+(* View: listen
+   listen on address [rtable table-id] *)
+let listen =
+  let addr = [ label "address" . store address_re ]
+    in key_opt_rtable_line "listen on" addr
+
+(* View: server
+   server address [weight weight-value] [rtable table-id] *)
+let server =
+  let addr = [ label "address" . store address_re ]
+    in key_opt_weight_rtable_line "server" addr
+
+(* View: servers
+   servers address [weight weight-value] [rtable table-id] *)
+let servers =
+  let addr = [ label "address" . store address_re ]
+    in key_opt_weight_rtable_line "servers" addr
+
+(* View: sensor
+   sensor device [correction microseconds] [weight weight-value] [refid
+             string] [stratum stratum-value] *)
+let sensor =
+  let device = [ label "device" . store device_re ]
+    in let correction = opt_value "correction" correction_re
+      in let weight = opt_value "weight" weight_re
+        in let refid = opt_value "refid" refid_re
+          in let stratum = opt_value "stratum" stratum_re
+            in [ key "sensor" . space . device
+                . (space . correction)?
+                . (space . weight)?
+                . (space . refid)?
+                . (space . stratum)?
+                . eol ]
+
+(************************************************************************
+ * Group: Lens
+ ************************************************************************)
+
+(* View: keyword *)
+let keyword = listen | server | servers | sensor
+
+(* View: lns *)
+let lns = ( empty | comment | keyword )*
+
+(* View: filter *)
+let filter = (incl "/etc/ntpd.conf")
+
+let xfm = transform lns filter
diff --git a/lenses/openshift_config.aug b/lenses/openshift_config.aug
new file mode 100644 (file)
index 0000000..416451f
--- /dev/null
@@ -0,0 +1,75 @@
+(*
+Module: OpenShift_Config
+  Parses
+    - /etc/openshift/broker.conf
+    - /etc/openshift/broker-dev.conf
+    - /etc/openshift/console.conf
+    - /etc/openshift/console-dev.conf
+    - /etc/openshift/node.conf
+    - /etc/openshift/plugins.d/*.conf
+
+Author: Brian Redbeard <redbeard@dead-city.org>
+
+About: License
+   This file is licenced under the LGPL v2+, conforming to the other components
+   of Augeas.
+
+About: Lens Usage
+  Sample usage of this lens in augtool:
+
+    * Get your current setup
+      > print /files/etc/openshift
+      ...
+
+    * Change OpenShift domain
+      > set /files/etc/openshift/broker.conf/CLOUD_DOMAIN ose.example.com
+
+  Saving your file:
+
+      > save
+
+About: Configuration files
+        /etc/openshift/broker.conf - Configuration file for an OpenShift Broker
+            running in production mode.
+        /etc/openshift/broker-dev.conf - Configuration file for an OpenShift
+            Broker running in development mode.
+        /etc/openshift/console.conf - Configuration file for an OpenShift
+            console running in production mode.
+        /etc/openshift/console-dev.conf - Configuration file for an OpenShift
+            console running in development mode.
+        /etc/openshift/node.conf - Configuration file for an OpenShift node
+        /etc/openshift/plugins.d/*.conf - Configuration files for OpenShift
+            plugins (i.e. mcollective configuration, remote auth, dns updates)
+
+About: Examples
+   The <Test_OpenShift_Config> file contains various examples and tests.
+*)
+module OpenShift_Config =
+    autoload xfm
+
+(* Variable: blank_val *)
+let blank_val = del /["']{2}/ "\"\""
+
+(* View: primary_entry *)
+let primary_entry = Build.key_value_line Rx.word Sep.equal Quote.any_opt
+
+(* View: empty_entry *)
+let empty_entry = Build.key_value_line Rx.word Sep.equal blank_val
+
+(* View: lns *)
+let lns = (Util.empty | Util.comment | primary_entry | empty_entry )*
+
+(* Variable: filter *)
+let filter = incl "/etc/openshift/broker.conf"
+            . incl "/etc/openshift/broker-dev.conf"
+            . incl "/etc/openshift/console.conf"
+            . incl "/etc/openshift/resource_limits.conf"
+            . incl "/etc/openshift/console-dev.conf"
+            . incl "/etc/openshift/node.conf"
+            . incl "/etc/openshift/plugins.d/*.conf"
+            . incl "/var/www/openshift/broker/conf/broker.conf"
+            . incl "/var/www/openshift/broker/conf/plugins.d/*.conf"
+            . Util.stdexcl
+
+let xfm = transform lns filter
+(* vim: set ts=4  expandtab  sw=4: *)
diff --git a/lenses/openshift_http.aug b/lenses/openshift_http.aug
new file mode 100644 (file)
index 0000000..7c54d4a
--- /dev/null
@@ -0,0 +1,36 @@
+(*
+Module: OpenShift_Http
+  Parses HTTPD related files specific to openshift
+
+Author: Brian Redbeard <redbeard@dead-city.org>
+
+About: License
+   This file is licenced under the LGPL v2+, conforming to the other components
+   of Augeas.
+
+About: Lens Usage
+  Sample usage of this lens in augtool:
+
+    * Get your current setup
+      > print /files/var/www/openshift
+
+About: Examples
+   The <Test_OpenShift_Http> file contains various examples and tests.
+*)
+module OpenShift_Http =
+    autoload xfm
+
+(* Variable: filter *)
+let filter =  incl "/var/www/openshift/console/httpd/httpd.conf"
+            . incl "/var/www/openshift/console/httpd/conf.d/*.conf"
+            . incl "/var/www/openshift/broker/httpd/conf.d/*.conf"
+            . incl "/var/www/openshift/broker/httpd/httpd.conf"
+            . incl "/var/www/openshift/console/httpd/console.conf"
+            . incl "/var/www/openshift/broker/httpd/broker.conf"
+            . Util.stdexcl
+
+(* View: lns *) 
+let lns = Httpd.lns 
+
+let xfm = transform lns filter
+(* vim: set ts=4  expandtab  sw=4: *)
diff --git a/lenses/openshift_quickstarts.aug b/lenses/openshift_quickstarts.aug
new file mode 100644 (file)
index 0000000..a732154
--- /dev/null
@@ -0,0 +1,46 @@
+(*
+Module: OpenShift_Quickstarts
+  Parses
+    - /etc/openshift/quickstarts.json
+
+Author: Brian Redbeard <redbeard@dead-city.org>
+
+About: License
+   This file is licenced under the LGPL v2+, conforming to the other components
+   of Augeas.
+
+About: Lens Usage
+  Sample usage of this lens in augtool:
+
+    * Get your current setup
+      > print /files/etc/openshift/quickstarts.json
+      ...
+
+    * Delete the quickstart named WordPress
+      > rm /files/etc/openshift/quickstarts.json/array/dict[*]/entry/dict/entry[*][string = 'WordPress']/../../../
+
+  Saving your file:
+
+      > save
+
+About: Configuration files
+        /etc/openshift/quickstarts.json - Quickstarts available via the
+            OpenShift Console.
+
+About: Examples
+   The <Test_OpenShift_Quickstarts> file contains various examples and tests.
+*)
+module OpenShift_Quickstarts =
+    autoload xfm
+
+(* View: json *)
+let json = Json.lns
+
+(* View: lns *)
+let lns = (Util.empty | json )*
+
+(* Variable: filter *)
+let filter = incl "/etc/openshift/quickstarts.json"
+
+let xfm = transform lns filter
+(* vim: set ts=4  expandtab  sw=4: *)
index a759d00..4771cb1 100644 (file)
@@ -17,7 +17,6 @@ let indent = Util.indent
 
 (* Define separators *)
 let sep    = Util.del_ws_spc
-let sep_dquote = Util.del_str "\""
 
 (* Define value regexps *)
 let ip_re  = Rx.ipv4
@@ -59,10 +58,14 @@ let empty   = Util.empty
  *   - status => filename
  *   - log   => filename
  *   - log-append => filename
+ *   - client-config-dir => filename
  *   - verb => num
  *   - mute => num
+ *   - fragment => num
+ *   - mssfix   => num
  *   - ns-cert-type => "server"
  *   - resolv-retry => "infinite"
+ *   - script-security => [0-3] (execve|system)?
  *************************************************************************)
 
 let single_ip  = "local"
@@ -70,6 +73,8 @@ let single_num = "port"
                | "max-clients"
                | "verb"
               | "mute"
+               | "fragment"
+               | "mssfix"
 let single_fn  = "ca"
                | "cert"
               | "key"
@@ -79,6 +84,7 @@ let single_fn  = "ca"
               | "status"
               | "log"
               | "log-append"
+              | "client-config-dir"
 let single_an  = "user"
                | "group"
 
@@ -96,6 +102,7 @@ let single     = single_entry single_num num_re
               | single_entry "cipher"   /[A-Z][A-Z0-9-]*/
               | single_entry "ns-cert-type" "server"
               | single_entry "resolv-retry" "infinite"
+              | single_entry "script-security" /[0-3]( execve| system)?/
 
 
 (************************************************************************
@@ -111,6 +118,8 @@ let single     = single_entry single_num num_re
  *   - nobind
  *   - mute-replay-warnings
  *   - http-proxy-retry
+ *   - daemon
+ *
  *************************************************************************)
 
 let flag_words = "client-to-client"
@@ -123,6 +132,7 @@ let flag_words = "client-to-client"
               | "nobind"
               | "mute-replay-warnings"
               | "http-proxy-retry"
+              | "daemon"
 
 let flag_entry (kw:regexp)
                = [ key kw . comment_or_eol ]
@@ -135,10 +145,13 @@ let flag       = flag_entry flag_words
  *
  *   - server        => IP IP
  *   - server-bridge => IP IP IP IP
+ *   - route        => IP IP
  *   - push          => "string"
  *   - keepalive     => num num
  *   - tls-auth      => filename [01]
  *   - remote        => hostname/IP num
+ *   - management    => IP num filename
+ *
  *************************************************************************)
 
 let server        = [ key "server" . sep
@@ -153,10 +166,13 @@ let server_bridge = [ key "server-bridge" . sep
                    . [ label "end"     . ip ] . comment_or_eol
                    ]
 
+let route         = [ key "route" . sep
+                    . [ label "address" . ip ] . sep
+                    . [ label "netmask" . ip ] . comment_or_eol
+                    ]
+
 let push          = [ key "push" . sep
-                    . sep_dquote
-                   . sto_to_dquote
-                   . sep_dquote
+                    . Quote.do_dquote sto_to_dquote
                    . comment_or_eol
                     ]
 
@@ -181,13 +197,22 @@ let http_proxy    = [ key "http-proxy" .
                    . comment_or_eol
                    ]
 
+let management    = [ key "management" . sep
+                    . [ label "server" . ip             ] . sep
+                    . [ label "port"   . num            ] . sep
+                    . [ label "pwfile" . filename       ] . comment_or_eol
+                    ]
+
+
 let other         = server
                   | server_bridge
+                 | route
                   | push
                  | keepalive
                  | tls_auth
                  | remote
                  | http_proxy
+                 | management
 
 
 (************************************************************************
diff --git a/lenses/pagekite.aug b/lenses/pagekite.aug
new file mode 100644 (file)
index 0000000..a5a8610
--- /dev/null
@@ -0,0 +1,76 @@
+(*
+Module: Hostname
+  Parses /etc/pagekite.d/
+
+Author: Michael Pimmer <blubb@fonfon.at>
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+*)
+
+module Pagekite =
+autoload xfm
+
+(* View: lns *)
+
+(* Variables *)
+let equals = del /[ \t]*=[ \t]*/ "="
+let neg2 = /[^# \n\t]+/
+let eol = del /\n/ "\n"
+(* Match everything from here to eol, cropping whitespace at both ends *)
+let to_eol  = /[^ \t\n](.*[^ \t\n])?/
+
+(* A key followed by comma-separated values 
+  k: name of the key
+  key_sep: separator between key and values
+  value_sep: separator between values
+  sto: store for values
+*)
+let key_csv_line (k:string) (key_sep:lens) (value_sep:lens) (sto:lens) = 
+  [ key k . key_sep . [ seq k . sto ] .
+    [ seq k . value_sep . sto ]* . Util.eol ]
+
+(* entries for pagekite.d/10_account.rc *)
+let domain = [ key "domain" . equals . store neg2 . Util.comment_or_eol ]
+let frontend = Build.key_value_line ("frontend" | "frontends") 
+                                       equals (store Rx.neg1)
+let host = Build.key_value_line "host" equals (store Rx.ip)
+let ports = key_csv_line "ports" equals Sep.comma (store Rx.integer)
+let protos = key_csv_line "protos" equals Sep.comma (store Rx.word)
+
+(* entries for pagekite.d/20_frontends.rc *)
+let kitesecret = Build.key_value_line "kitesecret" equals (store Rx.space_in)
+let kv_frontend = Build.key_value_line ( "kitename" | "fe_certname" | 
+                                         "ca_certs" | "tls_endpoint" ) 
+                                       equals (store Rx.neg1)
+
+(* entries for 80_*.rc *)
+let service_colon = del /[ \t]*:[ \t]*/ " : "
+let store_domain = store /[^: \t\n]+:[^: \t\n]+/
+let service_on = [ key "service_on" . [ seq "service_on" . equals .
+                   [ label "source" . store_domain ] . service_colon .
+                   [label "destination" . store_domain] . service_colon . (
+                     [ label "secret" . store Rx.no_spaces . Util.eol ] | eol
+                   ) ] ]
+let service_cfg = [ key "service_cfg" . equals . store to_eol . eol ]
+
+let flags = ( "defaults" | "isfrontend" | "abort_not_configured" | "insecure" )
+
+let entries = Build.flag_line flags
+        | domain
+        | frontend
+        | host
+        | ports
+        | protos
+        | kv_frontend
+        | kitesecret
+        | service_on
+        | service_cfg
+
+let lns = ( entries | Util.empty | Util.comment )*
+
+(* View: filter *)
+let filter = incl "/etc/pagekite.d/*.rc"
+        . Util.stdexcl
+
+let xfm = transform lns filter
index a012b42..23b3c78 100644 (file)
@@ -1,4 +1,22 @@
-(* Proces /etc/pam.d *)
+(*
+Module: Pam
+  Parses /etc/pam.conf and /etc/pam.d/* service files
+
+Author: David Lutterkort <lutter@redhat.com>
+
+About: Reference
+  This lens tries to keep as close as possible to `man pam.conf` where
+  possible.
+
+About: Licence
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+
+About: Configuration files
+  This lens autoloads /etc/pam.d/* for service specific files. See <filter>.
+  It provides a lens for /etc/pam.conf, which is used in the PamConf module.
+*)
 module Pam =
   autoload xfm
 
@@ -9,12 +27,12 @@ module Pam =
   (* pairs into an array and generate a subtree control/N/KEY = VALUE      *)
   let control = /(\[[^]#\n]*\]|[^[ \t][^ \t]*)/
   let word = /[^# \t\n]+/
-  (* Allowed types. FIXME: Should be case insensitive *)
-  let types = /(auth|session|account|password)/
+  (* Allowed types *)
+  let types = /(auth|session|account|password)/i
 
-  (* This isn't entirely right: arguments enclosed in [ .. ] are allowed   *)
-  (* and should be parsed as one                                           *)
-  let argument = /[^#\n \t]+/
+  (* This isn't entirely right: arguments enclosed in [ .. ] can contain  *)
+  (* a ']' if escaped with a '\' and can be on multiple lines ('\')       *)
+  let argument = /(\[[^]#\n]+\]|[^[#\n \t][^#\n \t]*)/
 
   let comment = Util.comment
   let comment_or_eol = Util.comment_or_eol
@@ -27,20 +45,23 @@ module Pam =
   let include = [ indent . Util.del_str "@" . key "include" .
                   Util.del_ws_spc . store word . eol ]
 
-  let record = [ seq "record" . indent .
-                   [ label "optional" . del "-" "-" ]? .
-                   [ label "type" . store types ] .
-                   Util.del_ws_tab .
-                   [ label "control" . store control] .
-                   Util.del_ws_tab .
-                   [ label "module" . store word ] .
-                   [ Util.del_ws_tab . label "argument" . store argument ]* .
-                comment_or_eol
-               ]
-  let lns = ( empty | comment | include | record ) *
-
-  let filter = incl "/etc/pam.conf"
-             . incl "/etc/pam.d/*"
+  (* Shared with PamConf *)
+  let record = [ label "optional" . del "-" "-" ]? .
+               [ label "type" . store types ] .
+               Util.del_ws_tab .
+               [ label "control" . store control] .
+               Util.del_ws_tab .
+               [ label "module" . store word ] .
+               [ Util.del_ws_tab . label "argument" . store argument ]* .
+               comment_or_eol
+
+  let record_svc = [ seq "record" . indent . record ]
+
+  let lns = ( empty | comment | include | record_svc ) *
+
+  let filter = incl "/etc/pam.d/*"
+             . excl "/etc/pam.d/allow.pamlist"
+             . excl "/etc/pam.d/README"
              . Util.stdexcl
 
   let xfm = transform lns filter
diff --git a/lenses/pamconf.aug b/lenses/pamconf.aug
new file mode 100644 (file)
index 0000000..2b18515
--- /dev/null
@@ -0,0 +1,53 @@
+(*
+Module: PamConf
+  Parses /etc/pam.conf files
+
+Author: Dominic Cleal <dcleal@redhat.com>
+
+About: Reference
+  This lens tries to keep as close as possible to `man pam.conf` where
+  possible.
+
+About: Licence
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+
+About: Configuration files
+  This lens applies to /etc/pam.conf. See <filter>.
+*)
+module PamConf =
+  autoload xfm
+
+(************************************************************************
+ * Group:                 USEFUL PRIMITIVES
+ *************************************************************************)
+
+let indent  = Util.indent
+
+let comment = Util.comment
+
+let empty   = Util.empty
+
+let include = Pam.include
+
+let service = Rx.word
+
+(************************************************************************
+ * Group:                 LENSES
+ *************************************************************************)
+
+let record  = [ seq "record" . indent .
+              [ label "service" . store service ] .
+              Util.del_ws_tab .
+              Pam.record ]
+
+let lns = ( empty | comment | include | record ) *
+
+let filter = incl "/etc/pam.conf"
+
+let xfm = transform lns filter
+
+(* Local Variables: *)
+(* mode: caml       *)
+(* End:             *)
index 8ea0541..c82ed81 100644 (file)
@@ -1,7 +1,15 @@
-(* Passwd module for Augeas
+(*
+ Module: Passwd
+ Parses /etc/passwd
+
  Author: Free Ekanayaka <free@64studio.com>
 
- Reference: man 5 passwd
+ About: Reference
+        - man 5 passwd
+        - man 3 getpwnam
+
+ Each line in the unix passwd file represents a single user record, whose
+ colon-separated attributes correspond to the members of the passwd struct
 
 *)
 
@@ -10,41 +18,75 @@ module Passwd =
    autoload xfm
 
 (************************************************************************
- *                           USEFUL PRIMITIVES
+ * Group:                    USEFUL PRIMITIVES
  *************************************************************************)
 
+(* Group: Comments and empty lines *)
+
 let eol        = Util.eol
 let comment    = Util.comment
 let empty      = Util.empty
 let dels       = Util.del_str
 
-let colon      = del /:/ ":"
+let word       = Rx.word
+let integer    = Rx.integer
 
-let sto_to_col  = store /[^:\n]+/
-let sto_to_eol = store /([^ \t\n].*[^ \t\n]|[^ \t\n])/
+let colon      = Sep.colon
 
-let word       = /[A-Za-z0-9_.-]+/
-let integer    = /[0-9]+/
+let sto_to_eol = store Rx.space_in
+let sto_to_col = store /[^:\r\n]+/
 
 (************************************************************************
- *                               ENTRIES
+ * Group:                        ENTRIES
  *************************************************************************)
 
+(* View: password
+        pw_passwd *)
+let password  = [ label "password" . sto_to_col?   . colon ]
+
+(* View: uid
+        pw_uid *)
+let uid       = [ label "uid"      . store integer . colon ]
+
+(* View: gid
+        pw_gid *)
+let gid       = [ label "gid"      . store integer . colon ]
+
+(* View: name
+        pw_gecos; the user's full name *)
+let name      = [ label "name"     . sto_to_col? . colon ]
+
+(* View: home
+        pw_dir *)
+let home      = [ label "home"     . sto_to_col?   . colon ]
+
+(* View: shell
+        pw_shell *)
+let shell     = [ label "shell"    . sto_to_eol? ]
+
+(* View: entry
+        struct passwd *)
 let entry     = [ key word
                 . colon
-                . [ label "password" . store word    . colon ]
-                . [ label "uid"      . store integer . colon ]
-                . [ label "gid"      . store integer . colon ]
-                . [ label "name"     . sto_to_col?   . colon ]
-                . [ label "home"     . sto_to_col?  . colon ]
-                . [ label "shell"    . sto_to_eol? ]
+                . password
+                . uid
+                . gid
+                . name
+                . home
+                . shell
                 . eol ]
 
 (* A NIS entry has nothing bar the +@:::::: bits. *)
 let nisentry =
-  let nisuser = /\+\@[A-Za-z0-9_.-]+/ in
-  let colons = "::::::" in
-  [ dels "+@" . label "@nis" . store word . dels colons . eol ]
+  let overrides =
+        colon
+      . [ label "password" . sto_to_col ]?   . colon
+      . [ label "uid"      . store integer ]? . colon
+      . [ label "gid"      . store integer ]? . colon
+      . [ label "name"     . sto_to_col ]?   . colon
+      . [ label "home"     . sto_to_col ]?  . colon
+      . [ label "shell"    . sto_to_eol ]? in
+  [ dels "+@" . label "@nis" . store word . overrides . eol ]
 
 let nisdefault =
   let overrides =
@@ -63,8 +105,6 @@ let nisdefault =
 
 let lns        = (comment|empty|entry|nisentry|nisdefault) *
 
-let filter
-               = incl "/etc/passwd"
-               . Util.stdexcl
+let filter     = incl "/etc/passwd"
 
 let xfm        = transform lns filter
index 4963c69..364643c 100644 (file)
@@ -8,7 +8,7 @@ About: Reference
   Pbuilderrc is a standard shellvars file.
 
 About: License
-  This file is licensed under the LGPLv2+, like the rest of Augeas.
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
 
 About: Configuration files
   This lens applies to /etc/pbuilderrc and /etc/pbuilder/pbuilderrc.
index c960e3f..f9b7a0e 100644 (file)
@@ -3,13 +3,12 @@ Module: Pg_Hba
   Parses PostgreSQL's pg_hba.conf
 
 Author: Aurelien Bompard <aurelien@bompard.org>
-
 About: Reference
   The file format is described in PostgreSQL's documentation:
   http://www.postgresql.org/docs/current/static/auth-pg-hba-conf.html
 
 About: License
-  This file is licensed under the LGPLv2+, like the rest of Augeas.
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
 
 About: Configuration files
   This lens applies to pg_hba.conf. See <filter> for exact locations.
@@ -26,6 +25,10 @@ module Pg_Hba =
     (* Variable: ipaddr
        CIDR or ip+netmask *)
     let ipaddr   = /[0-9a-fA-F:.]+(\/[0-9]+|[ \t]+[0-9.]+)/
+    (* Variable: hostname
+       Hostname, FQDN or part of an FQDN possibly 
+       starting with a dot. Taken from the syslog lens. *)
+    let hostname = /\.?[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*/
 
     let comma_sep_list (l:string) =
         let lns = [ label l . store word ] in
@@ -33,6 +36,8 @@ module Pg_Hba =
 
     (* Group: Columns definitions *)
 
+    (* View: ipaddr_or_hostname *)
+    let ipaddr_or_hostname = ipaddr | hostname
     (* View: database
        TODO: support for quoted strings *)
     let database = comma_sep_list "database"
@@ -40,13 +45,18 @@ module Pg_Hba =
        TODO: support for quoted strings *)
     let user = comma_sep_list "user"
     (* View: address *)
-    let address = [ label "address" . store ipaddr ]
+    let address = [ label "address" . store ipaddr_or_hostname ]
     (* View: option
        part of <method> *)
-    let option = [ label "option" . store word ]
+    let option =
+         let value_start = label "value" . Sep.equal
+      in [ label "option" . store Rx.word
+         . (Quote.quote_spaces value_start)? ]
+
     (* View: method
        can contain an <option> *)
-    let method = [ label "method" . store Rx.word . ( Sep.tab . option )? ]
+    let method = [ label "method" . store /[A-Za-z][A-Za-z0-9]+/
+                                  . ( Sep.tab . option )* ]
 
     (* Group: Records definitions *)
 
@@ -71,6 +81,7 @@ module Pg_Hba =
     (* View: filter
         The pg_hba.conf conf file *)
     let filter = (incl "/var/lib/pgsql/data/pg_hba.conf" .
+                  incl "/var/lib/pgsql/*/data/pg_hba.conf" .
                   incl "/etc/postgresql/*/*/pg_hba.conf" )
 
     (* View: lns
index 65fb384..768c1a4 100644 (file)
@@ -21,7 +21,10 @@ let empty    = IniFile.empty
  * otherwise it would lead to an ambiguity with the "section" label
  * since PHP allows entries outside of sections.
  *************************************************************************)
-let entry    = IniFile.indented_entry IniFile.entry_re sep comment
+let entry    =
+     let word = IniFile.entry_re
+  in let entry_re = word . ( "[" . word . "]" )? 
+  in IniFile.indented_entry entry_re sep comment
 
 
 (************************************************************************
@@ -46,6 +49,8 @@ let lns    = record_anon? . record*
 let filter = (incl "/etc/php*/*/*.ini")
              . (incl "/etc/php.ini")
              . (incl "/etc/php.d/*.ini")
+             (* PHPFPM Support *)
+             . (incl "/etc/php*/fpm/pool.d/*.conf")
              (* Zend Community edition *)
              . (incl "/usr/local/zend/etc/php.ini")
              . (incl "/usr/local/zend/etc/conf.d/*.ini")
index 9f40c19..f05b922 100644 (file)
@@ -31,8 +31,9 @@ let chr_star   = /\*/
 let chr_nstar  = /[^* \t\n]/
 let chr_slash  = /\//
 let chr_nslash = /[^\/ \t\n]/
+let chr_variable = /\$[A-Za-z0-9'"_:-]+/
 
-let sto_to_scl = store (/([^ \t\n].*[^ \t\n;]|[^ \t\n;])/ - /.*;[ \t]*(\/\/|#).*/)
+let sto_to_scl = store (/([^ \t\n].*[^ \t\n;]|[^ \t\n;])/ - /.*;[ \t]*(\/\/|#).*/) (* " *)
 let sto_to_eol = store /([^ \t\n].*[^ \t\n]|[^ \t\n])/
 
 (************************************************************************
@@ -49,6 +50,7 @@ let comment      = Util.comment_multiline | comment_one_line
 
 let eol_or_comment = eol | comment_eol
 
+
 (************************************************************************
  *                               ENTRIES
  *************************************************************************)
@@ -60,9 +62,16 @@ let simple_line (kw:regexp) (lns:lens) = [ key kw
 
 let global     = simple_line "global" (sep_opt_spc . sep_dollar . sto_to_scl)
 
-let variable   = simple_line /\$[][A-Za-z0-9'"_:-]+/ (sep_eq . sto_to_scl)
+let assignment =
+  let arraykey = [ label "@arraykey" . store /\[[][A-Za-z0-9'"_:-]+\]/ ] in (* " *)
+  simple_line chr_variable (arraykey? . (sep_eq . sto_to_scl))
+
+let variable = Util.indent . assignment
+
+let classvariable =
+  Util.indent . del /(public|var)/ "public" . Util.del_ws_spc . assignment
 
-let include    = simple_line "@include" (sep_opt_spc . sto_to_scl)
+let include = simple_line "@include" (sep_opt_spc . sto_to_scl)
 
 let generic_function (kw:regexp) (lns:lens) =
   let lbracket = del /[ \t]*\([ \t]*/ "(" in
@@ -85,19 +94,26 @@ let simple_function (kw:regexp) =
 
 let entry      = Util.indent
                . ( global
-                 | variable
                  | include
                  | define
+                 | simple_function "include"
                  | simple_function "include_once"
                  | simple_function "echo" )
 
+
+let class =
+  let classname = key /[A-Za-z0-9'"_:-]+/ in (* " *)
+  del /class[ \t]+/ "class " .
+  [ classname . Util.del_ws_spc . del "{" "{" .
+    (empty|comment|entry|classvariable)*
+  ] . del "}" "}"
+
 (************************************************************************
  *                                LENS
  *************************************************************************)
 
-let lns        = open_php . (empty|comment|entry)* . close_php
+let lns        = open_php . (empty|comment|entry|class|variable)* . close_php
 
 let filter     = incl "/etc/squirrelmail/config.php"
-               . Util.stdexcl
 
 let xfm        = transform lns filter
index 35e834f..3016256 100644 (file)
@@ -29,7 +29,7 @@ let value =
   let chr = /[^# \t\n]/ in
   let any = /.*/ in
   let line = (chr . any* . chr | chr) in
-  let lines = line . (/\n[ \t]+/ . line)* in
+  let lines = line . (/[ \t]*\n[ \t]+/ . line)* in
     store lines
 
 (************************************************************************
@@ -45,6 +45,5 @@ let entry     = [ key word . eq . (indent . value)? . eol ]
 let lns        = (comment|empty|entry) *
 
 let filter     = incl "/etc/postfix/main.cf"
-               . Util.stdexcl
 
 let xfm        = transform lns filter
index ee10172..cfbba41 100644 (file)
@@ -19,7 +19,11 @@ let comment    = Util.comment
 let empty      = Util.empty
 
 let word       = /[A-Za-z0-9_.:-]+/
-let words      = /[A-Za-z0-9$(){}=!_.,:@-][A-Za-z0-9$!(){} ="\/_.,:@-]*[A-Za-z0-9$!(){}="\/_.,:@-]/
+let words      =
+     let char_start = /[A-Za-z0-9$!(){}=_.,:@-]/
+  in let char_end = char_start | /[]["\/]/
+  in let char_middle = char_end | " "
+  in char_start . char_middle* . char_end
 
 let bool       = /y|n|-/
 let integer    = /([0-9]+|-)\??/
@@ -49,6 +53,5 @@ let entry     = [ key word . ws
 let lns        = (comment|empty|entry) *
 
 let filter     = incl "/etc/postfix/master.cf"
-               . Util.stdexcl
 
 let xfm        = transform lns filter
diff --git a/lenses/postfix_transport.aug b/lenses/postfix_transport.aug
new file mode 100644 (file)
index 0000000..9cf66a7
--- /dev/null
@@ -0,0 +1,60 @@
+(*
+Module: Postfix_Transport
+  Parses /etc/postfix/transport
+
+Author: Raphael Pinson <raphael.pinson@camptocamp.com>
+
+About: Reference
+  This lens tries to keep as close as possible to `man 5 transport` where possible.
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to /etc/postfix/transport. See <filter>.
+
+About: Examples
+   The <Test_Postfix_Transport> file contains various examples and tests.
+*)
+
+module Postfix_Transport =
+
+autoload xfm
+
+(* View: space_or_eol *)
+let space_or_eol = del /([ \t]*\n)?[ \t]+/ " "
+
+(* View: colon *)
+let colon = Sep.colon
+
+(* View: nexthop *)
+let nexthop =
+     let host_re = "[" . Rx.word . "]" | /[A-Za-z]([^\n]*[^ \t\n])?/
+  in [ label "nexthop" . (store host_re)? ]
+
+(* View: transport *)
+let transport = [ label "transport" . (store Rx.word)? ]
+                . colon . nexthop
+
+(* View: nexthop_smtp *)
+let nexthop_smtp =
+     let host_re = "[" . Rx.word . "]" | Rx.word
+  in [ label "host" . store host_re ]
+     . colon
+     . [ label "port" . store Rx.integer ]
+
+(* View: record *)
+let record = [ label "pattern" . store /[A-Za-z0-9@\*.-]+/
+             . space_or_eol . (transport | nexthop_smtp)
+             . Util.eol ]
+
+(* View: lns *)
+let lns = (Util.empty | Util.comment | record)*
+
+(* Variable: filter *)
+let filter = incl "/etc/postfix/transport"
+
+let xfm = transform lns filter
diff --git a/lenses/postfix_virtual.aug b/lenses/postfix_virtual.aug
new file mode 100644 (file)
index 0000000..bb6cbae
--- /dev/null
@@ -0,0 +1,56 @@
+(*
+Module: Postfix_Virtual
+  Parses /etc/postfix/virtual
+
+Author: Raphael Pinson <raphael.pinson@camptocamp.com>
+
+About: Reference
+  This lens tries to keep as close as possible to `man 5 virtual` where possible.
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to /etc/postfix/virtual. See <filter>.
+
+About: Examples
+   The <Test_Postfix_Virtual> file contains various examples and tests.
+*)
+
+module Postfix_Virtual =
+
+autoload xfm
+
+(* Variable: space_or_eol_re *)
+let space_or_eol_re = /([ \t]*\n)?[ \t]+/
+
+(* View: space_or_eol *)
+let space_or_eol (sep:regexp) (default:string) =
+  del (space_or_eol_re? . sep . space_or_eol_re?) default
+
+(* View: word *)
+let word = store /[A-Za-z0-9@\*.+=-]+/
+
+(* View: comma *)
+let comma = space_or_eol "," ", "
+
+(* View: destination *)
+let destination = [ label "destination" . word ]
+
+(* View: record *)
+let record =
+  let destinations = Build.opt_list destination comma
+  in [ label "pattern" . word
+     . space_or_eol Rx.space " " . destinations
+     . Util.eol ]
+
+(* View: lns *)
+let lns = (Util.empty | Util.comment | record)*
+
+(* Variable: filter *)
+let filter = incl "/etc/postfix/virtual"
+
+let xfm = transform lns filter
diff --git a/lenses/postgresql.aug b/lenses/postgresql.aug
new file mode 100644 (file)
index 0000000..93a7047
--- /dev/null
@@ -0,0 +1,75 @@
+(*
+Module: Postgresql
+  Parses postgresql.conf
+
+Author: Raphael Pinson <raphink@gmail.com>
+
+About: Reference
+  http://www.postgresql.org/docs/current/static/config-setting.html
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to postgresql.conf. See <filter>.
+
+About: Examples
+   The <Test_Postgresql> file contains various examples and tests.
+*)
+
+
+module Postgresql =
+  autoload xfm
+
+(* View: sep
+     Key and values are separated
+     by either spaces or an equal sign *)
+let sep = del /([ \t]+)|([ \t]*=[ \t]*)/ " = "
+
+(* Variable: word_opt_quot_re
+     Strings that don't require quotes *)
+let word_opt_quot_re = /[A-Za-z][A-Za-z0-9_]*/
+
+(* View: word_opt_quot
+     Storing a <word_opt_quot_re>, with or without quotes *)
+let word_opt_quot = Quote.do_squote_opt (store word_opt_quot_re)
+
+(* Variable: number_re
+     A relative decimal number, optionally with unit *)
+let number_re = Rx.reldecimal . /[kMG]?B|[m]?s|min|h|d/?
+
+(* View: number
+     Storing <number_re>, with or without quotes *)
+let number = Quote.do_squote_opt (store number_re)
+
+(* View: word_quot
+     Anything other than <word_opt_quot> or <number>
+     Quotes are mandatory *)
+let word_quot =
+     let esc_squot = /\\\\'/
+  in let no_quot = /[^#'\n]/
+  in let forbidden = word_opt_quot_re | number_re
+  in let value = (no_quot|esc_squot)* - forbidden
+  in Quote.do_squote (store value)
+
+(* View: entry_gen
+     Builder to construct entries *)
+let entry_gen (lns:lens) =
+  Util.indent . Build.key_value_line_comment Rx.word sep lns Util.comment_eol
+
+(* View: entry *)
+let entry = entry_gen number
+          | entry_gen word_opt_quot
+          | entry_gen word_quot    (* anything else *)
+
+(* View: lns *)
+let lns = (Util.empty | Util.comment | entry)*
+
+(* Variable: filter *)
+let filter = incl "/etc/postgresql/*/*/postgresql.conf"
+
+let xfm = transform lns filter
+
index 8400372..465d79b 100644 (file)
@@ -1,25 +1,50 @@
-(* Augeas module for editing tomcat properties files
+(* Augeas module for editing Java properties files
  Author: Craig Dunn <craig@craigdunn.org>
 
- FIXME: Doesn't cover everything that's legal in Java properties yet
-        - multiline
-        - "!" comments
-        - key:value syntax
+  Limitations:
+   - doesn't support \ alone on a line
+   - values are not unescaped
+   - multi-line properties are broken down by line, and can't be replaced with a single line
+
+  See format info: http://docs.oracle.com/javase/6/docs/api/java/util/Properties.html#load(java.io.Reader)
 *)
 
 
 module Properties =
   (* Define some basic primitives *)
-  let empty        = Util.empty
-  let eol          = Util.eol
-  let sepch        = del /[ \t]*=[ \t]*/ "="
-  let value_to_eol = /[^ \t\n](.*[^ \t\n])?/
-  let indent       = Util.indent
-  let entry        = /[A-Za-z][A-Za-z0-9.]+/
+  let empty            = Util.empty
+  let eol              = Util.eol
+  let hard_eol         = del "\n" "\n"
+  let sepch            = del /([ \t]*(=|:)|[ \t])/ "="
+  let sepspc           = del /[ \t]/ " "
+  let sepch_ns         = del /[ \t]*(=|:)/ "="
+  let sepch_opt        = del /[ \t]*(=|:)?[ \t]*/ "="
+  let value_to_eol_ws  = store /(:|=)[^\n]*[^ \t\n\\]/
+  let value_to_bs_ws   = store /(:|=)[^\n]*[^\\\n]/
+  let value_to_eol     = store /([^ \t\n:=][^\n]*[^ \t\n\\]|[^ \t\n\\:=])/
+  let value_to_bs      = store /([^ \t\n:=][^\n]*[^\\\n]|[^ \t\n\\:=])/
+  let indent           = Util.indent
+  let backslash        = del /[\\][ \t]*\n/ "\\\n"
+  let opt_backslash    = del /([\\][ \t]*\n)?/ ""
+  let entry            = /([^ \t\n:=\/!#\\]|[\\]:|[\\]=|[\\][\t ]|[\\][^\/\n])+/
+
+  let multi_line_entry =
+      [ indent . value_to_bs? . backslash ] .
+      [ indent . value_to_bs . backslash ] * .
+      [ indent . value_to_eol . eol ] . value " < multi > "
+
+  let multi_line_entry_ws =
+      opt_backslash .
+      [ indent . value_to_bs_ws . backslash ] + .
+      [ indent . value_to_eol . eol ] . value " < multi_ws > "
 
   (* define comments and properties*)
-  let comment     = Util.comment
-  let property    = [ indent . key entry . sepch . store value_to_eol . eol ]
+  let bang_comment     = [ label "!comment" . del /[ \t]*![ \t]*/ "! " . store /([^ \t\n].*[^ \t\n]|[^ \t\n])/ . eol ]
+  let comment          = ( Util.comment | bang_comment )
+  let property         = [ indent . key entry . sepch . ( multi_line_entry | indent . value_to_eol . eol ) ]
+  let property_ws         = [ indent . key entry . sepch_ns . ( multi_line_entry_ws | indent . value_to_eol_ws . eol ) ]
+  let empty_property   = [ indent . key entry . sepch_opt . hard_eol ]
+  let empty_key        = [ sepch_ns . ( multi_line_entry | indent . value_to_eol . eol ) ]
 
   (* setup our lens and filter*)
-  let lns         = ( property | empty | comment  ) *
+  let lns              = ( empty | comment | property_ws | property | empty_property | empty_key ) *
diff --git a/lenses/protocols.aug b/lenses/protocols.aug
new file mode 100644 (file)
index 0000000..245d466
--- /dev/null
@@ -0,0 +1,47 @@
+(*
+Module: Protocols
+  Parses /etc/protocols
+
+Author: Raphael Pinson <raphink@gmail.com>
+
+About: Reference
+  This lens tries to keep as close as possible to `man 5 protocols` where possible.
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to /etc/protocols. See <filter>.
+
+About: Examples
+   The <Test_Protocols> file contains various examples and tests.
+*)
+
+
+module Protocols =
+
+autoload xfm
+
+let protoname = /[^# \t\n]+/
+
+(* View: entry *)
+let entry =
+      let protocol = [ label "protocol" . store protoname ]
+   in let number   = [ label "number" . store Rx.integer ]
+   in let alias    = [ label "alias" . store protoname ]
+   in [ seq "protocol" . protocol
+      . Sep.space . number
+      . (Sep.space . Build.opt_list alias Sep.space)?
+      . Util.comment_or_eol ]
+
+(* View: lns
+     The protocols lens *)
+let lns = (Util.empty | Util.comment | entry)*
+
+(* Variable: filter *)
+let filter = incl "/etc/protocols"
+
+let xfm = transform lns filter
index bae6534..b1173a0 100644 (file)
@@ -38,6 +38,8 @@ let record  = IniFile.record title entry
  *************************************************************************)
 let lns     = IniFile.lns record comment
 
-let filter = (incl "/etc/puppet/puppet.conf")
+let filter = (incl "/etc/puppet/puppet.conf"
+             .incl "/usr/local/etc/puppet/puppet.conf"
+             .incl "/etc/puppetlabs/puppet/puppet.conf")
 
 let xfm = transform lns filter
diff --git a/lenses/puppet_auth.aug b/lenses/puppet_auth.aug
new file mode 100644 (file)
index 0000000..a169a14
--- /dev/null
@@ -0,0 +1,71 @@
+(*
+Module: Puppet_Auth
+  Parses /etc/puppet/auth.conf
+
+Author: Raphael Pinson <raphael.pinson@camptocamp.com>
+
+About: Reference
+  This lens tries to keep as close as possible to `http://docs.puppetlabs.com/guides/rest_auth_conf.html` where possible.
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to /etc/puppet/auth.conf. See <filter>.
+
+About: Examples
+   The <Test_Puppet_Auth> file contains various examples and tests.
+*)
+
+module Puppet_Auth =
+
+autoload xfm
+
+(* View: list
+   A list of values *)
+let list (kw:string) (val:regexp) =
+     let item = [ seq kw . store val ]
+  in let comma = del /[ \t]*,[ \t]*/ ", "
+  in [ Util.indent . key kw . Sep.space
+     . Build.opt_list item comma . Util.comment_or_eol ]
+
+(* View: auth
+   An authentication stanza *)
+let auth =
+  [ Util.indent . Build.xchg /auth(enticated)?/ "auth" "auth"
+  . Sep.space . store /yes|no|on|off|any/ . Util.comment_or_eol ]
+
+(* View: reset_counters *)
+let reset_counters =
+    counter "environment" . counter "method"
+  . counter "allow" . counter "allow_ip"
+
+(* View: setting *)
+let setting = list "environment" Rx.word
+            | list "method" /find|search|save|destroy/
+            | list "allow" /[^# \t\n,][^#\n,]*[^# \t\n,]|[^# \t\n,]/
+            | list "allow_ip" /[A-Za-z0-9.:\/]+/
+            | auth
+
+(* View: record *)
+let record =
+     let operator = [ label "operator" . store "~" ]
+  in [ Util.indent . key "path"
+      . (Sep.space . operator)?
+      . Sep.space . store /[^~# \t\n][^#\n]*[^# \t\n]|[^~# \t\n]/ . Util.eol
+      . reset_counters
+      . (Util.empty | Util.comment | setting)*
+      . setting ]
+
+(* View: lns *)
+let lns = (Util.empty | Util.comment | record)*
+
+(* Variable: filter *)
+let filter = (incl "/etc/puppet/auth.conf"
+             .incl "/usr/local/etc/puppet/auth.conf"
+             .incl "/etc/puppetlabs/puppet/auth.conf")
+
+let xfm = transform lns filter
index 5a6d203..225a1de 100644 (file)
@@ -10,7 +10,7 @@ About: Reference
   http://docs.puppetlabs.com/guides/file_serving.html
 
 About: License
-  This file is licensed under the LGPLv2+, like the rest of Augeas.
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
   Sample usage of this lens in augtool
@@ -105,6 +105,8 @@ View: lns
 let lns = IniFile.lns record comment
 
 (* Variable: filter *)
-let filter = (incl "/etc/puppet/fileserver.conf")
+let filter = (incl "/etc/puppet/fileserver.conf"
+             .incl "/usr/local/etc/puppet/fileserver.conf"
+             .incl "/etc/puppetlabs/puppet/fileserver.conf")
 
 let xfm = transform lns filter
diff --git a/lenses/pythonpaste.aug b/lenses/pythonpaste.aug
new file mode 100644 (file)
index 0000000..213e435
--- /dev/null
@@ -0,0 +1,54 @@
+(* Python paste config file lens for Augeas
+   Author: Dan Prince <dprince@redhat.com>
+*)
+module PythonPaste =
+  autoload xfm
+
+(************************************************************************
+ * INI File settings
+ *************************************************************************)
+
+let comment  = IniFile.comment "#" "#"
+
+let sep        = IniFile.sep "=" "="
+
+let eol     = Util.eol
+
+(************************************************************************
+ *                        ENTRY
+ *************************************************************************)
+
+let url_entry    = /\/[\/A-Za-z0-9.-_]* ?[:|=] [A-Za-z0-9.-_]+/
+
+let no_inline_comment_entry (kw:regexp) (sep:lens) (comment:lens)
+                       = [ key kw . sep . IniFile.sto_to_eol? . eol ]
+                         | comment
+                         | [ seq "urls" . store url_entry . eol ]
+
+let entry_re           = ( /[A-Za-z][:#A-Za-z0-9._-]+/ )
+
+let entry   = no_inline_comment_entry entry_re sep comment
+
+(************************************************************************
+ *                        RECORD
+ *************************************************************************)
+
+let title   = IniFile.title IniFile.record_re
+
+let record  = IniFile.record title entry
+
+(************************************************************************
+ *                        LENS & FILTER
+ *************************************************************************)
+let lns     = IniFile.lns record comment
+
+let filter = ((incl "/etc/glance/*.ini")
+             . (incl "/etc/keystone/keystone.conf")
+             . (incl "/etc/nova/api-paste.ini")
+             . (incl "/etc/swift/swift.conf")
+             . (incl "/etc/swift/proxy-server.conf")
+             . (incl "/etc/swift/account-server/*.conf")
+             . (incl "/etc/swift/container-server/*.conf")
+             . (incl "/etc/swift/object-server/*.conf"))
+
+let xfm = transform lns filter
diff --git a/lenses/qpid.aug b/lenses/qpid.aug
new file mode 100644 (file)
index 0000000..93dea09
--- /dev/null
@@ -0,0 +1,32 @@
+(*
+Module: Qpid
+  Parses Apache Qpid daemon/client configuration files
+
+Author: Andrew Replogle <areplogl@redhat.com>
+
+About: License
+  This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+  To be documented
+
+About: Examples
+  The <Test_Qpid> file contains various examples and tests.
+*)
+
+module Qpid =
+
+autoload xfm
+
+(* View: entry *)
+let entry = Build.key_value_line Rx.word Sep.equal
+                                 (store Rx.space_in)
+
+(* View: lns *)
+let lns = (Util.empty | Util.comment | entry)*
+
+(* Variable: filter *)
+let filter = incl "/etc/qpidd.conf"
+           . incl "/etc/qpid/qpidc.conf"
+
+let xfm = transform lns filter
diff --git a/lenses/quote.aug b/lenses/quote.aug
new file mode 100644 (file)
index 0000000..bed9c87
--- /dev/null
@@ -0,0 +1,264 @@
+(*
+Module: Quote
+  Generic module providing useful primitives for quoting
+
+Author: Raphael Pinson <raphael.pinson@camptocamp.com>
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   This is a generic module which doesn't apply to files directly.
+   You can use its definitions to build lenses that require quoted values.
+   It provides several levels of definitions, allowing to define more or less fine-grained quoted values:
+
+     - the quote separators are separators that are useful to define quoted values;
+     - the quoting functions are useful wrappers to easily enclose a lens in various kinds of quotes (single, double, any, optional or not);
+     - the quoted values definitions are common quoted patterns. They use the quoting functions in order to provide useful shortcuts for commonly met needs. In particular, the <quote_spaces> (and similar) function force values that contain spaces to be quoted, but allow values without spaces to be unquoted.
+
+About: Examples
+   The <Test_Quote> file contains various examples and tests.
+*)
+
+module Quote =
+
+(* Group: QUOTE SEPARATORS *)
+
+(* Variable: dquote
+     A double quote *)
+let dquote = Util.del_str "\""
+
+(* Variable: dquote_opt
+     An optional double quote, default to double *)
+let dquote_opt = del /"?/ "\""
+
+(* Variable: dquote_opt_nil
+     An optional double quote, default to nothing *)
+let dquote_opt_nil = del /"?/ ""
+
+(* Variable: squote
+     A single quote *)
+let squote = Util.del_str "'"
+
+(* Variable: squote_opt
+     An optional single quote, default to single *)
+let squote_opt = del /'?/ "'"
+
+(* Variable: squote_opt_nil
+     An optional single quote, default to nothing *)
+let squote_opt_nil = del /'?/ ""
+
+(* Variable: quote
+     A quote, either double or single, default to double *)
+let quote = del /["']/ "\""
+
+(* Variable: quote_opt
+     An optional quote, either double or single, default to double *)
+let quote_opt = del /["']?/ "\""
+
+(* Variable: quote_opt_nil
+     An optional quote, either double or single, default to nothing *)
+let quote_opt_nil = del /["']?/ ""
+
+
+(* Group: QUOTING FUNCTIONS *)
+
+(*
+View: do_dquote
+  Enclose a lens in <dquote>s
+
+  Parameters:
+    body:lens - the lens to be enclosed
+*)
+let do_dquote (body:lens) =
+  square dquote body dquote
+
+(*
+View: do_dquote_opt
+  Enclose a lens in optional <dquote>s,
+  use <dquote>s by default.
+
+  Parameters:
+    body:lens - the lens to be enclosed
+*)
+let do_dquote_opt (body:lens) =
+  square dquote_opt body dquote_opt
+
+(*
+View: do_dquote_opt_nil
+  Enclose a lens in optional <dquote>s,
+  default to no quotes.
+
+  Parameters:
+    body:lens - the lens to be enclosed
+*)
+let do_dquote_opt_nil (body:lens) =
+  square dquote_opt_nil body dquote_opt_nil
+
+(*
+View: do_squote
+  Enclose a lens in <squote>s
+
+  Parameters:
+    body:lens - the lens to be enclosed
+*)
+let do_squote (body:lens) =
+  square squote body squote
+
+(*
+View: do_squote_opt
+  Enclose a lens in optional <squote>s,
+  use <squote>s by default.
+
+  Parameters:
+    body:lens - the lens to be enclosed
+*)
+let do_squote_opt (body:lens) =
+  square squote_opt body squote_opt
+
+(*
+View: do_squote_opt_nil
+  Enclose a lens in optional <squote>s,
+  default to no quotes.
+
+  Parameters:
+    body:lens - the lens to be enclosed
+*)
+let do_squote_opt_nil (body:lens) =
+  square squote_opt_nil body squote_opt_nil
+
+(*
+View: do_quote
+  Enclose a lens in <quote>s.
+
+  Parameters:
+    body:lens - the lens to be enclosed
+*)
+let do_quote (body:lens) =
+  square quote body quote
+
+(*
+View: do_quote
+  Enclose a lens in options <quote>s.
+
+  Parameters:
+    body:lens - the lens to be enclosed
+*)
+let do_quote_opt (body:lens) =
+  square quote_opt body quote_opt
+
+(*
+View: do_quote
+  Enclose a lens in options <quote>s,
+  default to no quotes.
+
+  Parameters:
+    body:lens - the lens to be enclosed
+*)
+let do_quote_opt_nil (body:lens) =
+  square quote_opt_nil body quote_opt_nil
+
+
+(* Group: QUOTED VALUES *)
+
+(* View: double
+     A double-quoted value *)
+let double =
+     let body = store /[^\n]*/
+  in do_dquote body
+
+(* Variable: double_opt_re
+     The regexp to store when value
+     is optionally double-quoted *)
+let double_opt_re = /[^\n\t "]([^\n"]*[^\n\t "])?/
+
+(* View: double_opt
+     An optionaly double-quoted value
+     Double quotes are not allowed in value
+     Value cannot begin or end with spaces *)
+let double_opt =
+     let body = store double_opt_re
+  in do_dquote_opt body
+
+(* View: single
+     A single-quoted value *)
+let single =
+     let body = store /[^\n]*/
+  in do_squote body
+
+(* Variable: single_opt_re
+     The regexp to store when value
+     is optionally single-quoted *)
+let single_opt_re = /[^\n\t ']([^\n']*[^\n\t '])?/
+
+(* View: single_opt
+     An optionaly single-quoted value
+     Single quotes are not allowed in value
+     Value cannot begin or end with spaces *)
+let single_opt =
+     let body = store single_opt_re
+  in do_squote_opt body
+
+(* View: any
+     A quoted value *)
+let any =
+     let body = store /[^\n]*/
+  in do_quote body
+
+(* Variable: any_opt_re
+     The regexp to store when value
+     is optionally single- or double-quoted *)
+let any_opt_re = /[^\n\t "']([^\n"']*[^\n\t "'])?/
+
+(* View: any_opt
+     An optionaly quoted value
+     Double or single quotes are not allowed in value
+     Value cannot begin or end with spaces *)
+let any_opt =
+     let body = store any_opt_re
+  in do_quote_opt body
+
+(*
+View: quote_spaces
+  Make quotes mandatory if value contains spaces,
+  and optional if value doesn't contain spaces.
+
+Parameters:
+  lns:lens - the lens to be enclosed
+*)
+let quote_spaces (lns:lens) =
+     (* bare has no spaces, and is optionally quoted *)
+     let bare = Quote.do_quote_opt (store /[^"' \t\n]+/)
+     (* quoted has at least one space, and must be quoted *)
+  in let quoted = Quote.do_quote (store /[^"'\n]*[ \t]+[^"'\n]*/)
+  in [ lns . bare ] | [ lns . quoted ]
+
+(*
+View: dquote_spaces
+  Make double quotes mandatory if value contains spaces,
+  and optional if value doesn't contain spaces.
+
+Parameters:
+  lns:lens - the lens to be enclosed
+*)
+let dquote_spaces (lns:lens) =
+     (* bare has no spaces, and is optionally quoted *)
+     let bare = Quote.do_dquote_opt (store /[^" \t\n]+/)
+     (* quoted has at least one space, and must be quoted *)
+  in let quoted = Quote.do_dquote (store /[^"\n]*[ \t]+[^"\n]*/)
+  in [ lns . bare ] | [ lns . quoted ]
+
+(*
+View: squote_spaces
+  Make single quotes mandatory if value contains spaces,
+  and optional if value doesn't contain spaces.
+
+Parameters:
+  lns:lens - the lens to be enclosed
+*)
+let squote_spaces (lns:lens) =
+     (* bare has no spaces, and is optionally quoted *)
+     let bare = Quote.do_squote_opt (store /[^' \t\n]+/)
+     (* quoted has at least one space, and must be quoted *)
+  in let quoted = Quote.do_squote (store /[^'\n]*[ \t]+[^'\n]*/)
+  in [ lns . bare ] | [ lns . quoted ]
diff --git a/lenses/rabbitmq.aug b/lenses/rabbitmq.aug
new file mode 100644 (file)
index 0000000..1d7c89a
--- /dev/null
@@ -0,0 +1,108 @@
+(*
+Module: Rabbitmq
+  Parses Rabbitmq configuration files
+
+Author: Raphael Pinson <raphael.pinson@camptocamp.com>
+
+About: Reference
+  This lens tries to keep as close as possible to `http://www.rabbitmq.com/configure.html` where possible.
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to Rabbitmq configuration files. See <filter>.
+
+About: Examples
+   The <Test_Rabbitmq> file contains various examples and tests.
+*)
+module Rabbitmq =
+
+autoload xfm
+
+(* View: listeners
+     A tcp/ssl listener *)
+let listeners =
+     let value = Erlang.make_value Erlang.integer
+               | Erlang.tuple Erlang.quoted Erlang.integer
+  in Erlang.list /(tcp|ssl)_listeners/ value
+
+
+(* View: ssl_options
+    (Incomplete) list of SSL options *)
+let ssl_options =
+     let option = Erlang.value /((ca)?cert|key)file/ Erlang.path
+                | Erlang.value "verify" Erlang.bare
+                | Erlang.value "verify_fun" Erlang.boolean
+                | Erlang.value /fail_if_no_peer_cert|reuse_sessions/ Erlang.boolean
+                | Erlang.value "depth" Erlang.integer
+                | Erlang.value "password" Erlang.quoted
+  in Erlang.list "ssl_options" option
+
+(* View: disk_free_limit *)
+let disk_free_limit =
+     let value = Erlang.integer | Erlang.tuple Erlang.bare Erlang.decimal
+  in Erlang.value "disk_free_limit" value
+
+(* View: log_levels *)
+let log_levels =
+     let category = Erlang.tuple Erlang.bare Erlang.bare
+  in Erlang.list "log_levels" category
+
+(* View: cluster_nodes
+     Can be a tuple `(nodes, node_type)` or simple `nodes` *)
+let cluster_nodes =
+     let nodes = Erlang.opt_list (Erlang.make_value Erlang.quoted)
+  in let value = Erlang.tuple nodes Erlang.bare
+               | nodes
+  in Erlang.value "cluster_nodes" value
+
+
+(* View: tcp_listen_options *)
+let tcp_listen_options =
+     let value = Erlang.make_value Erlang.bare
+               | Erlang.tuple Erlang.bare Erlang.bare
+  in Erlang.list "tcp_listen_options" value
+
+(* View: parameters
+     Top-level parameters for the lens *)
+let parameters = listeners
+               | ssl_options
+               | disk_free_limit
+               | log_levels
+               | Erlang.value "vm_memory_high_watermark" Erlang.decimal
+               | Erlang.value "frame_max" Erlang.integer
+               | Erlang.value "heartbeat" Erlang.integer
+               | Erlang.value /default_(vhost|user|pass)/ Erlang.glob
+               | Erlang.value_list "default_user_tags" Erlang.bare
+               | Erlang.value_list "default_permissions" Erlang.glob
+               | cluster_nodes
+               | Erlang.value_list "server_properties" Erlang.bare
+               | Erlang.value "collect_statistics" Erlang.bare
+               | Erlang.value "collect_statistics_interval" Erlang.integer
+               | Erlang.value_list "auth_mechanisms" Erlang.quoted
+               | Erlang.value_list "auth_backends" Erlang.bare
+               | Erlang.value "delegate_count" Erlang.integer
+               | Erlang.value_list "trace_vhosts" Erlang.bare
+               | tcp_listen_options
+               | Erlang.value "hipe_compile" Erlang.boolean
+               | Erlang.value "msg_store_index_module" Erlang.bare
+               | Erlang.value "backing_queue_module" Erlang.bare
+               | Erlang.value "msg_store_file_size_limit" Erlang.integer
+               | Erlang.value "queue_index_max_ journal_entries" Erlang.integer
+
+(* View: rabbit
+    The rabbit <Erlang.application> config *)
+let rabbit = Erlang.application "rabbit" parameters
+
+(* View: lns
+    A top-level <Erlang.config> *)
+let lns = Erlang.config rabbit
+
+(* Variable: filter *)
+let filter = incl "/etc/rabbitmq/rabbitmq.config"
+
+let xfm = transform lns filter
diff --git a/lenses/redis.aug b/lenses/redis.aug
new file mode 100644 (file)
index 0000000..3ea3551
--- /dev/null
@@ -0,0 +1,124 @@
+(*
+Module: Redis
+  Parses Redis's configuration files
+
+Author: Marc Fournier <marc.fournier@camptocamp.com>
+
+About: Reference
+    This lens is based on Redis's default redis.conf
+
+About: Usage Example
+(start code)
+augtool> set /augeas/load/Redis/incl "/etc/redis/redis.conf"
+augtool> set /augeas/load/Redis/lens "Redis.lns"
+augtool> load
+
+augtool> get /files/etc/redis/redis.conf/vm-enabled
+/files/etc/redis/redis.conf/vm-enabled = no
+augtool> print /files/etc/redis/redis.conf/rename-command[1]/
+/files/etc/redis/redis.conf/rename-command
+/files/etc/redis/redis.conf/rename-command/from = "CONFIG"
+/files/etc/redis/redis.conf/rename-command/to = "CONFIG2"
+
+augtool> set /files/etc/redis/redis.conf/activerehashing no
+augtool> save
+Saved 1 file(s)
+augtool> set /files/etc/redis/redis.conf/save[1]/seconds 123
+augtool> set /files/etc/redis/redis.conf/save[1]/keys 456
+augtool> save
+Saved 1 file(s)
+(end code)
+   The <Test_Redis> file also contains various examples.
+
+About: License
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
+*)
+
+module Redis =
+autoload xfm
+
+let k = Rx.word
+let v = /[^ \t\n'"]+/
+let comment = Util.comment
+let empty = Util.empty
+let indent = Util.indent
+let eol = Util.eol
+let del_ws_spc = Util.del_ws_spc
+let dquote = Util.del_str "\""
+
+(* View: standard_entry
+A standard entry is a key-value pair, separated by blank space, with optional
+blank spaces at line beginning & end. The value part can be optionnaly enclosed
+in single or double quotes. Comments at end-of-line ar NOT allowed by
+redis-server.
+*)
+let standard_entry =
+     let reserved_k = "save" | "rename-command" | "slaveof"
+                    | "client-output-buffer-limit"
+  in let entry_noempty = [ indent . key k . del_ws_spc
+                         . Quote.do_quote_opt_nil (store v) . eol ]
+  in let entry_empty = [ indent . key (k - reserved_k) . del_ws_spc
+                         . dquote . store "" . dquote . eol ]
+  in entry_noempty | entry_empty
+
+let save = /save/
+let seconds = [ label "seconds" . Quote.do_quote_opt_nil (store Rx.integer) ]
+let keys = [ label "keys" . Quote.do_quote_opt_nil (store Rx.integer) ]
+(* View: save_entry
+Entries identified by the "save" keyword can be found more than once. They have
+2 mandatory parameters, both integers. The same rules as standard_entry apply
+for quoting, comments and whitespaces.
+*)
+let save_entry = [ indent . key save . del_ws_spc . seconds . del_ws_spc . keys . eol ]
+
+let slaveof = /slaveof/
+let ip = [ label "ip" . Quote.do_quote_opt_nil (store Rx.ip) ]
+let port = [ label "port" . Quote.do_quote_opt_nil (store Rx.integer) ]
+(* View: slaveof_entry
+Entries identified by the "slaveof" keyword can be found more than once. They
+have 2 mandatory parameters, the 1st one is an IP address, the 2nd one is a
+port number. The same rules as standard_entry apply for quoting, comments and
+whitespaces.
+*)
+let slaveof_entry = [ indent . key slaveof . del_ws_spc . ip . del_ws_spc . port . eol ]
+
+let renamecmd = /rename-command/
+let from = [ label "from" . Quote.do_quote_opt_nil (store Rx.word) ]
+let to = [ label "to" . Quote.do_quote_opt_nil (store Rx.word) ]
+(* View: save_entry
+Entries identified by the "rename-command" keyword can be found more than once.
+They have 2 mandatory parameters, both strings. The same rules as
+standard_entry apply for quoting, comments and whitespaces.
+*)
+let renamecmd_entry = [ indent . key renamecmd . del_ws_spc . from . del_ws_spc . to . eol ]
+
+let cobl_cmd = /client-output-buffer-limit/
+let class = [ label "class" . Quote.do_quote_opt_nil (store Rx.word) ]
+let hard_limit = [ label "hard_limit" . Quote.do_quote_opt_nil (store Rx.word) ]
+let soft_limit = [ label "soft_limit" . Quote.do_quote_opt_nil (store Rx.word) ]
+let soft_seconds = [ label "soft_seconds" . Quote.do_quote_opt_nil (store Rx.integer) ]
+(* View: client_output_buffer_limit_entry
+Entries identified by the "client-output-buffer-limit" keyword can be found
+more than once. They have four mandatory paramters, of which the first is a
+string, the last one is an integer and the others are either integers or words,
+although redis is very liberal and takes "4242yadayadabytes" as a valid limit.
+The same rules as standard_entry apply for quoting, comments and whitespaces.
+*)
+let client_output_buffer_limit_entry =
+  [ indent . key cobl_cmd . del_ws_spc . class . del_ws_spc . hard_limit .
+    del_ws_spc . soft_limit . del_ws_spc . soft_seconds . eol ]
+
+let entry = standard_entry
+          | save_entry
+         | renamecmd_entry
+         | slaveof_entry
+         | client_output_buffer_limit_entry
+
+(* View: lns
+The Redis lens
+*)
+let lns = (comment | empty | entry )*
+
+let filter = incl "/etc/redis/redis.conf"
+
+let xfm = transform lns filter
index 1aed4dc..e905fb1 100644 (file)
@@ -8,7 +8,7 @@ About: Reference
   This lens tries to keep as close as possible to `man 1 reprepro` where possible.
 
 About: License
-   This file is licenced under the LGPLv2+, like the rest of Augeas.
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
    See <lns>.
index f1b7af2..208a249 100644 (file)
@@ -8,7 +8,7 @@ About: Reference
   This lens tries to keep as close as possible to `man resolv.conf` where possible.
 
 About: Licence
-  This file is licensed under the LGPLv2+, like the rest of Augeas.
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
 
@@ -71,6 +71,26 @@ let sortlist = Build.key_value_line_comment
                            Sep.space) 
                     comment_eol
 
+(* View: lookup *)
+let lookup =
+  let lookup_entry = Build.flag("bind"|"file"|"yp")
+    in Build.key_value_line_comment
+             "lookup" Sep.space
+             (Build.opt_list
+                    lookup_entry
+                    Sep.space)
+             comment_eol
+
+(* View: family *)
+let family =
+  let family_entry = Build.flag("inet4"|"inet6")
+    in Build.key_value_line_comment
+             "family" Sep.space
+             (Build.opt_list
+                    family_entry
+                    Sep.space)
+             comment_eol
+
 (************************************************************************
  * Group:                 SPECIAL OPTIONS
  *************************************************************************)
@@ -87,7 +107,8 @@ let options =
       let options_entry = Build.key_value ("ndots"|"timeout"|"attempts") 
                                           (Util.del_str ":") (store Rx.integer)
                         | Build.flag ("debug"|"rotate"|"no-check-names"
-                                     |"inet6"|"ip6-bytestring"|"edns0")
+                                     |"inet6"|"ip6-bytestring"|"edns0"
+                                    |"single-request-reopen")
                         | ip6_dotint
 
             in Build.key_value_line_comment
@@ -103,13 +124,14 @@ let entry = nameserver
           | search
           | sortlist
           | options
+          | lookup
+          | family
 
 (* View: lns *)
 let lns = ( empty | comment | entry )*
 
 (* Variable: filter *)
 let filter = (incl "/etc/resolv.conf")
-    . Util.stdexcl
 
 let xfm = transform lns filter
 
diff --git a/lenses/rmt.aug b/lenses/rmt.aug
new file mode 100644 (file)
index 0000000..36ed2d3
--- /dev/null
@@ -0,0 +1,30 @@
+(*
+Module: Rmt
+  Parses rmt's configuration file
+
+Author: Dominic Cleal <dcleal@redhat.com>
+
+About: Reference
+    This lens is based on rmt(1)
+
+About: License
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
+*)
+
+module Rmt =
+  autoload xfm
+
+let sto_to_tab = store Rx.no_spaces
+
+let debug  = Build.key_value_line "DEBUG" Sep.equal ( store Rx.fspath )
+let user   = Build.key_value_line "USER" Sep.equal sto_to_tab
+let access = Build.key_value_line "ACCESS" Sep.equal
+               ( [ label "name" . sto_to_tab ] . Sep.tab .
+                 [ label "host" . sto_to_tab ] . Sep.tab .
+                 [ label "path" . sto_to_tab ] )
+
+let lns = ( debug | user | access | Util.comment | Util.empty )*
+
+let filter = incl "/etc/default/rmt"
+
+let xfm = transform lns filter
diff --git a/lenses/rsyslog.aug b/lenses/rsyslog.aug
new file mode 100644 (file)
index 0000000..943847f
--- /dev/null
@@ -0,0 +1,66 @@
+(*
+Module: Rsyslog
+  Parses /etc/rsyslog.conf
+
+Author: Raphael Pinson <raphael.pinsons@camptocamp.com>
+
+About: Reference
+  This lens tries to keep as close as possible to `man 5 rsyslog.conf` where possible.
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to /etc/rsyslog.conf. See <filter>.
+
+About: Examples
+   The <Test_Rsyslog> file contains various examples and tests.
+*)
+module Rsyslog =
+
+autoload xfm
+
+let macro_rx = /[^,# \n\t][^#\n]*[^,# \n\t]|[^,# \n\t]/
+let macro = [ key /$[A-Za-z0-9]+/ . Sep.space . store macro_rx . Util.comment_or_eol ]
+
+(* View: users
+   Map :omusrmsg: and a list of users, or a single *
+*)
+let omusrmsg = Util.del_str ":omusrmsg:" .
+                 Syslog.label_opt_list_or "omusrmsg" (store Syslog.word)
+                                          Syslog.comma "*"
+
+(* View: file_tmpl
+   File action with a specified template *)
+let file_tmpl = Syslog.file . [ label "template" . Util.del_str ";" . store Rx.word ]
+
+let action = Syslog.action | omusrmsg | file_tmpl
+
+(* View: entry
+   An entry contains selectors and an action
+*)
+let entry = [ label "entry" . Syslog.selectors . Syslog.sep_tab .
+              [ label "action" . action ] . Util.eol ]
+
+(* View: prop_filter
+   Parses property-based filters, which start with ":" and the property name *)
+let prop_filter =
+     let sep = Sep.comma . Util.del_ws_spc
+  in let prop_name = [ Util.del_str ":" . label "property" . store Rx.word ]
+  in let prop_oper = [ label "operation" . store /[A-Za-z!-]+/ ]
+  in let prop_val  = [ label "value" . Quote.do_dquote (store /[^\n"]*/) ]
+  in let prop_act  = [ label "action" . action ]
+  in [ label "filter" . prop_name . sep . prop_oper . sep . prop_val .
+       Sep.space . prop_act . Util.eol ]
+
+let entries = ( Syslog.empty | Syslog.comment | entry | macro | prop_filter )*
+
+let lns = entries . ( Syslog.program | Syslog.hostname )*
+
+let filter = incl "/etc/rsyslog.conf"
+
+let xfm = transform lns filter
+
index 2438cd1..5fb0851 100644 (file)
@@ -5,7 +5,7 @@ Module: Rx
 Author: Raphael Pinson <raphink@gmail.com>
 
 About: License
-  This file is licensed under the LGPLv2+, like the rest of Augeas.
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
 *)
 
 
@@ -15,19 +15,32 @@ module Rx =
 (* Variable: space
    A mandatory space or tab *)
 let space     = /[ \t]+/
+
 (* Variable: opt_space
    An optional space or tab *)
 let opt_space = /[ \t]*/
 
+(* Variable: cl
+   A continued line with a backslash *)
+let cl = /[ \t]*\\\\\n[ \t]*/
+
+(* Variable: cl_or_space
+   A <cl> or a <space> *)
+let cl_or_space = cl | space
+
+(* Variable: cl_or_opt_space
+   A <cl> or a <opt_space> *)
+let cl_or_opt_space = cl | opt_space
+
 (* Group: General strings *)
 
 (* Variable: space_in
    A string which not starting or ending with a space *)
-let space_in  = /[^ \t\n].*[^ \t\n]|[^ \t\n]/
+let space_in  = /[^ \r\t\n].*[^ \r\t\n]|[^ \t\n\r]/
 
 (* Variable: no_spaces
    A string with no spaces *)
-let no_spaces = /[^ \t\n]+/
+let no_spaces = /[^ \t\r\n]+/
 
 (* Variable: word
    An alphanumeric string *)
@@ -37,14 +50,34 @@ let word       = /[A-Za-z0-9_.-]+/
    One or more digits *)
 let integer    = /[0-9]+/
 
-(* Variable: integer
+(* Variable: relinteger
    A relative <integer> *)
-let relinteger = /-?[0-9]+/
+let relinteger = /[-+]?[0-9]+/
+
+(* Variable: relinteger_noplus
+   A relative <integer>, without explicit plus sign *)
+let relinteger_noplus = /[-]?[0-9]+/
 
 (* Variable: decimal
    A decimal value (using ',' or '.' as a separator) *)
 let decimal    = /[0-9]+([.,][0-9]+)?/
 
+(* Variable: reldecimal
+   A relative <decimal> *)
+let reldecimal    = /[+-]?[0-9]+([.,][0-9]+)?/
+
+(* Variable: byte
+  A byte (0 - 255) *)
+let byte = /25[0-5]?|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9]/
+
+(* Variable: hex
+   A hex value *)
+let hex = /0x[0-9a-fA-F]+/
+
+(* Variable: octal
+   An octal value *)
+let octal = /0[0-7]+/
+
 (* Variable: fspath
    A filesystem path *)
 let fspath    = /[^ \t\n]+/
@@ -54,7 +87,6 @@ let fspath    = /[^ \t\n]+/
    Anything but a space, a comma or a comment sign *)
 let neg1      = /[^,# \n\t]+/
 
-
 (*
  * Group: IPs
  * Cf. http://blog.mes-stats.fr/2008/10/09/regex-ipv4-et-ipv6/ (in fr)
@@ -63,8 +95,7 @@ let neg1      = /[^,# \n\t]+/
 (* Variable: ipv4 *)
 let ipv4 =
   let dot     = "." in
-  let digits  = /(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/ in
-    digits . dot . digits . dot . digits . dot . digits
+    byte . dot . byte . dot . byte . dot . byte
 
 (* Variable: ipv6 *)
 let ipv6 =
@@ -98,6 +129,11 @@ let ipv6 =
 let ip        = ipv4 | ipv6
 
 
+(* Variable: hostname
+   A valid RFC 1123 hostname *)
+let hostname = /(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*(
+                  [A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])/
+
 (*
  * Variable: device_name
  * A Linux device name like eth0 or i2c-0. Might still be too restrictive
@@ -110,3 +146,18 @@ let device_name = /[a-zA-Z0-9_?.+:!-]+/
  *    To be refined
  *)
 let email_addr = /[A-Za-z0-9_+.-]+@[A-Za-z0-9_.-]+/
+
+(*
+ * Variable: iso_8601
+ *    ISO 8601 date time format
+ *)
+let year = /[0-9]{4}/
+let relyear = /[-+]?/ . year
+let monthday = /W?[0-9]{2}(-?[0-9]{1,2})?/
+let time =
+     let sep = /[T \t]/
+  in let digits = /[0-9]{2}(:?[0-9]{2}(:?[0-9]{2})?)?/
+  in let precis = /[.,][0-9]+/
+  in let zone = "Z" | /[-+]?[0-9]{2}(:?[0-9]{2})?/
+  in sep . digits . precis? . zone?
+let iso_8601 = year . ("-"? . monthday . time?)?
index 30db88e..affe616 100644 (file)
@@ -22,14 +22,14 @@ let eol      = IniFile.eol
 let empty    = IniFile.empty
 let sto_to_comment
              = Util.del_opt_ws " "
-             . store /[^;# \t\n][^;#\n]*[^;# \t\n]|[^;# \t\n]/
+             . store /[^;# \t\r\n][^;#\r\n]*[^;# \t\r\n]|[^;# \t\r\n]/
 
 (************************************************************************
  *                        ENTRY
  * smb.conf allows indented entries
  *************************************************************************)
 
-let entry_re = /[A-Za-z0-9_.-][A-Za-z0-9 _.:-]*[A-Za-z0-9_.-]/
+let entry_re = /[A-Za-z0-9_.-][A-Za-z0-9 _.:\*-]*[A-Za-z0-9_.\*-]/
 let entry    = let kw = entry_re in
              [ indent
              . key kw
@@ -52,6 +52,5 @@ let record   = IniFile.record title entry
 let lns      = IniFile.lns record comment
 
 let filter   = (incl "/etc/samba/smb.conf")
-             . Util.stdexcl
 
 let xfm = transform lns filter
index 9d5b8bd..c53ea17 100644 (file)
@@ -8,7 +8,7 @@ About: Reference
   This lens tries to keep as close as possible to `man 5 schroot.conf` where possible.
 
 About: License
-   This file is licenced under the LGPLv2+, like the rest of Augeas.
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
    To be documented
@@ -42,9 +42,9 @@ let sep        = IniFile.sep "=" "="
 (* View: description
    Descriptions are special entries, which can have an optional lang parameter *)
 let description =
-   let lang = [ Util.del_str "[" . label "lang"
-              . store IniFile.entry_re . Util.del_str "]" ] in
-   [ key "description" . lang? . sep . IniFile.sto_to_comment? . (comment|IniFile.eol) ]
+     let lang = [ Util.del_str "[" . label "lang"
+                . store IniFile.entry_re . Util.del_str "]" ]
+  in IniFile.entry_generic_nocomment (key "description" . lang?) sep "#" comment
 
 (* View: entry
    An <IniFile.entry>, or <description> *)
@@ -65,6 +65,5 @@ let lns    = IniFile.lns record comment
 
 (* View: filter *)
 let filter = (incl "/etc/schroot/schroot.conf")
-             . Util.stdexcl
 
 let xfm = transform lns filter
index cdbe387..6798e10 100644 (file)
@@ -5,7 +5,7 @@ Module: Sep
 Author: Raphael Pinson <raphink@gmail.com>
 
 About: License
-  This file is licensed under the LGPLv2+, like the rest of Augeas.
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
 *)
 
 
@@ -14,12 +14,18 @@ module Sep =
 (* Variable: colon *)
 let colon = Util.del_str ":"
 
+(* Variable: semicolon *)
+let semicolon = Util.del_str ";"
+
 (* Variable: comma *)
 let comma = Util.del_str ","
 
 (* Variable: equal *)
 let equal = Util.del_str "="
 
+(* Variable: space_equal *)
+let space_equal = Util.delim "="
+
 (* Variable: space
    Deletes a <Rx.space> and default to a single space *)
 let space = del Rx.space " "
@@ -35,3 +41,17 @@ let opt_space = del Rx.opt_space ""
 (* Variable: opt_tab
    Deletes a <Rx.opt_space> and default to a tab *)
 let opt_tab   = del Rx.opt_space "\t"
+
+(* Variable: cl_or_space
+   Deletes a <Rx.cl_or_space> and default to a single space *)
+let cl_or_space = del Rx.cl_or_space " "
+
+(* Variable: cl_or_opt_space
+   Deletes a <Rx.cl_or_opt_space> and default to a single space *)
+let cl_or_opt_space = del Rx.cl_or_opt_space " "
+
+(* Variable: lbracket *)
+let lbracket = Util.del_str "("
+
+(* Variable: rbracket *)
+let rbracket = Util.del_str ")"
index df29db3..bad590f 100644 (file)
@@ -11,7 +11,7 @@ The definitions from 'man services' are put as commentaries for reference
 throughout the file. More information can be found in the manual.
 
 About: License
-  This file is licensed under the LGPLv2+, like the rest of Augeas.
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
   Sample usage of this lens in augtool
@@ -47,7 +47,7 @@ let comment     = Util.comment
 let comment_or_eol = Util.comment_or_eol
 let empty       = Util.empty
 let protocol_re = /[a-zA-Z]+/
-let word_re     = /[a-zA-Z0-9_.+*\/-]+/
+let word_re     = /[a-zA-Z0-9_.+*\/:-]+/
 let num_re      = /[0-9]+/
 
 (* Group: Separators *)
@@ -61,6 +61,11 @@ let sep_spc = Util.del_ws_spc
 (* View: port *)
 let port = [ label "port" . store num_re ]
 
+(* View: port_range *)
+let port_range = [ label "start" . store num_re ]
+                   . Util.del_str "-"
+                   . [ label "end" . store num_re ]
+
 (* View: protocol *)
 let protocol = [ label "protocol" . store protocol_re ]
 
@@ -72,7 +77,8 @@ let alias = [ label "alias" . store word_re ]
  *   A standard /etc/services record
  *   TODO: make sure a space is added before a comment on new nodes
  *)
-let record = [ label "service-name" . store word_re . sep_spc . port
+let record = [ label "service-name" . store word_re
+                 . sep_spc . (port | port_range)
                  . del "/" "/" . protocol . ( sep_spc . alias )*
                  . comment_or_eol ]
 
diff --git a/lenses/shadow.aug b/lenses/shadow.aug
new file mode 100644 (file)
index 0000000..dc2ace3
--- /dev/null
@@ -0,0 +1,72 @@
+(*
+ Module: Shadow
+ Parses /etc/shadow
+
+ Author: Lorenzo M. Catucci <catucci@ccd.uniroma2.it>
+
+ Original Author: Free Ekanayaka <free@64studio.com>
+
+ About: Reference
+
+   - man 5 shadow
+   - man 3 getspnam
+
+ About: License
+   This file is licensed under the LGPL v2+, like the rest of Augeas.
+
+ About:
+
+ Each line in the shadow files represents the additional shadow-defined attributes
+ for the corresponding user, as defined in the passwd file.
+
+*)
+
+module Shadow =
+
+   autoload xfm
+
+(************************************************************************
+ *                           USEFUL PRIMITIVES
+ *************************************************************************)
+
+let eol        = Util.eol
+let comment    = Util.comment
+let empty      = Util.empty
+let dels       = Util.del_str
+
+let colon      = Sep.colon
+
+let word       = Rx.word
+let integer    = Rx.integer
+
+let sto_to_col = Passwd.sto_to_col
+let sto_to_eol = Passwd.sto_to_eol
+
+(************************************************************************
+ * Group:                        ENTRIES
+ *************************************************************************)
+
+(* View: entry *)
+let entry   = [ key word
+                . colon
+                . [ label "password"          . sto_to_col?    . colon ]
+                . [ label "lastchange_date"   . store integer? . colon ]
+                . [ label "minage_days"       . store integer? . colon ]
+                . [ label "maxage_days"       . store integer? . colon ]
+                . [ label "warn_days"         . store integer? . colon ]
+                . [ label "inactive_days"     . store integer? . colon ]
+                . [ label "expire_date"       . store integer? . colon ]
+                . [ label "flag"              . store integer? ]
+                . eol ]
+
+(************************************************************************
+ *                                LENS
+ *************************************************************************)
+
+let lns        = (comment|empty|entry) *
+
+let filter
+               = incl "/etc/shadow"
+               . Util.stdexcl
+
+let xfm        = transform lns filter
index 07c96fa..87a4842 100644 (file)
@@ -8,7 +8,7 @@ About: Reference
   This lens tries to keep as close as possible to `man 5 shells` where possible.
 
 About: License
-   This file is licenced under the LGPLv2+, like the rest of Augeas.
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
    To be documented
@@ -23,7 +23,8 @@ module Shells =
 
 let empty = Util.empty
 let comment = Util.comment
-let shell = [ seq "shell" . store /[^# \t\n]+/ . Util.eol ]
+let comment_or_eol = Util.comment_or_eol
+let shell = [ seq "shell" . store /[^# \t\n]+/ . comment_or_eol ]
 
 (* View: lns
      The shells lens
@@ -32,6 +33,5 @@ let lns = ( empty | comment | shell )*
 
 (* Variable: filter *)
 let filter = incl "/etc/shells"
-    . Util.stdexcl
 
 let xfm = transform lns filter
index faa0e72..073f69b 100644 (file)
@@ -4,7 +4,7 @@ Module: Shellvars
  in /etc/sysconfig
 
 About: License
-   This file is licenced under the LGPLv2+, like the rest of Augeas.
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
    To be documented
@@ -13,33 +13,51 @@ About: Lens Usage
 module Shellvars =
   autoload xfm
 
-  let eol = del /[ \t]+|[ \t]*[;\n]/ "\n"
-  let semicol_eol = del /[ \t]*[;\n]/ "\n"
+  let empty   = Util.empty
+  let empty_part_re = Util.empty_generic_re . /\n+/
+  let eol = del (/[ \t]+|[ \t]*[;\n]/ . empty_part_re*) "\n"
+  let semicol_eol = del (/[ \t]*[;\n]/ . empty_part_re*) "\n"
 
-  let key_re = /[A-Za-z0-9_]+(\[[0-9]+\])?/ - "unset" - "export"
+  let key_re = /[A-Za-z0-9_]+(\[[0-9]+\])?/ - ("unset" | "export")
+  let matching_re = "${!" . key_re . /[\*@]\}/
   let eq = Util.del_str "="
 
-  let comment = Util.comment
-  let comment_eol = Util.comment_eol
+  let eol_for_comment = del /([ \t]*\n)([ \t]*(#[ \t]*)?\n)*/ "\n"
+  let comment = Util.comment_generic_seteol /[ \t]*#[ \t]*/ " # " eol_for_comment
+  (* comment_eol in shell MUST begin with a space *)
+  let comment_eol = Util.comment_generic_seteol /[ \t]+#[ \t]*/ " # " eol_for_comment
   let comment_or_eol = comment_eol | semicol_eol
 
-  let empty   = Util.empty
   let xchgs   = Build.xchgs
   let semicol = del /;?/ ""
 
-  let char  = /[^;#() '"\t\n]|\\\\"/
-  let dquot = /"([^"\\\n]|\\\\.)*"/                    (* " Emacs, relax *)
-  let squot = /'[^'\n]*'/
-  (* For some reason, `` conflicts with comment_or_eol *)
-  let bquot = /`[^#`\n]*`/
+  let char  = /[^`;() '"\t\n]|\\\\"/
+  let dquot =
+       let char = /[^"\\]|\\\\./ | Rx.cl
+    in "\"" . char* . "\""                    (* " Emacs, relax *)
+  let squot = /'[^']*'/
+  let bquot = /`[^`\n]*`/
+  (* dbquot don't take spaces or semi-colons *)
+  let dbquot = /``[^` \t\n;]+``/
+  let dollar_assign = /\$\([^\(\)#\n]*\)/
+  let dollar_arithm = /\$\(\([^\)#\n]*\)\)/
+
+  let anyquot = (dquot|squot)+ | bquot | dbquot | dollar_assign | dollar_arithm
 
-  let sto_to_semicol = store /[^#; \t\n][^#;\n]+[^#; \t\n]|[^#; \t\n]+/
+  let to_semicol_re = /[^#; \t\n][^#;\n]+[^#; \t\n]|[^#; \t\n]+/
+  let sto_to_semicol = store to_semicol_re
+
+  let sto_to_semicol_quot =
+       let no_semicol_re = /[^"'#;\n]/
+    in let no_semicol_spc_re = /[^"'#; \t\n]/
+    in let multi_chars = no_semicol_spc_re . (no_semicol_re|anyquot)+ . no_semicol_spc_re
+    in store (no_semicol_spc_re | multi_chars)
 
   (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)
   (* arrays here because of typechecking headaches. Instead, they are    *)
   (* treated as a simple value                                           *)
   let array =
-    let array_value = store (char+ | dquot) in
+    let array_value = store (char+ | anyquot) in
     del /\([ \t]*/ "(" . counter "values" .
       [ seq "values" . array_value ] .
       [ del /[ \t\n]+/ " " . seq "values" . array_value ] *
@@ -49,36 +67,41 @@ module Shellvars =
   (* but fairly close.                                                *)
   let simple_value =
     let empty_array = /\([ \t]*\)/ in
-      store (char* | dquot | squot | bquot | empty_array)
+      store (char* | anyquot | empty_array)
 
   let export = [ key "export" . Util.del_ws_spc ]
-  let kv = Util.indent . export? . key key_re
-           . eq . (simple_value | array) . semicol . comment_or_eol ]
+  let kv = Util.indent . export? . key key_re
+           . eq . (simple_value | array)
 
   let var_action (name:string) =
-    [ Util.indent . xchgs name ("@" . name) . Util.del_ws_spc
-    . store key_re . semicol . comment_or_eol ]
+    Util.indent . del name name . Util.del_ws_spc
+    . label ("@" . name) . counter "var_action"
+    . Build.opt_list [ seq "var_action" . store (key_re | matching_re) ] Util.del_ws_spc
 
   let unset = var_action "unset"
   let bare_export = var_action "export"
 
   let source =
-    Util.indent
-      . del /\.|source/ "." . label ".source"
-      . Util.del_ws_spc . store /[^;=# \t\n]+/ . comment_or_eol ]
+    Util.indent
+    . del /\.|source/ "." . label ".source"
+    . Util.del_ws_spc . store /[^;=# \t\n]+/
 
-  let shell_builtin_cmds = "ulimit"
+  let shell_builtin_cmds = "ulimit" | "shift" | "exit"
 
   let builtin =
-    [ Util.indent . label "@builtin"
-      . store shell_builtin_cmds
-      . Util.del_ws_spc
-      . [ label "args" . sto_to_semicol ]
-      . comment_or_eol ]
+    Util.indent . label "@builtin"
+    . store shell_builtin_cmds
+    . (Util.del_ws_spc
+    . [ label "args" . sto_to_semicol ])?
 
   let keyword (kw:string) = Util.indent . Util.del_str kw
   let keyword_label (kw:string) (lbl:string) = keyword kw . label lbl
 
+  let return =
+    Util.indent . label "@return"
+    . Util.del_str "return"
+    . ( Util.del_ws_spc . store Rx.integer )?
+
 
 (************************************************************************
  * Group:                 CONDITIONALS AND LOOPS
@@ -87,7 +110,7 @@ module Shellvars =
   let generic_cond_start (start_kw:string) (lbl:string)
                          (then_kw:string) (contents:lens) =
       keyword_label start_kw lbl . Sep.space
-      . sto_to_semicol . semicol_eol
+      . sto_to_semicol_quot . semicol_eol
       . keyword then_kw . eol
       . contents
 
@@ -99,7 +122,7 @@ module Shellvars =
   let cond_if (entry:lens) =
     let elif = [ generic_cond_start "elif" "@elif" "then" entry+ ] in
     let else = [ keyword_label "else" "@else" . eol . entry+ ] in
-    generic_cond "if" "@if" "then" (entry+ . elif? . else?) "fi"
+    generic_cond "if" "@if" "then" (entry+ . elif* . else?) "fi"
 
   let loop_for (entry:lens) =
     generic_cond "for" "@for" "do" entry+ "done"
@@ -113,92 +136,123 @@ module Shellvars =
   let loop_select (entry:lens) =
     generic_cond "select" "@select" "do" entry+ "done"
 
-  let case (entry:lens) =
+  let case (entry:lens) (entry_noeol:lens) =
     let case_entry = [ label "@case_entry"
                        . Util.indent . store /[^ \t\n\)]+/
                        . Util.del_str ")" . eol
-                       . entry+
+                       . ( entry+ | entry_noeol )?
                        . Util.indent . Util.del_str ";;" . eol ] in
       [ keyword_label "case" "@case" . Sep.space
-        . store char+
+        . store (char+ | ("\"" . char+ . "\""))
         . del /[ \t\n]+/ " " . Util.del_str "in" . eol
-        . case_entry+
+        . (empty* . comment* . case_entry)*
+        . empty* . comment*
         . keyword "esac" . comment_or_eol ]
 
+  let function (entry:lens) =
+    [ Util.indent . label "@function"
+      . del /(function[ \t]+)?/ ""
+      . store Rx.word . del /[ \t]*\(\)/ "()"
+      . eol . Util.del_str "{" . eol
+      . entry+
+      . Util.indent . Util.del_str "}" . eol ]
+
+  let entry_eol =
+    let entry_eol_item (item:lens) =
+      [ item . comment_or_eol ] in
+      entry_eol_item source
+        | entry_eol_item kv
+        | entry_eol_item unset
+        | entry_eol_item bare_export
+        | entry_eol_item builtin
+        | entry_eol_item return
+
+  let entry_noeol =
+    let entry_item (item:lens) = [ item ] in
+      entry_item source
+        | entry_item kv
+        | entry_item unset
+        | entry_item bare_export
+        | entry_item builtin
+        | entry_item return
+
   let rec rec_entry =
-    let entry = comment | empty | source | kv
-              | unset | bare_export | builtin | rec_entry in
+    let entry = comment | entry_eol | rec_entry in
         cond_if entry
       | loop_for entry
       | loop_select entry
       | loop_while entry
       | loop_until entry
-      | case entry
+      | case entry entry_noeol
+      | function entry
+
+  let lns_norec = empty* . (comment | entry_eol) *
 
-  let lns = (comment | empty | source | kv | unset | bare_export | builtin | rec_entry) *
+  let lns = empty* . (comment | entry_eol | rec_entry) *
 
   let sc_incl (n:string) = (incl ("/etc/sysconfig/" . n))
+  let sc_excl (n:string) = (excl ("/etc/sysconfig/" . n))
+
   let filter_sysconfig =
-      sc_incl "atd" .
-      sc_incl "authconfig" .
-      sc_incl "autofs" .
-      sc_incl "clock" .
-      sc_incl "cpuspeed" .
-      sc_incl "crond" .
-      sc_incl "crontab" .
-      sc_incl "desktop" .
-      sc_incl "firstboot" .
-      sc_incl "grub" .
-      sc_incl "hsqldb" .
-      sc_incl "httpd" .
-      sc_incl "i18n" .
-      sc_incl "init" .
-      sc_incl "iptables-config" .
-      sc_incl "irda" .
-      sc_incl "irqbalance" .
-      sc_incl "kdump" .
-      sc_incl "keyboard" .
-      sc_incl "kudzu" .
-      sc_incl "libvirtd" .
-      sc_incl "lircd" .
-      sc_incl "nasd" .
-      sc_incl "netconsole" .
-      sc_incl "network" .
-      sc_incl "nfs" .
-      sc_incl "ntpd" .
-      sc_incl "prelink" .
-      sc_incl "puppet" .
-      sc_incl "puppetmaster" .
-      sc_incl "readonly-root" .
-      sc_incl "rsyslog" .
-      sc_incl "samba" .
-      sc_incl "saslauthd" .
-      sc_incl "selinux" .
-      sc_incl "sendmail" .
-      sc_incl "smartmontools" .
-      sc_incl "snmpd" .
-      sc_incl "snmpd.options" .
-      sc_incl "snmptrapd" .
-      sc_incl "snmptrapd.options" .
-      sc_incl "spamassassin" .
-      sc_incl "suseconfig" .
-      sc_incl "sysstat" .
-      sc_incl "system-config-users" .
-      sc_incl "vncservers" .
-      sc_incl "wpa_supplicant" .
-      sc_incl "xend" .
-      sc_incl "xendomains"
-
-  let filter_ifcfg   = incl "/etc/sysconfig/network-scripts/ifcfg-*"
-                     . incl "/etc/sysconfig/network/ifcfg-*"
+      sc_incl "*" .
+      sc_excl "bootloader" .
+      sc_excl "hw-uuid" .
+      sc_excl "hwconf" .
+      sc_excl "ip*tables" .
+      sc_excl "ip*tables.save" .
+      sc_excl "kernel" .
+      sc_excl "*.pub" .
+      sc_excl "sysstat.ioconf" .
+      sc_excl "system-config-firewall" .
+      sc_excl "system-config-securitylevel" .
+      sc_incl "network/config" .
+      sc_incl "network/dhcp" .
+      sc_incl "network/dhcp6r" .
+      sc_incl "network/dhcp6s" .
+      sc_incl "network/ifcfg-*" .
+      sc_incl "network/if-down.d/*" .
+      sc_incl "network/ifroute-*" .
+      sc_incl "network/if-up.d/*" .
+      sc_incl "network/providers/*" .
+      sc_excl "network-scripts" .
+      sc_incl "network-scripts/ifcfg-*" .
+      sc_excl "rhn" .
+      sc_incl "rhn/allowed-actions/*" .
+      sc_excl "rhn/allowed-actions/script" .
+      sc_incl "rhn/allowed-actions/script/*" .
+      sc_incl "rhn/rhnsd" .
+      sc_excl "SuSEfirewall2.d" .
+      sc_incl "SuSEfirewall2.d/cobbler" .
+      sc_incl "SuSEfirewall2.d/services/*" .
+      sc_excl "SuSEfirewall2.d/services/TEMPLATE" .
+      sc_excl "*.systemd"
+
   let filter_default = incl "/etc/default/*"
+                     . excl "/etc/default/grub_installdevice*"
+                     . excl "/etc/default/rmt"
+                     . excl "/etc/default/whoopsie"
   let filter_misc    = incl "/etc/arno-iptables-firewall/debconf.cfg"
                      . incl "/etc/cron-apt/config"
                      . incl "/etc/environment"
+                     . incl "/etc/firewalld/firewalld.conf"
                      . incl "/etc/blkid.conf"
+                     . incl "/etc/adduser.conf"
+                     . incl "/etc/cowpoke.conf"
+                     . incl "/etc/cvs-cron.conf"
+                     . incl "/etc/cvs-pserver.conf"
+                     . incl "/etc/devscripts.conf"
+                     . incl "/etc/lintianrc"
+                     . incl "/etc/lsb-release"
+                     . incl "/etc/os-release"
+                     . incl "/etc/popularity-contest.conf"
+                     . incl "/etc/rc.conf"
+                     . incl "/etc/rc.conf.local"
+                     . incl "/etc/selinux/config"
+                     . incl "/etc/ucf.conf"
+                     . incl "/etc/locale.conf"
+                     . incl "/etc/vconsole.conf"
 
   let filter = filter_sysconfig
-             . filter_ifcfg
              . filter_default
              . filter_misc
              . Util.stdexcl
index 7f5fa2c..53c79a9 100644 (file)
@@ -9,12 +9,14 @@ module Shellvars_list =
   let key_re = /[A-Za-z0-9_]+/
   let eq      = Util.del_str "="
   let comment = Util.comment
+  let comment_or_eol = Util.comment_or_eol
   let empty   = Util.empty
   let indent  = Util.indent
 
   let sqword = /[^ '\t\n]+/
   let dqword = /([^ "\\\t\n]|\\\\.)+/
-  let uqword = /([^ "'\\\t\n]|\\\\.)+/
+  let uqword = /([^ `"'\\\t\n]|\\\\.)+/
+  let bqword = /`[^`\n]*`/
 
   (* lists values of the form ...  val1 val2 val3  ... *)
   let list(word:regexp) =
@@ -25,27 +27,28 @@ module Shellvars_list =
 
 
   (* handle single quoted lists *)
-  let squote_arr = [ label "quote" . store /'/ ] . (list sqword)? . del /'/ "'"
+  let squote_arr = [ label "quote" . store /'/ ]
+                   . (list sqword)? . del /'/ "'"
 
   (* similarly handle double qouted lists *)
-  let dquote_arr = [ label "quote" . store /"/ ] . (list dqword)? . del /"/ "\""
+  let dquote_arr = [ label "quote" . store /"/ ]
+                   . (list dqword)? . del /"/ "\""
 
   (* handle unquoted single value *)
-  let unquot_val = [ label "quote" . store "" ] . [label "value"  . store uqword+]?
+  let unquot_val = [ label "quote" . store "" ]
+                 . [ label "value"  . store (uqword+ | bqword)]?
 
 
   (* lens for key value pairs *)
-  let kv = [ key key_re . eq . ( squote_arr | dquote_arr | unquot_val ) .  eol ]
+  let kv = [ key key_re . eq .
+             ( (squote_arr | dquote_arr) . comment_or_eol
+             | unquot_val . eol )
+           ]
 
   let lns = ( comment | empty | kv )*
 
-  let sc_incl (n:string) = (incl ("/etc/sysconfig/" . n))
-  let filter_sysconfig =
-      sc_incl "bootloader" .
-      sc_incl "kernel"
-
-  let filter = filter_sysconfig
-             . Util.stdexcl
+  let filter = incl "/etc/sysconfig/bootloader"
+             . incl "/etc/sysconfig/kernel"
 
   let xfm = transform lns filter
 
diff --git a/lenses/simplelines.aug b/lenses/simplelines.aug
new file mode 100644 (file)
index 0000000..38f2189
--- /dev/null
@@ -0,0 +1,47 @@
+(*
+Module: Simplelines
+   Parses simple lines conffiles
+
+Author: Raphael Pinson <raphink@gmail.com>
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   See <filter>.
+
+About: Examples
+   The <Test_Simplelines> file contains various examples and tests.
+*)
+
+module Simplelines =
+
+autoload xfm
+
+(* View: line
+     A simple, uncommented, line *)
+let line =
+   let line_re = /[^# \t\n].*[^ \t\n]|[^# \t\n]/
+   in [ seq "line" . Util.indent
+      . store line_re . Util.eol ]
+
+(* View: lns
+     The simplelines lens *)
+let lns = (Util.empty | Util.comment | line)*
+
+(* Variable: filter *)
+let filter = incl "/etc/at.allow"
+           . incl "/etc/at.deny"
+           . incl "/etc/cron.allow"
+           . incl "/etc/cron.deny"
+           . incl "/etc/cron.d/at.allow"
+           . incl "/etc/cron.d/at.deny"
+           . incl "/etc/cron.d/cron.allow"
+           . incl "/etc/cron.d/cron.deny"
+           . incl "/etc/default/grub_installdevice"
+           . incl "/etc/pam.d/allow.pamlist"
+
+let xfm = transform lns filter
diff --git a/lenses/simplevars.aug b/lenses/simplevars.aug
new file mode 100644 (file)
index 0000000..ad9795f
--- /dev/null
@@ -0,0 +1,51 @@
+(*
+Module: Simplevars
+  Parses simple key = value conffiles
+
+Author: Raphael Pinson <raphink@gmail.com>
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Examples
+   The <Test_Simplevars> file contains various examples and tests.
+*)
+
+module Simplevars =
+
+autoload xfm
+
+(* Variable: to_comment_re
+   The regexp to match the value *)
+let to_comment_re =
+     let to_comment_squote = /'[^\n']*'/
+  in let to_comment_dquote = /"[^\n"]*"/
+  in let to_comment_noquote = /[^\n \t'"#][^\n#]*[^\n \t#]|[^\n \t'"#]/
+  in to_comment_squote | to_comment_dquote | to_comment_noquote
+
+(* View: entry *)
+let entry =
+     let some_value = Sep.space_equal . store to_comment_re
+     (* Avoid ambiguity in tree by making a subtree here *)
+  in let empty_value = [del /[ \t]*=/ "="] . store ""
+  in [ Util.indent . key Rx.word
+            . (some_value? | empty_value)
+            . (Util.eol | Util.comment_eol) ]
+
+(* View: lns *)
+let lns = (Util.empty | Util.comment | entry)*
+
+(* Variable: filter *)
+let filter = incl "/etc/kernel-img.conf"
+           . incl "/etc/kerneloops.conf"
+           . incl "/etc/wgetrc"
+           . incl "/etc/zabbix/*.conf"
+           . incl "/etc/audit/auditd.conf"
+           . incl "/etc/mixerctl.conf"
+           . incl "/etc/wsconsctlctl.conf"
+           . incl "/etc/selinux/semanage.conf"
+
+let xfm = transform lns filter
diff --git a/lenses/sip_conf.aug b/lenses/sip_conf.aug
new file mode 100644 (file)
index 0000000..2674558
--- /dev/null
@@ -0,0 +1,57 @@
+(*
+Module: Sip_Conf
+  Parses /etc/asterisk/sip.conf
+
+Author: Rob Tucker <rtucker@mozilla.com>
+
+About: Reference
+  Lens parses the sip.conf with support for template structure
+
+About: License
+  This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+  To be documented
+
+About: Configuration files
+  This lens applies to /etc/asterisk/sip.conf. See <filter>.
+*)
+
+module Sip_Conf =
+  autoload xfm
+
+(************************************************************************
+ * INI File settings
+ *************************************************************************)
+
+let comment        = IniFile.comment IniFile.comment_re IniFile.comment_default
+let sep            = IniFile.sep IniFile.sep_re IniFile.sep_default
+let empty          = IniFile.empty
+let eol            = IniFile.eol
+let comment_or_eol = comment | eol
+
+
+let entry    = IniFile.indented_entry IniFile.entry_re sep comment
+
+let text_re = Rx.word
+let tmpl    =
+  let is_tmpl = [ label "@is_template" . Util.del_str "!" ]
+    in let use_tmpl = [ label "@use_template" . store Rx.word ]
+    in let comma = Util.delim ","
+    in Util.del_str "(" . Sep.opt_space
+      . Build.opt_list (is_tmpl|use_tmpl) comma
+      . Sep.opt_space . Util.del_str ")"
+let title_comment_re = /[ \t]*[#;].*$/
+
+let title_comment = [ label "#title_comment"
+  . store title_comment_re ]
+let title   = label "title" . Util.del_str "["
+            . store text_re . Util.del_str "]"
+            . tmpl? . title_comment? . eol
+let record  = IniFile.record title entry
+
+let lns     = IniFile.lns record comment
+
+let filter = incl "/etc/asterisk/sip.conf"
+
+let xfm = transform lns filter
index afe074b..e119565 100644 (file)
@@ -18,7 +18,6 @@ let sep         = del /[ \t\n]+/ " "
 
 let sto_to_eol  = store /([^ \t\n].*[^ \t\n]|[^ \t\n])/
 let sto_to_spc  = store /[^\\# \t\n]+/
-let sto_to_by   = store (/[^\\# \t\n]+/ - "by")
 
 let comment     = Util.comment
 let empty       = Util.empty
@@ -28,12 +27,14 @@ let empty       = Util.empty
  *************************************************************************)
 
 let access_re   = "access to"
-let who         = [ spc . label "who"     . sto_to_spc ]
-let what        = [ spc . label "what"    . sto_to_spc ]
+let control_re  = "stop" | "continue" | "break"
+let what        = [ spc . label "access"
+                  . store (/[^\\# \t\n]+/ - ("by" | control_re)) ]
 
 (* TODO: parse the control field, see man slapd.access (5) *)
-let control     = [ spc . label "control" . sto_to_by  ]
-let by          = [ sep . key "by". who . what. control? ]
+let control     = [ spc . label "control" . store control_re ]
+let by          = [ sep . key "by" . spc . sto_to_spc
+                  . what? . control? ]
 
 let access      = [ key access_re . spc. sto_to_spc . by+ . eol ]
 
@@ -133,18 +134,21 @@ let database_re = "suffix"
                 | "restrict"
                 | "rootdn"
                 | "rootpw"
-                | "suffix"
                 | "subordinate"
                 | "syncrepl rid"
                 | "updatedn"
                 | "updateref"
                 | database_hdb
 
+let database_entry =
+     let val = Quote.double_opt
+  in Build.key_value_line database_re Sep.space val
+
 let database    = [ key "database"
                   . spc
                   . sto_to_eol
                   . eol
-                  . (comment|empty|Build.key_ws_value database_re|access)* ]
+                  . (comment|empty|database_entry|access)* ]
 
 (************************************************************************
  *                              LENS
diff --git a/lenses/smbusers.aug b/lenses/smbusers.aug
new file mode 100644 (file)
index 0000000..c9aed37
--- /dev/null
@@ -0,0 +1,34 @@
+(*
+Module: SmbUsers
+  Parses Samba username maps
+
+Author: Raphael Pinson <raphink@gmail.com>
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Examples
+   The <Test_SmbUsers> file contains various examples and tests.
+*)
+
+module SmbUsers =
+
+autoload xfm
+
+(* View: entry *)
+let entry =
+     let username = [ label "username" . store Rx.no_spaces ]
+  in let usernames = Build.opt_list username Sep.space
+  in Build.key_value_line Rx.word Sep.space_equal usernames
+
+(* View: lns *)
+let lns = (Util.empty | Util.comment | entry)*
+
+(* Variable: filter *)
+let filter = incl "/etc/samba/smbusers"
+           . incl "/etc/samba/usermap.txt"
+
+let xfm = transform lns filter
index e350314..bb528dc 100644 (file)
@@ -8,7 +8,7 @@ About: Reference
   This lens tries to keep as close as possible to `man 4 system` where possible.
 
 About: Licence
-  This file is licensed under the LGPLv2+, like the rest of Augeas.
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
 
 About: Lens Usage
 
@@ -105,6 +105,5 @@ let lns = ( empty
 
 (* Variable: filter *)
 let filter = (incl "/etc/system")
-    . Util.stdexcl
 
 let xfm = transform lns filter
index 45aa1a8..93181ea 100644 (file)
@@ -38,8 +38,6 @@ let entry     = [ key word
 
 let lns        = (comment|empty|entry) *
 
-let filter
-               = incl "/etc/somad/soma.cfg"
-               . Util.stdexcl
+let filter     = incl "/etc/somad/soma.cfg"
 
 let xfm        = transform lns filter
index fd7f4e0..081251d 100644 (file)
@@ -33,8 +33,7 @@ let lns = (comment|empty|entry)*
 let simple_lns = lns    (* An alias for compatibility reasons *)
 
 (* configuration files that can be parsed without customizing the lens *)
-let filter = Util.stdexcl
-           . incl "/etc/havp/havp.config"
+let filter = incl "/etc/havp/havp.config"
            . incl "/etc/ldap.conf"
            . incl "/etc/ldap/ldap.conf"
            . incl "/etc/libnss-ldap.conf"
diff --git a/lenses/splunk.aug b/lenses/splunk.aug
new file mode 100644 (file)
index 0000000..03fbff1
--- /dev/null
@@ -0,0 +1,41 @@
+(*
+Module: Splunk
+  Parses /opt/splunk/etc/*
+
+Author: Tim Brigham
+
+About: Reference
+  http://docs.splunk.com/Documentation/Splunk/5.0.2/Admin/AboutConfigurationFiles
+
+About: License
+   This file is licenced under the LGPL v2+
+
+About: Lens Usage
+   Works like IniFile lens, with anonymous section for entries without enclosing section.
+
+About: Configuration files
+   This lens applies to conf files under /opt/splunk/etc See <filter>.
+
+About: Examples
+   The <Test_Splunk> file contains various examples and tests.
+*)
+
+module Splunk =
+  autoload xfm
+
+  let comment   = IniFile.comment IniFile.comment_re IniFile.comment_default
+  let sep       = IniFile.sep IniFile.sep_re IniFile.sep_default
+  let empty     = IniFile.empty
+
+  let setting   = IniFile.entry_re
+  let title     =  IniFile.indented_title_label "target" IniFile.record_label_re
+  let entry     = [ key IniFile.entry_re . sep . IniFile.sto_to_eol? . IniFile.eol ] | comment
+
+
+  let record    = IniFile.record title entry
+  let anon      = [ label ".anon" . (entry|empty)+ ]
+  let lns       = anon . (record)* | (record)*
+
+  let filter    = incl "/opt/splunk/etc/system/local/*.conf"
+                . incl "/opt/splunk/etc/apps/*/local/*.conf"
+  let xfm       = transform lns filter
index dd903ba..aacf787 100644 (file)
@@ -432,7 +432,7 @@ let extension_methods = indent . [ key "extension_methods" . spc
 
 let lns         = (comment|empty|entry|auth|acl|http_access|refresh_pattern|extension_methods)*
 
-let filter      = Util.stdexcl
-                . incl "/etc/squid/squid.conf"
+let filter      = incl "/etc/squid/squid.conf"
+                . incl "/etc/squid3/squid.conf"
 
 let xfm         = transform lns filter
index 7f24772..d09f529 100644 (file)
@@ -13,65 +13,86 @@ About: License
 About: Lens Usage
   Sample usage of this lens in augtool
 
+(start code)
 augtool> set /files/etc/ssh/ssh_config/Host example.com
 augtool> set /files/etc/ssh/ssh_config/Host[.='example.com']/RemoteForward/machine1:1234 machine2:5678
 augtool> set /files/etc/ssh/ssh_config/Host[.='example.com']/Ciphers/1 aes128-ctr
 augtool> set /files/etc/ssh/ssh_config/Host[.='example.com']/Ciphers/2 aes192-ctr
+(end code)
 
 *)
 
 module Ssh =
     autoload xfm
 
-    let eol = del /[ \t]*\n/ "\n"
-    let spc = Util.del_ws_spc
+(************************************************************************
+ * Group:                 USEFUL PRIMITIVES
+ *************************************************************************)
 
-    let key_re = /[A-Za-z0-9]+/
-               - /SendEnv|Host|ProxyCommand|RemoteForward|LocalForward|MACs|Ciphers/
+    let eol = Util.doseol
+    let spc = Util.del_ws_spc
 
     let comment = Util.comment
     let empty = Util.empty
     let comma = Util.del_str ","
     let indent = Util.indent
-    let value_to_eol = store /([^ \t\n].*[^ \t\n]|[^ \t\n])/
-    let value_to_spc = store /[^ \t\n]+/
-    let value_to_comma = store /[^, \t\n]+/
+    let value_to_eol = store Rx.space_in
+    let value_to_spc = store Rx.no_spaces
+    let value_to_comma = store /[^, \t\r\n]+/
+
+
+(************************************************************************
+ * Group:                 ENTRIES
+ *************************************************************************)
+
+    let array_entry (k:regexp) =
+        [ indent . key k . counter "array_entry"
+         . [ spc . seq "array_entry" . value_to_spc]* . eol ]
 
-    let array_entry (k:string) =
-        [ indent . key k . counter k . [ spc . seq k . value_to_spc]* . eol ]
+    let commas_entry (k:regexp) =
+         let value = [ seq "commas_entry" . value_to_comma]
+      in [ key k . counter "commas_entry" . spc .
+           Build.opt_list value comma . eol ]
 
-    let commas_entry (k:string) =
-       [ key k . counter k . spc .
-           [ seq k . value_to_comma] . ([ seq k . comma . value_to_comma])* . eol ]
+    let fw_entry (k:regexp) = [ indent . key k . spc .
+           [ key /[^ \t\r\n\/]+/ . spc . value_to_eol . eol ]]
 
-    let send_env = array_entry "SendEnv"
+    let send_env = array_entry /SendEnv/i
 
-    let proxy_command = [ indent . key "ProxyCommand" . spc . value_to_eol . eol ]
+    let proxy_command = [ indent . key /ProxyCommand/i . spc . value_to_eol . eol ]
+
+    let remote_fw = fw_entry /RemoteForward/i
+    let local_fw = fw_entry /LocalForward/i
+
+    let ciphers = commas_entry /Ciphers/i
+    let macs   = commas_entry /MACs/i
+
+    let special_entry = send_env
+                           | proxy_command
+                           | remote_fw
+                           | local_fw
+                           | macs
+                           | ciphers
+
+    let key_re = /[A-Za-z0-9]+/
+               - /SendEnv|Host|ProxyCommand|RemoteForward|LocalForward|MACs|Ciphers/i
 
-    let fw_entry (k:string) = [ indent . key k . spc .
-       [ key /[^ \t\n\/]+/ . spc . value_to_eol . eol ]]
 
-    let remote_fw = fw_entry "RemoteForward"
-    let local_fw = fw_entry "LocalForward"
+    let other_entry = [ indent . key key_re
+                    . spc . value_to_spc . eol ]
 
-    let ciphers = commas_entry "Ciphers"
-    let macs   = commas_entry "MACs"
+    let entry = comment | empty
+              | special_entry
+                   | other_entry
 
-    let other_entry =
-       [ indent . key key_re . spc . value_to_spc . eol ]
+    let host = [ key /Host/i . spc . value_to_eol . eol . entry* ]
 
-    let entry = (comment | empty
-       | send_env
-       | proxy_command
-       | remote_fw
-       | local_fw
-       | macs
-       | ciphers
-       | other_entry)
 
-    let host = [ key "Host" . spc . value_to_eol . eol . entry* ]
+(************************************************************************
+ * Group:                 LENS
+ *************************************************************************)
 
     let lns = entry* . host*
 
     let xfm = transform lns (incl "/etc/ssh/ssh_config" .
-                             incl "~/.ssh/config")
+                             incl (Sys.getenv("HOME") . "/.ssh/config"))
index 8a3973b..55f6c4f 100644 (file)
@@ -70,41 +70,55 @@ module Sshd =
 
    let sep = Util.del_ws_spc
 
+   let indent = del /[ \t]*/ "  "
+
    let key_re = /[A-Za-z0-9]+/
-         - /MACs|Match|AcceptEnv|Subsystem|(Allow|Deny)(Groups|Users)/
+         - /MACs|Match|AcceptEnv|Subsystem|Ciphers|KexAlgorithms|(Allow|Deny)(Groups|Users)/i
 
    let comment = Util.comment
+   let comment_noindent = Util.comment_noindent
    let empty = Util.empty
 
-   let array_entry (k:string) =
+   let array_entry (kw:regexp) (sq:string) =
      let value = store /[^ \t\n]+/ in
-     [ key k . [ sep . seq k . value]* . eol ]
+     [ key kw . [ sep . seq sq . value]* . eol ]
 
    let other_entry =
      let value = store /[^ \t\n]+([ \t]+[^ \t\n]+)*/ in
      [ key key_re . sep . value . eol ]
 
-   let accept_env = array_entry "AcceptEnv"
+   let accept_env = array_entry /AcceptEnv/i "AcceptEnv"
 
-   let allow_groups = array_entry "AllowGroups"
-   let allow_users = array_entry "AllowUsers"
-   let deny_groups = array_entry "DenyGroups"
-   let deny_users = array_entry "DenyUsers"
+   let allow_groups = array_entry /AllowGroups/i "AllowGroups"
+   let allow_users = array_entry /AllowUsers/i "AllowUsers"
+   let deny_groups = array_entry /DenyGroups/i "DenyGroups"
+   let deny_users = array_entry /DenyUsers/i "DenyUsers"
 
    let subsystemvalue =
      let value = store (/[^ \t\n](.*[^ \t\n])?/) in
-     [ key /[A-Za-z0-9]+/ . sep . value . eol ]
+     [ key /[A-Za-z0-9\-]+/ . sep . value . eol ]
 
    let subsystem =
-     [ key "Subsystem" .  sep .  subsystemvalue ]
+     [ key /Subsystem/i .  sep .  subsystemvalue ]
 
-   let macs =
-     let mac_value = store /[^, \t\n]+/ in
-     [ key "MACs" . sep .
-         [ seq "macs" . mac_value ] .
-         ([ seq "macs" . Util.del_str "," . mac_value])* .
+   let list (kw:regexp) (sq:string) =
+     let value = store /[^, \t\n]+/ in
+     [ key kw . sep .
+         [ seq sq . value ] .
+         ([ seq sq . Util.del_str "," . value])* .
          eol ]
 
+   let macs = list /MACs/i "MACs"
+
+   let ciphers = list /Ciphers/i "Ciphers"
+
+   let kexalgorithms = list /KexAlgorithms/i "KexAlgorithms"
+
+   let entry = accept_env | allow_groups | allow_users
+             | deny_groups | subsystem | deny_users
+             | macs | ciphers | kexalgorithms
+             | other_entry
+
    let condition_entry =
     let value = store  /[^ \t\n]+/ in
     [ sep . key /[A-Za-z0-9]+/ . sep . value ]
@@ -112,17 +126,15 @@ module Sshd =
    let match_cond =
      [ label "Condition" . condition_entry+ . eol ]
 
-   let match_entry =
-     ( comment | empty | (Util.indent . other_entry) )
+   let match_entry = indent . (entry | comment_noindent)
+                   | empty 
 
    let match =
-     [ key "Match" . match_cond
+     [ key /Match/i . match_cond
         . [ label "Settings" .  match_entry+ ]
      ]
 
-  let lns = (comment | empty | accept_env | allow_groups | allow_users
-          | deny_groups | subsystem | deny_users | macs
-          | other_entry ) * . match*
+  let lns = (entry | comment | empty)* . match* 
 
   let xfm = transform lns (incl "/etc/ssh/sshd_config")
 
diff --git a/lenses/sssd.aug b/lenses/sssd.aug
new file mode 100644 (file)
index 0000000..d854554
--- /dev/null
@@ -0,0 +1,39 @@
+(* 
+Module Sssd  
+  Lens for parsing sssd.conf
+
+Author: Erinn Looney-Triggs <erinn.looneytriggs@gmail.com>
+
+About: License
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
+
+About: Configuration files
+   This lens applies to /etc/sssd/sssd.conf. See <filter>.
+*)
+
+module Sssd =
+  autoload xfm
+
+let comment  = IniFile.comment /[#;]/ "#"
+
+let sep      = IniFile.sep "=" "="
+
+let entry    = IniFile.indented_entry IniFile.entry_re sep comment
+
+(* View: title
+    An sssd.conf section title *)
+let title   = IniFile.indented_title_label "target" IniFile.record_label_re
+
+(* View: record
+    An sssd.conf record *)
+let record  = IniFile.record title entry
+
+(* View: lns 
+    The sssd.conf lens *)
+let lns    = ( comment | IniFile.empty )* . (record)* 
+
+(* View: filter *)
+let filter = (incl "/etc/sssd/sssd.conf")
+
+let xfm = transform lns filter
+
index 96729a7..59a816a 100644 (file)
@@ -76,6 +76,5 @@ module Stunnel =
     let lns     = rc_anon? . record*
 
     let filter  = (incl "/etc/stunnel/stunnel.conf")
-                . Util.stdexcl
 
     let xfm     = transform lns filter
diff --git a/lenses/subversion.aug b/lenses/subversion.aug
new file mode 100644 (file)
index 0000000..57d4393
--- /dev/null
@@ -0,0 +1,96 @@
+(*
+Module: Subversion
+  Parses subversion's INI files
+
+Authors:
+   Marc Fournier <marc.fournier@camptocamp.com>
+   Raphael Pinson <raphael.pinson@camptocamp.com>
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Examples
+   The <Test_Subversion> file contains various examples and tests.
+
+*)
+
+module Subversion =
+autoload xfm
+
+(************************************************************************
+ * Group: INI File settings
+ *
+ * subversion only supports comments starting with "#"
+ *
+ *************************************************************************)
+
+(* View: comment *)
+let comment  = IniFile.comment_noindent "#" "#"
+
+(* View: empty
+     An empty line or a non-indented empty comment *)
+let empty = IniFile.empty_noindent
+
+(* View: sep *)
+let sep      = IniFile.sep IniFile.sep_default IniFile.sep_default
+
+(************************************************************************
+ * Group:                  ENTRY
+ *
+ * subversion doesn't support indented entries
+ *
+ *************************************************************************)
+
+(* Variable: comma_list_re *)
+let comma_list_re = "password-stores"
+
+(* Variable: space_list_re *)
+let space_list_re = "global-ignores" | "preserved-conflict-file-exts"
+
+(* Variable: std_re *)
+let std_re = /[^ \t\r\n\/=#]+/ - (comma_list_re | space_list_re)
+
+(* View: entry_std
+    A standard entry
+    Similar to a <IniFile.entry_multiline_nocomment> entry,
+    but allows ';' *)
+let entry_std =
+  IniFile.entry_multiline_generic (key std_re) sep "#" comment IniFile.eol
+
+(* View: entry *)
+let entry    =
+     let comma_list_re = "password-stores"
+  in let space_list_re = "global-ignores" | "preserved-conflict-file-exts"
+  in let std_re = /[^ \t\r\n\/=#]+/ - (comma_list_re | space_list_re)
+  in entry_std
+   | IniFile.entry_list_nocomment comma_list_re sep Rx.word Sep.comma
+   | IniFile.entry_list_nocomment space_list_re sep Rx.no_spaces (del /(\r?\n)?[ \t]+/ " ")
+
+
+
+(************************************************************************
+ * Group:                    TITLE
+ *
+ * subversion doesn't allow anonymous entries (outside sections)
+ *
+ *************************************************************************)
+
+(* View: title *)
+let title    = IniFile.title IniFile.entry_re
+
+(* View: record
+     Use the non-indented <empty> *)
+let record   = IniFile.record_noempty title (entry|empty)
+
+(************************************************************************
+ * Group:                   LENS & FILTER
+ *************************************************************************)
+
+(* View: lns *)
+let lns      = IniFile.lns record comment
+
+(* Variable: filter *)
+let filter   = incl "/etc/subversion/config"
+             . incl "/etc/subversion/servers"
+
+let xfm      = transform lns filter
index b381cb6..53516f6 100644 (file)
@@ -21,7 +21,7 @@ The definitions from `man sudoers` are put as commentaries for reference
 throughout the file. More information can be found in the manual.
 
 About: License
-  This file is licensed under the LGPLv2+, like the rest of Augeas.
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
 
 
 About: Lens Usage
@@ -49,31 +49,35 @@ module Sudoers =
 
 (* Group: Generic primitives *)
 (* Variable: eol *)
-let eol       = del /[ \t]*\n/ "\n"
+let eol       = Util.eol
 
 (* Variable: indent *)
-let indent    = del /[ \t]*/ ""
+let indent    = Util.indent
 
 
 (* Group: Separators *)
 
 (* Variable: sep_spc *)
-let sep_spc  = del /[ \t]+/ " "
+let sep_spc  = Sep.space
 
 (* Variable: sep_cont *)
-let sep_cont = del /([ \t]+|[ \t]*\\\\\n[ \t]*)/ " "
+let sep_cont = Sep.cl_or_space
 
 (* Variable: sep_cont_opt *)
-let sep_cont_opt = del /([ \t]*|[ \t]*\\\\\n[ \t]*)/ " "
+let sep_cont_opt = Sep.cl_or_opt_space
+
+(* Variable: sep_cont_opt_build *)
+let sep_cont_opt_build (sep:string) =
+   del (Rx.cl_or_opt_space . sep . Rx.cl_or_opt_space) (" " . sep . " ")
 
 (* Variable: sep_com *)
-let sep_com  = sep_cont_opt . Util.del_str "," . sep_cont_opt
+let sep_com = sep_cont_opt_build ","
 
 (* Variable: sep_eq *)
-let sep_eq   = sep_cont_opt . Util.del_str "=" . sep_cont_opt
+let sep_eq   = sep_cont_opt_build "="
 
 (* Variable: sep_col *)
-let sep_col  = sep_cont_opt . Util.del_str ":" . sep_cont_opt
+let sep_col  = sep_cont_opt_build ":"
 
 (* Variable: sep_dquote *)
 let sep_dquote   = Util.del_str "\""
@@ -83,7 +87,10 @@ let sep_dquote   = Util.del_str "\""
 
 (* Variable: sto_to_com_cmnd
 sto_to_com_cmnd does not begin or end with a space *)
-let sto_to_com_cmnd = store /([^,=:#() \t\n\\]([^,=:#()\n\\]|\\\\[=:,\\])*[^,=:#() \t\n\\])|[^,=:#() \t\n\\]/
+let sto_to_com_cmnd =
+      let alias = Rx.word - /(NO)?(PASSWD|EXEC|SETENV)/
+   in let non_alias = /(!?[\/a-z]([^,:#()\n\\]|\\\\[=:,\\])*[^,=:#() \t\n\\])|[^,=:#() \t\n\\]/
+   in store (alias | non_alias)
 
 (* Variable: sto_to_com
 
@@ -95,12 +102,24 @@ let sto_to_com_host = store /[^,=:#() \t\n\\]+/
 
 
 (* Variable: sto_to_com_user
-Escaped spaces are allowed *)
-let sto_to_com_user = store ( /([^,=:#() \t\n]([^,=:#() \t\n]|(\\\\[ \t]))*[^,=:#() \t\n])|[^,=:#() \t\n]/
-                              - /(User|Runas|Host|Cmnd)_Alias|Defaults.*/ )
+Escaped spaces and NIS domains and allowed*)
+let sto_to_com_user =
+      let nis_re = /([A-Z]([-A-Z0-9]|(\\\\[ \t]))*+\\\\\\\\)/
+   in let user_re = /[%+@a-z]([-A-Za-z0-9._]|(\\\\[ \t]))*/
+   in let alias_re = /[A-Z_]+/
+   in store ((nis_re? . user_re) | alias_re)
+
+(* Variable: to_com_chars *)
+let to_com_chars        = /[^",=#() \t\n\\]+/ (* " relax emacs *)
+
+(* Variable: to_com_dquot *)
+let to_com_dquot        = /"[^",=#()\n\\]+"/ (* " relax emacs *)
+
+(* Variable: sto_to_com_dquot *)
+let sto_to_com_dquot    = store (to_com_chars|to_com_dquot)
 
 (* Variable: sto_to_com_col *)
-let sto_to_com_col      = store /[^",=#() \t\n\\]+/ (* " relax emacs *)
+let sto_to_com_col      = store to_com_chars
 
 (* Variable: sto_to_eq *)
 let sto_to_eq  = store /[^,=:#() \t\n\\]+/
@@ -163,7 +182,7 @@ let alias_field (kw:string) (sto:lens) = [ label kw . sto ]
 (* View: alias_list
      List of <alias_fields>, separated by commas *)
 let alias_list  (kw:string) (sto:lens) =
-  alias_field kw sto . ( sep_com . alias_field kw sto )*
+  Build.opt_list (alias_field kw sto) sep_com
 
 (************************************************************************
  * View: alias_name
@@ -244,10 +263,11 @@ let alias = user_alias | runas_alias | host_alias | cmnd_alias
  *     > Default_Type ::= 'Defaults' |
  *     >                  'Defaults' '@' Host_List |
  *     >                  'Defaults' ':' User_List |
+ *     >                  'Defaults' '!' Cmnd_List |
  *     >                  'Defaults' '>' Runas_List
  *************************************************************************)
 let default_type     =
-  let value = store /[@:>][^ \t\n\\]+/ in
+  let value = store /[@:!>][^ \t\n\\]+/ in
   [ label "type" . value ]
 
 (************************************************************************
@@ -327,20 +347,17 @@ let parameter_string_nobool_kw = "badpass_message" | "editor" | "mailsub"
                                | "timestampdir" | "timestampowner" | "secure_path"
 
 let parameter_string_nobool    = [ key parameter_string_nobool_kw . sep_eq
-                                     . del /"?/ "" . sto_to_com_col
-                                     . del /"?/ "" ]
+                                     . sto_to_com_dquot ]
 
 let parameter_string_bool_kw   = "exempt_group" | "lecture" | "lecture_file"
                                | "listpw" | "logfile" | "mailerflags"
-                               | "mailerpath" | "mailto" | "exempt_group"
-                               | "syslog" | "verifypw" | "logfile"
-                               | "mailerflags" | "mailerpath" | "mailto"
+                               | "mailerpath" | "mailto" | "mailfrom" 
                                | "syslog" | "verifypw"
 
 let parameter_string_bool      =
   negate_or_value
     (key parameter_string_bool_kw)
-    (sep_eq . sto_to_com_col)
+    (sep_eq . sto_to_com_dquot)
 
 let parameter_string           = parameter_string_nobool
                                | parameter_string_bool
@@ -472,7 +489,7 @@ let cmnd_spec  =
  *     > Cmnd_Spec_List ::= Cmnd_Spec |
  *     >                    Cmnd_Spec ',' Cmnd_Spec_List
  *************************************************************************)
-let cmnd_spec_list = cmnd_spec . ( sep_com . cmnd_spec )*
+let cmnd_spec_list = Build.opt_list cmnd_spec sep_com
 
 
 (************************************************************************
@@ -492,8 +509,8 @@ let spec_list = [ label "host_group" . alias_list "host" sto_to_com_host
  *************************************************************************)
 let spec = [ label "spec" . indent
                . alias_list "user" sto_to_com_user . sep_cont
-               . spec_list
-               . ( sep_col . spec_list )* . comment_or_eol ]
+               . Build.opt_list spec_list sep_col
+               . comment_or_eol ]
 
 
 (************************************************************************
index 2c7efaa..8c505b3 100644 (file)
@@ -4,51 +4,63 @@
 (* around values that need them                                        *)
 (* To keep things simple, we also do not support shell variable arrays *)
 module Sysconfig =
-  let eol = Util.eol
 
-  let key_re = /[A-Za-z0-9_]+(\[[0-9]+\])?/ - "unset" - "export"
+  let eol = Shellvars.eol
+  let semicol_eol = Shellvars.semicol_eol
+
+  let key_re = Shellvars.key_re
   let eq = Util.del_str "="
-  let comment = Util.comment
-  let empty   = Util.empty
-  let xchgs   = Build.xchgs
-  let dels    = Util.del_str
 
-  let nothing = del /(""|'')?/ "" . value ""
+  let eol_for_comment = del /([ \t]*\n)([ \t]*(#[ \t]*)?\n)*/ "\n"
+  let comment = Util.comment_generic_seteol /[ \t]*#[ \t]*/ "# " eol_for_comment
+  let comment_or_eol = Shellvars.comment_or_eol
+
+  let empty   = Util.empty
 
-  (* Chars allowed in a bare string *)
-  let bchar = /[^ \t\n"'\\]|\\\\./
-  let qchar = /["']/  (* " *)
+  let bchar = /[^; \t\n"'\\]|\\\\./ (* " Emacs, relax *)
+  let qchar = /["']/  (* " Emacs, relax *)
 
   (* We split the handling of right hand sides into a few cases:
    *   bare  - strings that contain no spaces, optionally enclosed in
    *           single or double quotes
+   *   quot  - strings that must be enclosed in single or double quotes
    *   dquot - strings that contain at least one space or apostrophe,
    *           which must be enclosed in double quotes
    *   squot - strings that contain an unescaped double quote
    *)
-  let bare = del qchar? "" . store (bchar+) . del qchar? ""
+  let bare = Quote.do_quote_opt (store bchar+)
+
+  let quot =
+    let word = bchar* . /[; \t]/ . bchar* in
+    Quote.do_quote (store word+)
+
   let dquot =
-    del qchar "\"" . store (bchar* . /[ \t']/ . bchar*)+ . del qchar "\""
+    let char = /[^"\\]|\\\\./ in             (* " *)
+    let word = char* . "'" . char* in
+    Quote.do_dquote (store word+)
+
   let squot =
-    dels "'" . store ((bchar|/[ \t]/)* . "\"" . (bchar|/[ \t]/)*)+ . dels "'"
+    (* We do not allow escaped double quotes in single quoted strings, as  *)
+    (* that leads to a put ambiguity with bare, e.g. for the string '\"'.  *)
+    let char = /[^'\\]|\\\\[^"]/ in           (* " *)
+    let word = char* . "\"" . char* in
+    Quote.do_squote (store word+)
+
+  let export = Shellvars.export
+  let kv (value:lens) = [ export? . key key_re . eq . value . comment_or_eol ]
 
-  let export = [ key "export" . Util.del_ws_spc ]
-  let kv (value:lens) = [ export? . key key_re . eq . value . eol ]
-  let assign = kv nothing | kv bare | kv dquot | kv squot
+  let assign =
+    let nothing = del /(""|'')?/ "" . value "" in
+    kv nothing | kv bare | kv quot | kv dquot | kv squot
 
-  let var_action (name:string) =
-    [ xchgs name ("@" . name) . Util.del_ws_spc . store key_re . eol ]
+  let var_action = Shellvars.var_action
 
-  let unset = var_action "unset"
-  let bare_export = var_action "export"
+  let unset = [ var_action "unset" . comment_or_eol ]
+  let bare_export = [ var_action "export" . comment_or_eol ]
 
-  let source =
-    [
-      del /\.|source/ "." . label ".source" .
-      Util.del_ws_spc . store /[^= \t\n]+/ . eol
-    ]
+  let source = [ Shellvars.source . comment_or_eol ]
 
-  let lns = (comment | empty | source | assign | unset | bare_export) *
+  let lns = empty* . (comment | source | assign | unset | bare_export)*
 
 (*
   Examples:
diff --git a/lenses/sysconfig_route.aug b/lenses/sysconfig_route.aug
new file mode 100644 (file)
index 0000000..d3222e8
--- /dev/null
@@ -0,0 +1,78 @@
+(*
+Module: Sysconfig_Route
+  Parses /etc/sysconfig/network-scripts/route-${device}
+
+Author: Stephen P. Schaefer
+
+About: Reference
+    This lens allows manipulation of *one* IPv4 variant of the
+/etc/sysconfig/network-scripts/route-${device} script found in RHEL5+, CentOS5+
+and Fedora.
+
+    The variant handled consists of lines like
+    "destination_subnet/cidr via router_ip", e.g.,
+    "10.132.11.0/24 via 10.10.2.1"
+    
+    There are other variants; if you use them, please enhance this lens.
+    
+    The natural key would be "10.132.11.0/24" with value "10.10.2.1", but since
+    augeas cannot deal with slashes in the key value, I reverse them, so that the
+    key is "10.10.2.1[1]" (and "10.10.2.1[2]"... if multiple subnets are reachable
+    via that router).
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+  Sample usage of this lens in augtool
+
+    * Set the first subnet reachable by a router reachable on the eth0 subnet
+      > set /files/etc/sysconfig/network-scripts/route-eth0/10.10.2.1[1] 172.16.254.0/24
+    * List all the subnets reachable by a router reachable on eth0 subnet
+      > match /files/etc/sysconfig/network-scripts/route-eth0/10.10.2.1
+
+About: Configuration files
+  This lens applies to /etc/sysconfig/network-scripts/route-*
+
+About: Examples
+  The <Test_Sysconfig_Route> file contains various examples and tests.
+*)
+
+module Sysconfig_Route =
+       autoload xfm
+
+(******************************************************************************
+ * Group:                        USEFUL PRIMITIVES
+ ******************************************************************************)
+
+(* Variable: router
+   A router *)
+let router = Rx.ipv4
+(* Variable: cidr
+   A subnet mask can be 0 to 32 bits *)
+let cidr = /(3[012]|[12][0-9]|[0-9])/
+(* Variable: subnet
+   Subnet specification *)
+let subnet = Rx.ipv4 . "/" . cidr
+
+(******************************************************************************
+ * Group:                        ENTRY TYPES
+ ******************************************************************************)
+
+(* View: entry
+   One route *)
+let entry = [ store subnet . del /[ \t]*via[ \t]*/ " via "
+            . key router . Util.del_str "\n" ]
+
+(******************************************************************************
+ * Group:                        LENS AND FILTER
+ ******************************************************************************)
+
+(* View: lns *)
+let lns = entry+
+
+(* View: filter *)
+let filter = incl "/etc/sysconfig/network-scripts/route-*"
+          . Util.stdexcl
+
+let xfm = transform lns filter
index 5b33f65..cd98b53 100644 (file)
@@ -1,21 +1,39 @@
-module Sysctl =
-  autoload xfm
+(*
+Module: Sysctl
+  Parses /etc/sysctl.conf and /etc/sysctl.d/*
+
+Author: David Lutterkort <lutter@redhat.com>
+
+About: Reference
 
-  let filter = incl "/etc/sysctl.conf"
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
 
-  let eol = Util.eol
-  let indent = Util.indent
-  let key_re = /[A-Za-z0-9_.-]+/
-  let eq = del /[ \t]*=[ \t]*/ " = "
-  let value_re = /[^ \t\n](.*[^ \t\n])?/
+About: Lens Usage
+   To be documented
 
-  let comment = [ indent . label "#comment" . del /[#;][ \t]*/ "# "
-        . store /([^ \t\n].*[^ \t\n]|[^ \t\n])/ . eol ]
+About: Configuration files
+   This lens applies to /etc/sysctl.conf and /etc/sysctl.d/*. See <filter>.
+
+About: Examples
+   The <Test_Sysctl> file contains various examples and tests.
+*)
+
+module Sysctl =
+autoload xfm
 
-  let empty = Util.empty
+(* Variable: filter *)
+let filter = incl "/etc/sysctl.conf"
+           . incl "/etc/sysctl.d/*"
+           . excl "/etc/sysctl.d/README"
+           . excl "/etc/sysctl.d/README.sysctl"
+           . Util.stdexcl
 
-  let kv = [ indent . key key_re . eq . store value_re . eol ]
+(* View: comment *)
+let comment = Util.comment_generic /[ \t]*[#;][ \t]*/ "# "
 
-  let lns = (empty | comment | kv) *
+(* View: lns
+     The sysctl lens *)
+let lns = (Util.empty | comment | Simplevars.entry)*
 
-  let xfm = transform lns filter
+let xfm = transform lns filter
index cda17bb..f8b99c4 100644 (file)
@@ -40,10 +40,17 @@ module Syslog =
 
        (* View: comment
          Map comments into "#comment" nodes
-         Can't use Util.comment as #+ and #! have a special meaning *)
+         Can't use Util.comment as #+ and #! have a special meaning.
+      However, '# !' and '# +' have no special meaning so they should be allowed.
+     *)
+
+       let comment_gen (space:regexp) (sto:regexp) =
+          [ label "#comment" . del ("#" . space) "# " . store sto . eol ]
+
        let comment =
-         [ label "#comment" . del /#[ \t]*/ "# "
-             . store /([^ \t\n+!-].*[^ \t\n]|[^ \t\n+!-])/ . eol ]
+               let comment_withsign = comment_gen Rx.space /([!+-].*[^ \t\n]|[!+-])/
+        in let comment_nosign = comment_gen Rx.opt_space /([^ \t\n+!-].*[^ \t\n]|[^ \t\n+!-])/
+        in comment_withsign | comment_nosign
 
        (* Group: single characters macro *)
 
@@ -59,10 +66,6 @@ module Syslog =
         Deletes a semicolon and default to it
         *)
        let semicolon  = sep_tab_opt . Util.del_str ";" . sep_tab_opt
-       (* Variable: at
-        Deletes a at and default to it
-        *)
-       let at         = Util.del_str "@"
        (* Variable: dot
         Deletes a dot and default to it
         *)
@@ -101,20 +104,27 @@ module Syslog =
          *)
         let comparison = /(!|[<=>]+|![<=>]+)/
 
+       (* Variable: protocol
+         @ means UDP
+    @@ means TCP
+         *)
+        let protocol      = /@{1,2}/
+
        (* Variable: token
          alphanum or "*"
          *)
-        let token      = /([a-z0-9]+|\*)/
+        let token      = /([A-Za-z0-9]+|\*)/
 
        (* Variable: file_r
         a file begins with a / and get almost anything else after
         *)
-       let file_r     = /\/[^ \t\n]+/
+       let file_r     = /\/[^ \t\n;]+/
 
        (* Variable: loghost_r
         Matches a hostname, that is labels speparated by dots, labels can't
         start or end with a "-".  maybe a bit too complicated for what it's worth *)
-       let loghost_r = /[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*/
+       let loghost_r = /[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*/ |
+                    "[" . Rx.ipv6 . "]"
 
        (* Group: Function *)
 
@@ -175,7 +185,7 @@ module Syslog =
        (* View: loghost
         a loghost is an @  sign followed by the hostname and a possible port
         *)
-       let loghost = at . [ label "hostname" . store loghost_r ] .
+       let loghost = [label "protocol" . store protocol] . [ label "hostname" . store loghost_r ] .
            (colon . [ label "port" . store /[0-9]+/ ] )?
 
        (* View: users
diff --git a/lenses/systemd.aug b/lenses/systemd.aug
new file mode 100644 (file)
index 0000000..ade70d5
--- /dev/null
@@ -0,0 +1,176 @@
+(*
+Module: Systemd
+  Parses systemd unit files.
+
+Author: Dominic Cleal <dcleal@redhat.com>
+
+About: Reference
+  This lens tries to keep as close as possible to systemd.unit(5) and
+  systemd.service(5) etc where possible.
+
+About: License
+  This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+  To be documented
+
+About: Configuration files
+  This lens applies to /lib/systemd/system/* and /etc/systemd/system/*.
+  See <filter>.
+*)
+
+module Systemd =
+autoload xfm
+
+(************************************************************************
+ * Group:                 USEFUL PRIMITIVES
+ *************************************************************************)
+
+(* View: eol *)
+let eol = Util.eol
+
+(* View: eol_comment
+   An <IniFile.comment> entry for standalone comment lines (; or #) *)
+let comment     = IniFile.comment IniFile.comment_re "#"
+
+(* View: eol_comment
+   An <IniFile.comment> entry for end of line comments (# only) *)
+let eol_comment = IniFile.comment "#" "#"
+
+(* View: sep
+   An <IniFile.sep> entry *)
+let sep        = IniFile.sep "=" "="
+
+(* Variable: entry_single_kw *)
+let entry_single_kw  = "Description"
+
+(* Variable: entry_command_kw *)
+let entry_command_kw = /Exec[A-Za-z][A-Za-z0-9._-]+/
+
+(* Variable: entry_env_kw *)
+let entry_env_kw     = "Environment"
+
+(* Variable: entry_multi_kw *)
+let entry_multi_kw   =
+     let forbidden = entry_single_kw | entry_command_kw | entry_env_kw
+  in /[A-Za-z][A-Za-z0-9._-]+/ - forbidden
+
+(* Variable: value_single_re *)
+let value_single_re  = /[^# \t\n\\][^#\n\\]*[^# \t\n\\]|[^# \t\n\\]/
+
+(* View: sto_value_single
+   Support multiline values with a backslash *)
+let sto_value_single = Util.del_opt_ws ""
+                       . store (value_single_re
+                                . (/\\\\\n/ . value_single_re)*)
+
+(* View: sto_value *)
+let sto_value = store /[^# \t\n]*[^# \t\n\\]/
+
+(* Variable: value_sep
+   Multi-value entries separated by whitespace or backslash and newline *)
+let value_sep = del /[ \t]+|[ \t]*\\\\[ \t]*\n[ \t]*/ " "
+
+(* Variable: value_cmd_re
+   Don't parse @ and - prefix flags *)
+let value_cmd_re = /[^#@ \t\n\\-][^#@ \t\n\\-][^# \t\n\\]*/
+
+(* Variable: env_key *)
+let env_key = /[A-Za-z0-9_]+(\[[0-9]+\])?/
+
+(************************************************************************
+ * Group:                 ENTRIES
+ *************************************************************************)
+
+(*
+Supported entry features, selected by key names:
+  * multi-value space separated attrs (the default)
+  * single-value attrs (Description)
+  * systemd.service: Exec* attrs with flags, command and arguments
+  * systemd.service: Environment NAME=arg
+*)
+
+(* View: entry_fn
+   Prototype for our various key=value lines, with optional comment *)
+let entry_fn (kw:regexp) (val:lens) =
+    [ key kw . sep . val . (eol_comment|eol) ]
+
+(* View: entry_value
+   Store a value that doesn't contain spaces *)
+let entry_value  = [ label "value" . sto_value ]
+
+(* View: entry_single
+   Entry that takes a single value containing spaces *)
+let entry_single = entry_fn entry_single_kw
+                     [ label "value" . sto_value_single ]?
+
+(* View: entry_command
+   Entry that takes a space separated set of values (the default) *)
+let entry_multi  = entry_fn entry_multi_kw
+                     ( Util.del_opt_ws ""
+                       . Build.opt_list entry_value value_sep )?
+
+(* View: entry_command_flags
+   Exec* flags "@" and "-".  Order is important, see systemd.service(8) *)
+let entry_command_flags =
+     let exit  = [ label "ignoreexit" . Util.del_str "-" ]
+  in let arg0  = [ label "arg0" . Util.del_str "@" ]
+  in exit? . arg0?
+
+(* View: entry_command
+   Entry that takes a command, arguments and the optional prefix flags *)
+let entry_command =
+     let cmd  = [ label "command" . store value_cmd_re ]
+  in let arg  = [ seq "args" . sto_value ]
+  in let args = [ counter "args" . label "arguments"
+                . (value_sep . arg)+ ]
+  in entry_fn entry_command_kw ( entry_command_flags . cmd . args? )?
+
+(* View: entry_env
+   Entry that takes a space separated set of ENV=value key/value pairs *)
+let entry_env =
+     let envkv (env_val:lens) = key env_key . Util.del_str "=" . env_val
+     (* bare has no spaces, and is optionally quoted *)
+  in let bare = Quote.do_quote_opt (envkv (store /[^#'" \t\n]*[^#'" \t\n\\]/)?)
+  in let bare_dqval = envkv (store /"[^#" \t\n]*[^#" \t\n\\]"/)
+  in let bare_sqval = envkv (store /'[^#' \t\n]*[^#' \t\n\\]'/)
+     (* quoted has at least one space, and must be quoted *)
+  in let quoted = Quote.do_quote (envkv (store /[^#"'\n]*[ \t]+[^#"'\n]*/))
+  in let envkv_quoted = [ bare ] | [ bare_dqval ] | [ bare_sqval ] | [ quoted ]
+  in entry_fn entry_env_kw ( Build.opt_list envkv_quoted value_sep )
+
+
+(************************************************************************
+ * Group:                 LENS
+ *************************************************************************)
+
+(* View: entry
+   An <IniFile.entry> *)
+let entry   = entry_single | entry_multi | entry_command | entry_env | comment
+
+(* View: include
+   Includes another file at this position *)
+let include = [ key ".include" . Util.del_ws_spc . sto_value
+                . (eol_comment|eol) ]
+
+(* View: title
+   An <IniFile.title> *)
+let title   = IniFile.title IniFile.record_re
+
+(* View: record
+   An <IniFile.record> *)
+let record = IniFile.record title (entry|include)
+
+(* View: lns
+   An <IniFile.lns> *)
+let lns    = IniFile.lns record (comment|include)
+
+(* View: filter *)
+let filter = incl "/lib/systemd/system/*"
+           . incl "/lib/systemd/system/*/*"
+           . incl "/etc/systemd/system/*"
+           . incl "/etc/systemd/system/*/*"
+           . incl "/etc/sysconfig/*.systemd"
+           . Util.stdexcl
+
+let xfm = transform lns filter
index fcb63df..2dcd8c8 100644 (file)
@@ -103,3 +103,18 @@ test Access.lns get "+ : @group@@domain : ALL \n" =
 test Access.lns put "+ : @group : ALL \n" after
   set "/access/netgroup[. = 'group']/nisdomain" "domain" =
 "+ : @group@@domain : ALL \n"
+
+(* Check DOMAIN\user style entry *)
+test Access.lns get "+ : root : foo1.bar.org foo3.bar.org
++ : (DOMAIN\linux_users) : ALL
++ : DOMAIN\linux_user : ALL\n" =
+  { "access" = "+"
+    { "user" = "root" }
+    { "origin" = "foo1.bar.org" }
+    { "origin" = "foo3.bar.org" } }
+  { "access" = "+"
+    { "group" = "DOMAIN\linux_users" }
+    { "origin" = "ALL" } }
+  { "access" = "+"
+    { "user" = "DOMAIN\linux_user" }
+    { "origin" = "ALL" } }
diff --git a/lenses/tests/test_activemq_conf.aug b/lenses/tests/test_activemq_conf.aug
new file mode 100644 (file)
index 0000000..8443e2f
--- /dev/null
@@ -0,0 +1,35 @@
+(*
+Module: Test_ActiveMQ_Conf
+  Provides unit tests and examples for the <ActiveMQ_Conf> lens.
+*)
+
+module Test_ActiveMQ_Conf =
+
+(* Variable: conf *)
+let conf = "
+ACTIVEMQ_HOME=/usr/share/activemq
+ACTIVEMQ_BASE=${ACTIVEMQ_HOME}
+"
+
+(* Variable: new_conf *) 
+let new_conf = "
+ACTIVEMQ_HOME=/usr/local/share/activemq
+ACTIVEMQ_BASE=${ACTIVEMQ_HOME}
+"
+
+let lns = ActiveMQ_Conf.lns 
+
+(* Test: ActiveMQ_Conf.lns  
+ * Get test against tree structure
+*)
+test lns get conf = 
+    { }
+    { "ACTIVEMQ_HOME" = "/usr/share/activemq" }
+    { "ACTIVEMQ_BASE" = "${ACTIVEMQ_HOME}" }
+
+(* Test: ActiveMQ_Conf.lns  
+ * Put test changing user to nobody
+*)
+test lns put conf after set "/ACTIVEMQ_HOME" "/usr/local/share/activemq" = new_conf
+
+(* vim: set ts=4  expandtab  sw=4: *)
diff --git a/lenses/tests/test_activemq_xml.aug b/lenses/tests/test_activemq_xml.aug
new file mode 100644 (file)
index 0000000..c31a5b6
--- /dev/null
@@ -0,0 +1,65 @@
+(*
+Module: Test_ActiveMQ_XML
+  Provides unit tests and examples for the <ActiveMQ_XML> lens.
+*)
+
+module Test_ActiveMQ_XML =
+
+(* Variable: conf *)
+let conf = "<beans>
+ <broker xmlns=\"http://activemq.apache.org/schema/core\" brokerName=\"localhost\" dataDirectory=\"${activemq.data}\">
+  <transportConnectors>
+   <transportConnector name=\"openwire\" uri=\"tcp://0.0.0.0:61616\"/>
+  </transportConnectors>
+ </broker>
+</beans>
+"
+
+(* Variable: new_conf *) 
+let new_conf = "<beans>
+ <broker xmlns=\"http://activemq.apache.org/schema/core\" brokerName=\"localhost\" dataDirectory=\"${activemq.data}\">
+  <transportConnectors>
+   <transportConnector name=\"openwire\" uri=\"tcp://127.0.0.1:61616\"/>
+  </transportConnectors>
+ </broker>
+</beans>
+"
+
+let lns = ActiveMQ_XML.lns 
+
+(* Test: ActiveMQ_XML.lns  
+ * Get test against tree structure
+*)
+test lns get conf = 
+  { "beans"
+    { "#text" = "
+ " }
+    { "broker"
+      { "#attribute"
+        { "xmlns" = "http://activemq.apache.org/schema/core" }
+        { "brokerName" = "localhost" }
+        { "dataDirectory" = "${activemq.data}" }
+      }
+      { "#text" = "
+  " }
+      { "transportConnectors"
+        { "#text" = "
+   " }
+        { "transportConnector" = "#empty"
+          { "#attribute"
+            { "name" = "openwire" }
+            { "uri" = "tcp://0.0.0.0:61616" }
+          }
+        }
+        { "#text" = "  " }
+      }
+      { "#text" = " " }
+    }
+  }
+
+(* Test: ActiveMQ_XML.lns  
+ * Put test changing transport connector to localhost
+*)
+test lns put conf after set "/beans/broker/transportConnectors/transportConnector/#attribute/uri" "tcp://127.0.0.1:61616" = new_conf
+
+(* vim: set ts=4  expandtab  sw=4: *)
index 9ab9240..6db14dd 100644 (file)
@@ -92,6 +92,20 @@ bin:         root , ruth,
         { "value" = "target1" }
         { "value" = "target2" } }
 
+  (* Test: Aliases.lns
+     Ticket #229: commands can be fully enclosed in quotes *)
+  test Aliases.lns get "somebody: \"|exit 67\"\n" =
+    { "1"
+        { "name" = "somebody" }
+        { "value" = "\"|exit 67\"" } }
+
+  (* Test: Aliases.lns
+     Don't have to have whitespace after the colon *)
+  test Aliases.lns get "alias:target\n" =
+    { "1"
+        { "name" = "alias" }
+        { "value" = "target" } }
+
 (* Local Variables: *)
 (* mode: caml       *)
 (* End:             *)
diff --git a/lenses/tests/test_anacron.aug b/lenses/tests/test_anacron.aug
new file mode 100644 (file)
index 0000000..9339855
--- /dev/null
@@ -0,0 +1,39 @@
+(*
+Module: Test_Anacron
+  Provides unit tests and examples for the <Anacron> lens.
+*)
+
+module Test_anacron =
+
+(* Variable: conf *)
+let conf = "# /etc/anacrontab: configuration file for anacron
+
+SHELL=/bin/sh
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+# These replace cron's entries
+1      5       cron.daily       nice run-parts --report /etc/cron.daily
+7      10      cron.weekly      nice run-parts --report /etc/cron.weekly
+@monthly       15      cron.monthly nice run-parts --report /etc/cron.monthly
+"
+
+(* Test: Anacron.lns *)
+test Anacron.lns get conf =
+  { "#comment" = "/etc/anacrontab: configuration file for anacron" }
+  { }
+  { "SHELL" = "/bin/sh" }
+  { "PATH" = "/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" }
+  { }
+  { "#comment" = "These replace cron's entries" }
+  { "entry" = "nice run-parts --report /etc/cron.daily"
+     { "period" = "1" }
+     { "delay" = "5" }
+     { "job-identifier" = "cron.daily" } }
+  { "entry" = "nice run-parts --report /etc/cron.weekly"
+     { "period" = "7" }
+     { "delay" = "10" }
+     { "job-identifier" = "cron.weekly" } }
+  { "entry" = "nice run-parts --report /etc/cron.monthly"
+     { "period_name" = "monthly" }
+     { "delay" = "15" }
+     { "job-identifier" = "cron.monthly" } }
diff --git a/lenses/tests/test_apt_update_manager.aug b/lenses/tests/test_apt_update_manager.aug
new file mode 100644 (file)
index 0000000..1921a95
--- /dev/null
@@ -0,0 +1,41 @@
+(*
+Module: Test_Apt_Update_Manager
+  Provides unit tests and examples for the <Apt_Update_Manager> lens.
+*)
+module Test_Apt_Update_Manager =
+
+(* Variable: meta_release *)
+let meta_release = "# default location for the meta-release file
+
+[METARELEASE]
+URI = http://changelogs.ubuntu.com/meta-release
+URI_LTS = http://changelogs.ubuntu.com/meta-release-lts
+URI_UNSTABLE_POSTFIX = -development
+URI_PROPOSED_POSTFIX = -proposed
+"
+
+(* Test: Apt_Update_Manager.lns *)
+test Apt_Update_Manager.lns get meta_release =
+  { "#comment" = "default location for the meta-release file" }
+  {  }
+  { "METARELEASE"
+    { "URI" = "http://changelogs.ubuntu.com/meta-release" }
+    { "URI_LTS" = "http://changelogs.ubuntu.com/meta-release-lts" }
+    { "URI_UNSTABLE_POSTFIX" = "-development" }
+    { "URI_PROPOSED_POSTFIX" = "-proposed" }
+  }
+
+(* Variable: release_upgrades *)
+let release_upgrades = "# Default behavior for the release upgrader.
+
+[DEFAULT]
+Prompt=lts
+"
+
+(* Test: Apt_Update_Manager.lns *)
+test Apt_Update_Manager.lns get release_upgrades =
+  { "#comment" = "Default behavior for the release upgrader." }
+  {  }
+  { "DEFAULT"
+    { "Prompt" = "lts" }
+  }
diff --git a/lenses/tests/test_aptcacherngsecurity.aug b/lenses/tests/test_aptcacherngsecurity.aug
new file mode 100644 (file)
index 0000000..a10d5d3
--- /dev/null
@@ -0,0 +1,34 @@
+(*  Test for AptCacherNGSecurity lens.
+
+About: License
+       Copyright 2013 Erik B. Andersen; this file is licenced under the LGPL v2+.
+
+*)
+module Test_AptCacherNGSecurity =
+       let conf = "
+# This file contains confidential data and should be protected with file
+# permissions from being read by untrusted users.
+#
+# NOTE: permissions are fixated with dpkg-statoverride on Debian systems.
+# Read its manual page for details.
+
+# Basic authentication with username and password, required to
+# visit pages with administrative functionality. Format: username:password
+
+AdminAuth: mooma:moopa
+"
+
+        test AptCacherNGSecurity.lns get conf =
+                       {}
+                       { "#comment" = "This file contains confidential data and should be protected with file" }
+                       { "#comment" = "permissions from being read by untrusted users." }
+                       {}
+                       { "#comment" = "NOTE: permissions are fixated with dpkg-statoverride on Debian systems." }
+                       { "#comment" = "Read its manual page for details." }
+                       {}
+                       { "#comment" = "Basic authentication with username and password, required to" }
+                       { "#comment" = "visit pages with administrative functionality. Format: username:password" }
+                       {}
+                       { "AdminAuth"
+                               { "mooma" = "moopa" }
+                       }
index 52eeffa..bf26348 100644 (file)
@@ -5,6 +5,7 @@ Package: *
 Pin: release a=backports
 Pin-Priority: 100
 
+# This is a comment
 Explanation: My packages are the most prioritary
 Package: *
 Pin: release l=Raphink, v=3.0
@@ -27,6 +28,7 @@ Pin-Priority: 700
               { "a" = "backports" } }
           { "Pin-Priority" = "100" } }
        { "2"
+          { "#comment"     = "This is a comment" }
           { "Explanation"  = "My packages are the most prioritary" }
           { "Package"      = "*" }
           { "Pin"          = "release"
@@ -51,7 +53,14 @@ Pin-Priority: 700
        set "/1/Pin" "version";
        set "/1/Pin/version" "1.2.3-4";
        set "/1/Pin-Priority" "2000"
-    = "Package: something-funny
+    = "
+Package: something-funny
 Pin: version 1.2.3-4
 Pin-Priority: 2000
 "
+
+(* Test: AptPreferences.pin
+     Spaces in origins are valid *)
+test AptPreferences.pin get "Pin: release o=Quantum GIS project\n" =
+  { "Pin" = "release"
+    { "o" = "Quantum GIS project" } }
diff --git a/lenses/tests/test_authorized_keys.aug b/lenses/tests/test_authorized_keys.aug
new file mode 100644 (file)
index 0000000..9935e57
--- /dev/null
@@ -0,0 +1,117 @@
+(*
+Module: Test_Authorized_Keys
+  Provides unit tests and examples for the <Authorized_Keys> lens.
+*)
+
+module Test_Authorized_Keys =
+
+(* Test: Authorized_Keys *)
+test Authorized_Keys.lns get "tunnel=\"0\",no-agent-forwarding,command=\"sh /etc/netstart tun0\",permitopen=\"192.0.2.1:80\",permitopen=\"192.0.2.2:25\" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA3RC8whKGFx+b7BMTFtnIWl6t/qyvOvnuqIrMNI9J8+1sEYv8Y/pJRh0vAe2RaSKAgB2hyzXwSJ1Fh+ooraUAJ+q7P2gg2kQF1nCFeGVjtV9m4ZrV5kZARcQMhp0Bp67tPo2TCtnthPYZS/YQG6u/6Aco1XZjPvuKujAQMGSgqNskhKBO9zfhhkAMIcKVryjKYHDfqbDUCCSNzlwFLts3nJ0Hfno6Hz+XxuBIfKOGjHfbzFyUQ7smYnzF23jFs4XhvnjmIGQJcZT4kQAsRwQubyuyDuqmQXqa+2SuQfkKTaPOlVqyuEWJdG2weIF8g3YP12czsBgNppz3jsnhEgstnQ== rpinson on rpinson\n" =
+  { "key" = "AAAAB3NzaC1yc2EAAAABIwAAAQEA3RC8whKGFx+b7BMTFtnIWl6t/qyvOvnuqIrMNI9J8+1sEYv8Y/pJRh0vAe2RaSKAgB2hyzXwSJ1Fh+ooraUAJ+q7P2gg2kQF1nCFeGVjtV9m4ZrV5kZARcQMhp0Bp67tPo2TCtnthPYZS/YQG6u/6Aco1XZjPvuKujAQMGSgqNskhKBO9zfhhkAMIcKVryjKYHDfqbDUCCSNzlwFLts3nJ0Hfno6Hz+XxuBIfKOGjHfbzFyUQ7smYnzF23jFs4XhvnjmIGQJcZT4kQAsRwQubyuyDuqmQXqa+2SuQfkKTaPOlVqyuEWJdG2weIF8g3YP12czsBgNppz3jsnhEgstnQ=="
+    { "options"
+      { "tunnel" = "0" }
+      { "no-agent-forwarding" }
+      { "command" = "sh /etc/netstart tun0" }
+      { "permitopen" = "192.0.2.1:80" }
+      { "permitopen" = "192.0.2.2:25" }
+    }
+    { "type" = "ssh-rsa" }
+    { "comment" = "rpinson on rpinson" } } 
+
+(* Variable: keys *)
+let keys = "# Example keys, one of each type
+#
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDpWrKYsEsVUyuwMN4ReBN/TMGsaUWzDKDz/uQr6MlNNM95MDK/BPyJ+DiBiNMFVLpRt3gH3eCJBLJKMuUDaTNy5uym2zNgAaAIVct6M2GHI68W3iY3Ja8/MaRPbyTpMh1O74S+McpAW1SGL2YzFchYMjTnu/kOD3lxiWNiDLvdLFZu0wPOi7CYG37VXR4Thb0cC92zqnCjaP1TwfhpEYUZoowElYkoV2vG+19O6cRm/zduYcf8hmegZKB4GFUJTtZ2gZ18XJDSQd0ykK3KPt/+bKskdrtfiOwSZAmUZmd2YuAlY6+CBn1T3UBdQntueukd0z1xhd6SX7Bl8+qyqLQ3 user@example
+ssh-dsa AAAA user@example
+ecdsa-sha2-nistp256 AAAA user@example
+ssh-ed25519 AAAA user@example
+
+# Example comments
+ssh-dsa AAAA
+ssh-dsa AAAA user@example
+"
+
+(* Test: Authorized_Keys.lns *)
+test Authorized_Keys.lns get keys =
+  { "#comment" = "Example keys, one of each type" }
+  {  }
+  { "key" =
+"AAAAB3NzaC1yc2EAAAADAQABAAABAQDpWrKYsEsVUyuwMN4ReBN/TMGsaUWzDKDz/uQr6MlNNM95MDK/BPyJ+DiBiNMFVLpRt3gH3eCJBLJKMuUDaTNy5uym2zNgAaAIVct6M2GHI68W3iY3Ja8/MaRPbyTpMh1O74S+McpAW1SGL2YzFchYMjTnu/kOD3lxiWNiDLvdLFZu0wPOi7CYG37VXR4Thb0cC92zqnCjaP1TwfhpEYUZoowElYkoV2vG+19O6cRm/zduYcf8hmegZKB4GFUJTtZ2gZ18XJDSQd0ykK3KPt/+bKskdrtfiOwSZAmUZmd2YuAlY6+CBn1T3UBdQntueukd0z1xhd6SX7Bl8+qyqLQ3"
+    { "type" = "ssh-rsa" }
+    { "comment" = "user@example" }
+  }
+  { "key" = "AAAA"
+    { "type" = "ssh-dsa" }
+    { "comment" = "user@example" }
+  }
+  { "key" = "AAAA"
+    { "type" = "ecdsa-sha2-nistp256" }
+    { "comment" = "user@example" }
+  }
+  { "key" = "AAAA"
+    { "type" = "ssh-ed25519" }
+    { "comment" = "user@example" }
+  }
+  {  }
+  { "#comment" = "Example comments" }
+  { "key" = "AAAA"
+    { "type" = "ssh-dsa" }
+  }
+  { "key" = "AAAA"
+    { "type" = "ssh-dsa" }
+    { "comment" = "user@example" }
+  }
+
+(* Variable: options *)
+let options = "# Example options
+no-pty ssh-dsa AAAA
+no-pty ssh-ed25519 AAAA
+no-pty,command=\"foo\" ssh-dsa AAAA
+no-pty,command=\"foo bar\" ssh-dsa AAAA
+no-pty,from=\"example.com,10.1.1.0/16\" ssh-dsa AAAA
+no-pty,environment=\"LANG=en_GB.UTF8\" ssh-dsa AAAA
+"
+
+(* Test: Authorized_Keys.lns *)
+test Authorized_Keys.lns get options =
+  { "#comment" = "Example options" }
+  { "key" = "AAAA"
+    { "options"
+      { "no-pty" }
+    }
+    { "type" = "ssh-dsa" }
+  }
+  { "key" = "AAAA"
+    { "options"
+      { "no-pty" }
+    }
+    { "type" = "ssh-ed25519" }
+  }
+  { "key" = "AAAA"
+    { "options"
+      { "no-pty" }
+      { "command" = "foo" }
+    }
+    { "type" = "ssh-dsa" }
+  }
+  { "key" = "AAAA"
+    { "options"
+      { "no-pty" }
+      { "command" = "foo bar" }
+    }
+    { "type" = "ssh-dsa" }
+  }
+  { "key" = "AAAA"
+    { "options"
+      { "no-pty" }
+      { "from" = "example.com,10.1.1.0/16" }
+    }
+    { "type" = "ssh-dsa" }
+  }
+  { "key" = "AAAA"
+    { "options"
+      { "no-pty" }
+      { "environment" = "LANG=en_GB.UTF8" }
+    }
+    { "type" = "ssh-dsa" }
+  }
diff --git a/lenses/tests/test_automaster.aug b/lenses/tests/test_automaster.aug
new file mode 100644 (file)
index 0000000..696acb9
--- /dev/null
@@ -0,0 +1,64 @@
+module Test_automaster =
+
+  let example = "#
+# Sample auto.master file
+#
+
+/-        auto.data
+/net    -hosts ro
+/misc   /etc/auto.misc
+/home     /etc/auto.home
+/home     ldap:example.com:ou=auto.home,dc=example,dc=com 
+/mnt      yp:mnt.map -strict,-Dfoo=bar,uid=1000
+/mnt      yp,sun:mnt.map
+/auto   /etc/auto.HD --timeout=15 --ghost
+
++dir:/etc/auto.master.d
++ auto.master
+"
+
+  test Automaster.lns get example =
+    { }
+    { "#comment" = "Sample auto.master file" }
+    { }
+    { }
+    { "1" = "/-"
+        { "map" = "auto.data" } }
+    { "2" = "/net"
+        { "map" = "-hosts" }
+        { "opt" = "ro" } }
+    { "3" = "/misc"
+        { "map" = "/etc/auto.misc" } }
+    { "4" = "/home"
+        { "map" = "/etc/auto.home" } }
+    { "5" = "/home"
+        { "type" = "ldap" }
+        { "host" = "example.com" }
+        { "map" = "ou=auto.home,dc=example,dc=com" } }
+    { "6" = "/mnt"
+        { "type" = "yp" }
+        { "map" = "mnt.map" }
+        { "opt" = "-strict" }
+        { "opt" = "-Dfoo"
+            { "value" = "bar" } }
+        { "opt" = "uid"
+            { "value" = "1000" } } }
+    { "7" = "/mnt"
+        { "type" = "yp" }
+        { "format" = "sun" }
+        { "map" = "mnt.map" } }
+    { "8" = "/auto"
+        { "map" = "/etc/auto.HD" }
+        { "opt" = "--timeout"
+            { "value" = "15" } }
+        { "opt" = "--ghost" } }
+    { }
+    { "9" = "+"
+        { "type" = "dir" }
+        { "map" = "/etc/auto.master.d" } }
+    { "10" = "+"
+        { "map" = "auto.master" } }
+
+(* Local Variables: *)
+(* mode: caml       *)
+(* End:             *)
diff --git a/lenses/tests/test_automounter.aug b/lenses/tests/test_automounter.aug
new file mode 100644 (file)
index 0000000..c84fc0a
--- /dev/null
@@ -0,0 +1,171 @@
+module Test_automounter =
+
+  let example = "#
+# This is an automounter map and it has the following format
+# key [ -mount-options-separated-by-comma ] location
+# Details may be found in the autofs(5) manpage
+
+# indirect map
+cd      -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
+kernel    -ro,soft,intr       ftp.kernel.org:/pub/linux
+*       -fstype=auto,loop,ro    :/srv/distros/isos/&.iso
+
+# direct map
+/nfs/apps/mozilla             bogus:/usr/local/moxill
+
+# replicated server
+path    host1,host2,hostn:/path/path
+path    host1,host2:/blah host3(1):/some/other/path
+path    host1(5),host2(6),host3(1):/path/path
+
+# multi-mount map
+server    -rw,hard,intr       / -ro myserver.me.org:/
+server    -rw,hard,intr       / -ro myserver.me.org:/ /usr myserver.me.org:/usr
+server    -rw,hard,intr       / -ro myserver.me.org:/ \
+                              /usr myserver.me.org:/usr \
+                              /home myserver.me.org:/home
+
+server    -rw,hard,intr       / -ro my-with-dash-server.me.org:/
+
+# included maps
++auto_home
+"
+
+  test Automounter.lns get example =
+    { }
+    { "#comment" = "This is an automounter map and it has the following format" }
+    { "#comment" = "key [ -mount-options-separated-by-comma ] location" }
+    { "#comment" = "Details may be found in the autofs(5) manpage" }
+    { }
+    { "#comment" = "indirect map" }
+    { "1" = "cd"
+        { "opt" = "fstype"
+            { "value" = "iso9660" } }
+        { "opt" = "ro" }
+        { "opt" = "nosuid" }
+        { "opt" = "nodev" }
+        { "location"
+            { "1"
+                { "path" = "/dev/cdrom" } } } }
+    { "2" = "kernel"
+        { "opt" = "ro" }
+        { "opt" = "soft" }
+        { "opt" = "intr" }
+        { "location"
+            { "1"
+                { "host" = "ftp.kernel.org" }
+                { "path" = "/pub/linux" } } } }
+    { "3" = "*"
+        { "opt" = "fstype"
+            { "value" = "auto" } }
+        { "opt" = "loop" }
+        { "opt" = "ro" }
+        { "location"
+            { "1"
+                { "path" = "/srv/distros/isos/&.iso" } } } }
+    { }
+    { "#comment" = "direct map" }
+    { "4" = "/nfs/apps/mozilla"
+        { "location"
+            { "1"
+                { "host" = "bogus" }
+                { "path" = "/usr/local/moxill" } } } }
+    { }
+    { "#comment" = "replicated server" }
+    { "5" = "path"
+        { "location"
+            { "1"
+                { "host" = "host1" }
+                { "host" = "host2" }
+                { "host" = "hostn" }
+                { "path" = "/path/path" } } } }
+    { "6" = "path"
+        { "location"
+            { "1"
+                { "host" = "host1" }
+                { "host" = "host2" }
+                { "path" = "/blah" } }
+            { "2"
+                { "host" = "host3"
+                    { "weight" = "1" } }
+                { "path" = "/some/other/path" } } } }
+    { "7" = "path"
+        { "location"
+            { "1"
+                { "host" = "host1"
+                    { "weight" = "5" } }
+                { "host" = "host2"
+                    { "weight" = "6" } }
+                { "host" = "host3"
+                    { "weight" = "1" } }
+                { "path" = "/path/path" } } } }
+    { }
+    { "#comment" = "multi-mount map" }
+    { "8" = "server"
+        { "opt" = "rw" }
+        { "opt" = "hard" }
+        { "opt" = "intr" }
+        { "mount"
+            { "1" = "/"
+                { "opt" = "ro" }
+                { "location"
+                    { "1"
+                        { "host" = "myserver.me.org" }
+                        { "path" = "/" } } } } } }
+    { "9" = "server"
+        { "opt" = "rw" }
+        { "opt" = "hard" }
+        { "opt" = "intr" }
+        { "mount"
+            { "1" = "/"
+                { "opt" = "ro" }
+                { "location"
+                    { "1"
+                        { "host" = "myserver.me.org" }
+                        { "path" = "/" } } } }
+            { "2" = "/usr"
+                { "location"
+                    { "1"
+                        { "host" = "myserver.me.org" }
+                        { "path" = "/usr" } } } } } }
+    { "10" = "server"
+        { "opt" = "rw" }
+        { "opt" = "hard" }
+        { "opt" = "intr" }
+        { "mount"
+            { "1" = "/"
+                { "opt" = "ro" }
+                { "location"
+                    { "1"
+                        { "host" = "myserver.me.org" }
+                        { "path" = "/" } } } }
+            { "2" = "/usr"
+                { "location"
+                    { "1"
+                        { "host" = "myserver.me.org" }
+                        { "path" = "/usr" } } } }
+            { "3" = "/home"
+                { "location"
+                    { "1"
+                        { "host" = "myserver.me.org" }
+                        { "path" = "/home" } } } } } }
+    { }
+    { "11" = "server"
+        { "opt" = "rw" }
+        { "opt" = "hard" }
+        { "opt" = "intr" }
+        { "mount"
+            { "1" = "/"
+                { "opt" = "ro" }
+                { "location"
+                    { "1"
+                        { "host" = "my-with-dash-server.me.org" }
+                        { "path" = "/" } } } } } }
+    { }
+    { "#comment" = "included maps" }
+    { "12" = "+"
+        { "map" = "auto_home" } }
+
+(* Local Variables: *)
+(* mode: caml       *)
+(* End:             *)
diff --git a/lenses/tests/test_avahi.aug b/lenses/tests/test_avahi.aug
new file mode 100644 (file)
index 0000000..cd417a2
--- /dev/null
@@ -0,0 +1,34 @@
+module Test_avahi =
+
+   let conf = "
+[server]
+host-name=web
+domain=example.com
+
+[wide-area]
+enable-wide-area=yes
+"
+
+   test Avahi.lns get conf =
+      {}
+      { "server"
+         { "host-name" = "web" }
+         { "domain" = "example.com" }
+         {} }
+      { "wide-area"
+         { "enable-wide-area" = "yes" } }
+
+    test Avahi.lns put conf after
+       set "server/use-ipv4" "yes";
+       set "server/clients-max" "4096"
+    = "
+[server]
+host-name=web
+domain=example.com
+
+use-ipv4=yes
+clients-max=4096
+[wide-area]
+enable-wide-area=yes
+"
+
index 066dac8..48ff7d7 100644 (file)
@@ -22,6 +22,10 @@ page anotherpage A new page
 group-compress My test
 192.168.0.2    myhost  # https://myurl.com:1256 noconn pop3 imap2 ssh
 192.168.0.3    myhost2 # !imap2 telnet dns
+
+group-compress DownTime
+0.0.0.0        myhost3 # DOWNTIME=fping,http:*:1800:1015:\"Frontal 01 Redirect Amazon eteint entre 18h et 10h\"
+0.0.0.0        myhost4 # ftps imaps imap4 pop-3 pop2s pop smtp smtps ssh ssh1 ssh2 telnet telnets
 "
 
    test BBhosts.lns get conf =
@@ -90,5 +94,38 @@ group-compress My test
                { "probes"
                   { "imap2" = "!" }
                   { "telnet" = "" }
-                  { "dns" = "" } } } } }
+                  { "dns" = "" } } } 
+          {}
+         }
+         { "group-compress" = "DownTime"
+            { "host"
+               { "ip" = "0.0.0.0" }
+               { "fqdn" = "myhost3" }
+               { "probes"
+                  { "DOWNTIME"
+                     { "probe" = "fping" }
+                     { "probe" = "http" }
+                     { "day" = "*" }
+                     { "starttime" = "1800" }
+                     { "endtime" = "1015" }
+                     { "cause" = "Frontal 01 Redirect Amazon eteint entre 18h et 10h" }
+                     } } }
+             { "host"
+                { "ip" = "0.0.0.0" }
+                { "fqdn" = "myhost4" }
+                { "probes"
+                   { "ftps" = "" } 
+                   { "imaps" = "" } 
+                   { "imap4" = "" } 
+                   { "pop-3" = "" } 
+                   { "pop2s" = "" } 
+                   { "pop" = "" } 
+                   { "smtp" = "" } 
+                   { "smtps" = "" } 
+                   { "ssh" = "" } 
+                   { "ssh1" = "" } 
+                   { "ssh2" = "" } 
+                   { "telnet" = "" } 
+                   { "telnets" = "" } 
+                } } } }
 
diff --git a/lenses/tests/test_bootconf.aug b/lenses/tests/test_bootconf.aug
new file mode 100644 (file)
index 0000000..577760f
--- /dev/null
@@ -0,0 +1,47 @@
+(*
+Module: Test_BootConf
+  Provides unit tests for the <BootConf> lens.
+*)
+
+module Test_bootconf =
+
+test BootConf.boot get "boot /bsd -s\n" =
+  { "boot"
+    { "image" = "/bsd" }
+    { "arg" = "-s" } }
+
+test BootConf.echo get "echo 42\n" =
+  { "echo" = "42" }
+
+test BootConf.ls get "ls /\n" = 
+  { "ls" = "/" }
+
+test BootConf.ls get "ls //\n" = 
+  { "ls" = "//" }
+
+test BootConf.ls get "ls /some/path/\n" = 
+  { "ls" = "/some/path/" }
+
+test BootConf.machine get "machine diskinfo\n" =
+  { "machine"
+    { "diskinfo" } }
+
+test BootConf.machine get "machine comaddr 0xdeadbeef\n" =
+  { "machine"
+    { "comaddr" = "0xdeadbeef" } } 
+
+test BootConf.set get "set tty com0\n" =
+  { "set"
+    { "tty" = "com0" } }
+
+test BootConf.single_command get "help\n" =
+  { "help" }
+
+test BootConf.stty get "stty /dev/cuaU0 115200\n" =
+  { "stty"
+    { "device" = "/dev/cuaU0" }
+    { "speed" = "115200" } }
+
+test BootConf.stty get "stty /dev/cuaU0\n" =
+  { "stty"
+    { "device" = "/dev/cuaU0" } }
diff --git a/lenses/tests/test_build.aug b/lenses/tests/test_build.aug
new file mode 100644 (file)
index 0000000..be7d897
--- /dev/null
@@ -0,0 +1,319 @@
+(*
+Module: Test_Build
+  Provides unit tests and examples for the <Build> lens.
+*)
+
+module Test_Build =
+
+(************************************************************************
+ * Group:               GENERIC CONSTRUCTIONS
+ ************************************************************************)
+
+(* View: brackets
+    Test brackets *)
+let brackets = [ Build.brackets Sep.lbracket Sep.rbracket  (key Rx.word) ]
+
+(* Test: brackets *)
+test brackets get "(foo)" = { "foo" }
+
+
+(************************************************************************
+ * Group:             LIST CONSTRUCTIONS
+ ************************************************************************)
+
+(* View: list *)
+let list = Build.list [ key Rx.word ] Sep.space
+
+(* Test: list *)
+test list get "foo bar baz" = { "foo" } { "bar" } { "baz" }
+
+(* Test: list *)
+test list get "foo" = * 
+
+(* View: opt_list *)
+let opt_list = Build.opt_list [ key Rx.word ] Sep.space
+
+(* Test: opt_list *)
+test opt_list get "foo bar baz" = { "foo" } { "bar" } { "baz" }
+
+
+(************************************************************************
+ * Group:                   LABEL OPERATIONS
+ ************************************************************************)
+
+(* View: xchg *)
+let xchg = [ Build.xchg Rx.space " " "space" ]
+
+(* Test: xchg *)
+test xchg get " \t " = { "space" }
+
+(* View: xchgs *)
+let xchgs = [ Build.xchgs " " "space" ]
+
+(* Test: xchgs *)
+test xchgs get " " = { "space" }
+
+
+(************************************************************************
+ * Group:                   SUBNODE CONSTRUCTIONS
+ ************************************************************************)
+
+(* View: key_value_line *)
+let key_value_line = Build.key_value_line Rx.word Sep.equal (store Rx.word)
+
+(* Test: key_value_line *)
+test key_value_line get "foo=bar\n" = { "foo" = "bar" }
+
+(* View: key_value_line_comment *)
+let key_value_line_comment = Build.key_value_line_comment Rx.word
+                             Sep.equal (store Rx.word) Util.comment
+
+(* Test: key_value_line_comment *)
+test key_value_line_comment get "foo=bar # comment\n" =
+    { "foo" = "bar" { "#comment" = "comment" } }
+
+(* View: key_value *)
+let key_value = Build.key_value Rx.word Sep.equal (store Rx.word)
+
+(* Test: key_value *)
+test key_value get "foo=bar" = { "foo" = "bar" }
+
+(* View: key_ws_value *)
+let key_ws_value = Build.key_ws_value Rx.word
+
+(* Test: key_ws_value *)
+test key_ws_value get "foo bar\n" = { "foo" = "bar" }
+
+(* View: flag *)
+let flag = Build.flag Rx.word
+
+(* Test: flag *)
+test flag get "foo" = { "foo" }
+
+(* View: flag_line *)
+let flag_line = Build.flag_line Rx.word
+
+(* Test: flag_line *)
+test flag_line get "foo\n" = { "foo" }
+
+
+(************************************************************************
+ * Group:                   BLOCK CONSTRUCTIONS
+ ************************************************************************)
+
+(* View: block_entry
+    The block entry used for testing *)
+let block_entry = Build.key_value "test" Sep.equal (store Rx.word)
+
+(* View: block
+    The block used for testing *)
+let block = Build.block block_entry
+
+(* Test: block
+     Simple test for <block> *)
+test block get " {test=1}" =
+  { "test" = "1" }
+
+(* Test: block
+     Simple test for <block> with newlines *)
+test block get " {\n test=1\n}" =
+  { "test" = "1" }
+
+(* Test: block
+     Simple test for <block> two indented entries *)
+test block get " {\n test=1 \n  test=2 \n}" =
+  { "test" = "1" }
+  { "test" = "2" }
+
+(* Test: block
+     Test <block> with a comment *)
+test block get " { # This is a comment\n}" =
+  { "#comment" = "This is a comment" }
+
+(* Test: block
+     Test <block> with comments and newlines *)
+test block get " { # This is a comment\n# Another comment\n}" =
+  { "#comment" = "This is a comment" }
+  { "#comment" = "Another comment" }
+
+(* Test: block
+     Test defaults for blocks *)
+test block put " { test=1 }" after
+   set "/#comment" "a comment";
+   rm "/test";
+   set "/test" "2" =
+  " { # a comment\ntest=2 }"
+
+(* View: named_block
+    The named block used for testing *)
+let named_block = Build.named_block "foo" block_entry
+
+(* Test: named_block
+     Simple test for <named_block> *)
+test named_block get "foo {test=1}\n" =
+  { "foo" { "test" = "1" } }
+
+(* View: logrotate_block
+    A minimalistic logrotate block *)
+let logrotate_block =
+      let entry = [ key Rx.word ] 
+   in let filename = [ label "file" . store /\/[^,#= \n\t{}]+/ ]
+   in let filename_sep = del /[ \t\n]+/ " "
+   in let filenames = Build.opt_list filename filename_sep
+   in [ label "rule" . filenames . Build.block entry ]
+
+(* Test: logrotate_block *)
+test logrotate_block get "/var/log/wtmp\n/var/log/wtmp2\n{
+   missingok
+   monthly
+}" =
+  { "rule"
+    { "file" = "/var/log/wtmp" }
+    { "file" = "/var/log/wtmp2" }
+    { "missingok" }
+    { "monthly" }
+  }
+
+
+(************************************************************************
+ * Group:               COMBINATORICS
+ ************************************************************************)
+
+(* View: combine_two
+    A minimalistic combination lens *)
+let combine_two =
+     let entry (k:string) = [ key k ]
+  in Build.combine_two (entry "a") (entry "b")
+
+(* Test: combine_two 
+     Should parse ab *)
+test combine_two get "ab" = { "a" } { "b" }
+
+(* Test: combine_two 
+     Should parse ba *)
+test combine_two get "ba" = { "b" } { "a" }
+
+(* Test: combine_two 
+     Should not parse a *)
+test combine_two get "a" = *
+
+(* Test: combine_two 
+     Should not parse b *)
+test combine_two get "b" = *
+
+(* Test: combine_two 
+     Should not parse aa *)
+test combine_two get "aa" = *
+
+(* Test: combine_two 
+     Should not parse bb *)
+test combine_two get "bb" = *
+
+(* View: combine_two_opt
+    A minimalistic optional combination lens *)
+let combine_two_opt =
+     let entry (k:string) = [ key k ]
+  in Build.combine_two_opt (entry "a") (entry "b")
+
+(* Test: combine_two_opt 
+     Should parse ab *)
+test combine_two_opt get "ab" = { "a" } { "b" }
+
+(* Test: combine_two_opt 
+     Should parse ba *)
+test combine_two_opt get "ba" = { "b" } { "a" }
+
+(* Test: combine_two_opt 
+     Should parse a *)
+test combine_two_opt get "a" = { "a" }
+
+(* Test: combine_two_opt 
+     Should parse b *)
+test combine_two_opt get "b" = { "b" }
+
+(* Test: combine_two_opt 
+     Should not parse aa *)
+test combine_two_opt get "aa" = *
+
+(* Test: combine_two_opt 
+     Should not parse bb *)
+test combine_two_opt get "bb" = *
+
+
+(* View: combine_three
+    A minimalistic optional combination lens *)
+let combine_three =
+     let entry (k:string) = [ key k ]
+  in Build.combine_three (entry "a") (entry "b") (entry "c")
+
+(* Test: combine_three 
+     Should not parse ab *)
+test combine_three get "ab" = *
+
+(* Test: combine_three 
+     Should not parse ba *)
+test combine_three get "ba" = *
+
+(* Test: combine_three 
+     Should not parse a *)
+test combine_three get "a" = *
+
+(* Test: combine_three 
+     Should not parse b *)
+test combine_three get "b" = *
+
+(* Test: combine_three 
+     Should not parse aa *)
+test combine_three get "aa" = *
+
+(* Test: combine_three 
+     Should not parse bbc *)
+test combine_three get "bbc" = *
+
+(* Test: combine_three 
+     Should parse abc *)
+test combine_three get "abc" = { "a" } { "b" } { "c" }
+
+(* Test: combine_three 
+     Should parse cab *)
+test combine_three get "cab" = { "c" } { "a" } { "b" }
+
+
+(* View: combine_three_opt
+    A minimalistic optional combination lens *)
+let combine_three_opt =
+     let entry (k:string) = [ key k ]
+  in Build.combine_three_opt (entry "a") (entry "b") (entry "c")
+
+(* Test: combine_three_opt 
+     Should parse ab *)
+test combine_three_opt get "ab" = { "a" } { "b" }
+
+(* Test: combine_three_opt 
+     Should parse ba *)
+test combine_three_opt get "ba" = { "b" } { "a" }
+
+(* Test: combine_three_opt 
+     Should parse a *)
+test combine_three_opt get "a" = { "a" }
+
+(* Test: combine_three_opt 
+     Should parse b *)
+test combine_three_opt get "b" = { "b" }
+
+(* Test: combine_three_opt 
+     Should not parse aa *)
+test combine_three_opt get "aa" = *
+
+(* Test: combine_three_opt 
+     Should not parse bbc *)
+test combine_three_opt get "bbc" = *
+
+(* Test: combine_three_opt 
+     Should parse abc *)
+test combine_three_opt get "abc" = { "a" } { "b" } { "c" }
+
+(* Test: combine_three_opt 
+     Should parse cab *)
+test combine_three_opt get "cab" = { "c" } { "a" } { "b" }
diff --git a/lenses/tests/test_cachefilesd.aug b/lenses/tests/test_cachefilesd.aug
new file mode 100644 (file)
index 0000000..2ddb7b7
--- /dev/null
@@ -0,0 +1,30 @@
+module Test_Cachefilesd =
+
+   let conf = "
+# I am a comment
+dir /var/cache/fscache
+tAg mycache
+brun 10%
+bcull 7%
+bstop 3%
+frun 10%
+fcull 7%
+fstop 3%
+nocull
+
+secctx system_u:system_r:cachefiles_kernel_t:s0
+"
+   test Cachefilesd.lns get conf = 
+    {  }
+    { "#comment" = "I am a comment" }
+    { "dir" = "/var/cache/fscache" }
+    { "tAg" = "mycache" }
+    { "brun" = "10%" }
+    { "bcull" = "7%" }
+    { "bstop" = "3%" }
+    { "frun" = "10%" }
+    { "fcull" = "7%" }
+    { "fstop" = "3%" }
+    { "nocull" }
+    {  }
+    { "secctx" = "system_u:system_r:cachefiles_kernel_t:s0" }
diff --git a/lenses/tests/test_carbon.aug b/lenses/tests/test_carbon.aug
new file mode 100644 (file)
index 0000000..b124bf3
--- /dev/null
@@ -0,0 +1,84 @@
+(*
+Module: Test_Carbon
+  Provides unit tests and examples for the <Carbon> lens.
+*)
+
+module Test_Carbon =
+
+let carbon_conf = "[cache]
+# Configure carbon directories.
+
+# Specify the user to drop privileges to
+# If this is blank carbon runs as the user that invokes it
+# This user must have write access to the local data directory
+USER =
+
+MAX_CACHE_SIZE = inf # comment at EOL
+LINE_RECEIVER_INTERFACE=0.0.0.0
+LINE_RECEIVER_PORT = 2003
+ENABLE_UDP_LISTENER = False
+
+[relay]
+LINE_RECEIVER_INTERFACE = 0.0.0.0
+LINE_RECEIVER_PORT = 2013
+PICKLE_RECEIVER_INTERFACE = 0.0.0.0
+PICKLE_RECEIVER_PORT = 2014
+"
+
+test Carbon.lns get carbon_conf =
+  { "cache"
+    { "#comment" = "Configure carbon directories." }
+    { }
+    { "#comment" = "Specify the user to drop privileges to" }
+    { "#comment" = "If this is blank carbon runs as the user that invokes it" }
+    { "#comment" = "This user must have write access to the local data directory" }
+    { "USER" }
+    { }
+    { "MAX_CACHE_SIZE" = "inf"
+      { "#comment" = "comment at EOL" }
+    }
+    { "LINE_RECEIVER_INTERFACE" = "0.0.0.0" }
+    { "LINE_RECEIVER_PORT" = "2003" }
+    { "ENABLE_UDP_LISTENER" = "False" }
+    { }
+  }
+  { "relay"
+    { "LINE_RECEIVER_INTERFACE" = "0.0.0.0" }
+    { "LINE_RECEIVER_PORT" = "2013" }
+    { "PICKLE_RECEIVER_INTERFACE" = "0.0.0.0" }
+    { "PICKLE_RECEIVER_PORT" = "2014" }
+  }
+
+let relay_rules_conf = "# You must have exactly one section with 'default = true'
+# Note that all destinations listed must also exist in carbon.conf
+# in the DESTINATIONS setting in the [relay] section
+[default]
+default = true
+destinations = 127.0.0.1:2004:a, 127.0.0.1:2104:b
+"
+
+test Carbon.lns get relay_rules_conf =
+  { "#comment" = "You must have exactly one section with 'default = true'" }
+  { "#comment" = "Note that all destinations listed must also exist in carbon.conf" }
+  { "#comment" = "in the DESTINATIONS setting in the [relay] section" }
+  { "default"
+    { "default" = "true" }
+    { "destinations" = "127.0.0.1:2004:a, 127.0.0.1:2104:b" }
+  }
+
+let storage_aggregation_conf = "# Aggregation methods for whisper files. Entries are scanned in order,
+# and first match wins. This file is scanned for changes every 60 seconds
+[max]
+pattern = \.max$
+xFilesFactor = 0.1
+aggregationMethod = max
+"
+
+test Carbon.lns get storage_aggregation_conf =
+  { "#comment" = "Aggregation methods for whisper files. Entries are scanned in order," }
+  { "#comment" = "and first match wins. This file is scanned for changes every 60 seconds" }
+  { "max"
+    { "pattern" = "\.max$" }
+    { "xFilesFactor" = "0.1" }
+    { "aggregationMethod" = "max" }
+  }
index 973e53c..6cd0856 100644 (file)
@@ -253,3 +253,68 @@ test Cgconfig.lns get group4 =
     {  } }
   {  }
   {  }
+
+test Cgconfig.lns put "group tst {memory {}}" after
+  set "/group" "tst2"
+= "group tst2 {memory {}}"
+
+let group5="
+group user {
+       cpuacct {}
+        cpu {}
+        cpuset {}
+        devices {}
+        freezer {}
+        memory {}
+        net_cls {}
+        blkio {}
+        hugetlb {}
+        perf_event {}
+}"
+
+test Cgconfig.lns get group5 =
+  {  }
+  { "group" = "user"
+    {  }
+    { "controller" = "cpuacct" }
+    {  }
+    { "controller" = "cpu" }
+    {  }
+    { "controller" = "cpuset" }
+    {  }
+    { "controller" = "devices" }
+    {  }
+    { "controller" = "freezer" }
+    {  }
+    { "controller" = "memory" }
+    {  }
+    { "controller" = "net_cls" }
+    {  }
+    { "controller" = "blkio" }
+    {  }
+    { "controller" = "hugetlb" }
+    {  }
+    { "controller" = "perf_event" }
+    {  }
+  }
+
+(* quoted controller parameter whitespace *)
+let group6="
+group blklimit {
+     blkio {
+               blkio.throttle.read_iops_device=\"8:0 50\";
+     }
+}"
+
+test Cgconfig.lns get group6 =
+  {  }
+  { "group" = "blklimit"
+    {  }
+    { "controller" = "blkio"
+      {  }
+      { "blkio.throttle.read_iops_device" = "\"8:0 50\"" }
+      {  }
+    }
+    {  }
+  }
+
diff --git a/lenses/tests/test_channels.aug b/lenses/tests/test_channels.aug
new file mode 100644 (file)
index 0000000..a387494
--- /dev/null
@@ -0,0 +1,138 @@
+(*
+Module: Test_Channels
+  Provides unit tests and examples for the <Channels> lens.
+*)
+
+module Test_Channels =
+
+(* Variable: conf
+   A full configuration file *)
+let conf = "Direct 8 TV;SES ASTRA:12551:VC56M2O0S0:S19.2E:22000:1111=2:1112=fra@3:1116:0:12174:1:1108:0
+:FAVORIS
+Direct 8 TV;SES ASTRA:12551:VC56M2O0S0:S19.2E:22000:1111=2:1112=fra@3:1116:0:12175:1:1108:0
+TF1;CSAT:11895:VC34M2O0S0:S19.2E:27500:171=2:124=fra+spa@4,125=eng@4;126=deu@4:53:500,1811,1863,100:8371:1:1074:0
+:TNT
+TF1;SMR6:690167:I999B8C999D999M998T999G999Y0:T:27500:120=2:130=fra@3,131=eng@3,133=qad@3:140;150=fra,151=eng:0:1537:8442:6:0
+; this is a comment
+France 5;GR1:618167:I999B8C999D999M998T999G999Y0:T:27500:374+320=2:330=fra@3,331=qad@3:0;340=fra:0:260:8442:1:0
+CANAL+ FAMILY HD:12012:VC23M5O35S1:S19.2E:27500:164=27:0;98=@106,99=eng@106:0;45=fra+fra:1811,500,1863,100,9C4,9C7,9AF:8825:1:1080:0
+"
+
+(* Test: Channels.lns
+   Test the full <conf> *)
+test Channels.lns get conf =
+   { "entry" = "Direct 8 TV"
+      { "provider" = "SES ASTRA" }
+      { "frequency" = "12551" }
+      { "parameter" = "VC56M2O0S0" }
+      { "signal_source" = "S19.2E" }
+      { "symbol_rate" = "22000" }
+      { "vpid" = "1111" { "codec" = "2" } }
+      { "apid" = "1112" { "lang" = "fra" } { "codec" = "3" } }
+      { "tpid" = "1116" }
+      { "caid" = "0" }
+      { "sid" = "12174" }
+      { "nid" = "1" }
+      { "tid" = "1108" }
+      { "rid" = "0" }
+   }
+   { "group" = "FAVORIS"
+      { "entry" = "Direct 8 TV"
+         { "provider" = "SES ASTRA" }
+         { "frequency" = "12551" }
+         { "parameter" = "VC56M2O0S0" }
+         { "signal_source" = "S19.2E" }
+         { "symbol_rate" = "22000" }
+         { "vpid" = "1111" { "codec" = "2" } }
+         { "apid" = "1112" { "lang" = "fra" } { "codec" = "3" } }
+         { "tpid" = "1116" }
+         { "caid" = "0" }
+         { "sid" = "12175" }
+         { "nid" = "1" }
+         { "tid" = "1108" }
+         { "rid" = "0" }
+      }
+      { "entry" = "TF1"
+         { "provider" = "CSAT" }
+         { "frequency" = "11895" }
+         { "parameter" = "VC34M2O0S0" }
+         { "signal_source" = "S19.2E" }
+         { "symbol_rate" = "27500" }
+         { "vpid" = "171" { "codec" = "2" } }
+         { "apid" = "124" { "lang" = "fra" } { "lang" = "spa" } { "codec" = "4" } }
+         { "apid" = "125" { "lang" = "eng" } { "codec" = "4" } }
+         { "apid_dolby" = "126" { "lang" = "deu" } { "codec" = "4" } }
+         { "tpid" = "53" }
+         { "caid" = "500" }
+         { "caid" = "1811" }
+         { "caid" = "1863" }
+         { "caid" = "100" }
+         { "sid" = "8371" }
+         { "nid" = "1" }
+         { "tid" = "1074" }
+         { "rid" = "0" }
+      }
+   }
+   { "group" = "TNT"
+     { "entry" = "TF1"
+       { "provider" = "SMR6" }
+       { "frequency" = "690167" }
+       { "parameter" = "I999B8C999D999M998T999G999Y0" }
+       { "signal_source" = "T" }
+       { "symbol_rate" = "27500" }
+       { "vpid" = "120" { "codec" = "2" } }
+       { "apid" = "130" { "lang" = "fra" } { "codec" = "3" } }
+       { "apid" = "131" { "lang" = "eng" } { "codec" = "3" } }
+       { "apid" = "133" { "lang" = "qad" } { "codec" = "3" } }
+       { "tpid" = "140" }
+       { "tpid_bylang" = "150" { "lang" = "fra" } }
+       { "tpid_bylang" = "151" { "lang" = "eng" } }
+       { "caid" = "0" }
+       { "sid" = "1537" }
+       { "nid" = "8442" }
+       { "tid" = "6" }
+       { "rid" = "0" }
+     }
+     { "#comment" = "this is a comment" }
+     { "entry" = "France 5"
+       { "provider" = "GR1" }
+       { "frequency" = "618167" }
+       { "parameter" = "I999B8C999D999M998T999G999Y0" }
+       { "signal_source" = "T" }
+       { "symbol_rate" = "27500" }
+       { "vpid" = "374" }
+       { "vpid_pcr" = "320" { "codec" = "2" } }
+       { "apid" = "330" { "lang" = "fra" } { "codec" = "3" } }
+       { "apid" = "331" { "lang" = "qad" } { "codec" = "3" } }
+       { "tpid" = "0" }
+       { "tpid_bylang" = "340" { "lang" = "fra" } }
+       { "caid" = "0" }
+       { "sid" = "260" }
+       { "nid" = "8442" }
+       { "tid" = "1" }
+       { "rid" = "0" }
+     }
+     { "entry" = "CANAL+ FAMILY HD"
+       { "frequency" = "12012" }
+       { "parameter" = "VC23M5O35S1" }
+       { "signal_source" = "S19.2E" }
+       { "symbol_rate" = "27500" }
+       { "vpid" = "164" { "codec" = "27" } }
+       { "apid" = "0" }
+       { "apid_dolby" = "98" { "codec" = "106" } }
+       { "apid_dolby" = "99" { "lang" = "eng" } { "codec" = "106" } }
+       { "tpid" = "0" }
+       { "tpid_bylang" = "45" { "lang" = "fra" } { "lang" = "fra" } }
+       { "caid" = "1811" }
+       { "caid" = "500" }
+       { "caid" = "1863" }
+       { "caid" = "100" }
+       { "caid" = "9C4" }
+       { "caid" = "9C7" }
+       { "caid" = "9AF" }
+       { "sid" = "8825" }
+       { "nid" = "1" }
+       { "tid" = "1080" }
+       { "rid" = "0" }
+     }
+   }
diff --git a/lenses/tests/test_chrony.aug b/lenses/tests/test_chrony.aug
new file mode 100644 (file)
index 0000000..4917358
--- /dev/null
@@ -0,0 +1,143 @@
+(*
+Module: Test_Chrony
+  Provides unit tests and examples for the <Chrony> lens.
+*)
+
+module Test_Chrony =
+
+  let exampleconf = "# Comment
+#Comment
+! Comment
+!Comment
+; Comment
+;Comment
+% Comment
+%Comment
+
+server ntp1.example.com
+server ntp2.example.com iburst
+server ntp3.example.com presend 2
+server ntp4.example.com offline polltarget 4
+server ntp5.example.com maxdelay 2 offline
+server ntp6.example.com maxdelay 2 iburst presend 2
+server ntp7.example.com iburst presend 2 offline
+peer ntpc1.example.com
+stratumweight 0
+driftfile /var/lib/chrony/drift
+rtcsync
+makestep 10 3
+bindcmdaddress 127.0.0.1
+bindcmdaddress ::1
+local stratum 10
+keyfile /etc/chrony.keys
+commandkey 1
+generatecommandkey
+noclientlog
+logchange 0.5
+logdir /var/log/chrony
+log rtc
+leapsectz right/UTC
+broadcast 10 192.168.1.255
+broadcast 10 192.168.100.255 123
+fallbackdrift 16 19
+mailonchange root@localhost 0.5
+maxchange 1000 1 2
+initstepslew 30 foo.bar.com
+initstepslew 30 foo.bar.com baz.quz.com
+"
+
+  test Chrony.lns get exampleconf =
+    { "#comment" = "Comment" }
+  { "#comment" = "Comment" }
+  { "#comment" = "Comment" }
+  { "#comment" = "Comment" }
+  { "#comment" = "Comment" }
+  { "#comment" = "Comment" }
+  { "#comment" = "Comment" }
+  { "#comment" = "Comment" }
+  {  }
+  { "server" = "ntp1.example.com" }
+  { "server" = "ntp2.example.com"
+    { "iburst" }
+  }
+  { "server" = "ntp3.example.com"
+    { "presend" = "2" }
+  }
+  { "server" = "ntp4.example.com"
+    { "offline" }
+    { "polltarget" = "4" }
+  }
+  { "server" = "ntp5.example.com"
+    { "maxdelay" = "2" }
+    { "offline" }
+  }
+  { "server" = "ntp6.example.com"
+    { "maxdelay" = "2" }
+    { "iburst" }
+    { "presend" = "2" }
+  }
+  { "server" = "ntp7.example.com"
+    { "iburst" }
+    { "presend" = "2" }
+    { "offline" }
+  }
+  { "peer" = "ntpc1.example.com" }
+  { "stratumweight" = "0" }
+  { "driftfile" = "/var/lib/chrony/drift" }
+  { "rtcsync" }
+  { "makestep"
+    { "threshold" = "10" }
+    { "limit" = "3" }
+  }
+  { "bindcmdaddress" = "127.0.0.1" }
+  { "bindcmdaddress" = "::1" }
+  { "local"
+    { "stratum" = "10" }
+  }
+  { "keyfile" = "/etc/chrony.keys" }
+  { "commandkey" = "1" }
+  { "generatecommandkey" }
+  { "noclientlog" }
+  { "logchange" = "0.5" }
+  { "logdir" = "/var/log/chrony" }
+  { "log"
+    { "rtc" }
+  }
+  { "leapsectz" = "right/UTC" }
+  { "broadcast"
+    { "interval" = "10" }
+    { "address" = "192.168.1.255" }
+  }
+  { "broadcast"
+    { "interval" = "10" }
+    { "address" = "192.168.100.255" }
+    { "port" = "123" }
+  }
+  {  }
+  { "fallbackdrift"
+    { "min" = "16" }
+    { "max" = "19" }
+  }
+  { "mailonchange"
+    { "emailaddress" = "root@localhost" }
+    { "threshold" = "0.5" }
+  }
+  { "maxchange"
+    { "threshold" = "1000" }
+    { "delay" = "1" }
+    { "limit" = "2" }
+  }
+  { "initstepslew"
+    { "threshold" = "30" }
+    { "address" = "foo.bar.com" }
+  }
+  { "initstepslew"
+    { "threshold" = "30" }
+    { "address" = "foo.bar.com" }
+    { "address" = "baz.quz.com" }
+  }
+
+
+(* Local Variables: *)
+(* mode: caml       *)
+(* End:             *)
diff --git a/lenses/tests/test_collectd.aug b/lenses/tests/test_collectd.aug
new file mode 100644 (file)
index 0000000..abecdcf
--- /dev/null
@@ -0,0 +1,65 @@
+(*
+Module: Test_Collectd
+  Provides unit tests and examples for the <Collectd> lens.
+*)
+module Test_Collectd =
+
+(* Variable: simple *)
+let simple = "LoadPlugin contextswitch
+LoadPlugin cpu
+FQDNLookup \"true\"
+Include \"/var/lib/puppet/modules/collectd/plugins/*.conf\"
+"
+
+(* Test: Collectd.lns *)
+test Collectd.lns get simple =
+  { "directive" = "LoadPlugin"
+    { "arg" = "contextswitch" }
+  }
+  { "directive" = "LoadPlugin"
+    { "arg" = "cpu" }
+  }
+  { "directive" = "FQDNLookup"
+    { "arg" = "\"true\"" }
+  }
+  { "directive" = "Include"
+    { "arg" = "\"/var/lib/puppet/modules/collectd/plugins/*.conf\"" }
+  }
+
+
+(* Variable: filters *)
+let filters = "<Chain \"PreCache\">
+       <Rule \"no_fqdn\">
+               <Match \"regex\">
+                       Host \"^[^\.]*$\"
+                       Invert false
+               </Match>
+               Target \"stop\"
+       </Rule>
+</Chain>
+"
+
+
+(* Test: Collectd.lns *)
+test Collectd.lns get filters =
+  { "Chain"
+    { "arg" = "\"PreCache\"" }
+    { "Rule"
+      { "arg" = "\"no_fqdn\"" }
+      { "Match"
+        { "arg" = "\"regex\"" }
+        { "directive" = "Host"
+          { "arg" = "\"^[^\.]*$\"" }
+        }
+        { "directive" = "Invert"
+          { "arg" = "false" }
+        }
+      }
+      { "directive" = "Target"
+        { "arg" = "\"stop\"" }
+      }
+    }
+  }
+
+
+
diff --git a/lenses/tests/test_cpanel.aug b/lenses/tests/test_cpanel.aug
new file mode 100644 (file)
index 0000000..c38d02f
--- /dev/null
@@ -0,0 +1,48 @@
+(*
+Module: Test_CPanel
+  Provides unit tests and examples for the <CPanel> lens.
+*)
+module Test_CPanel =
+
+(* Variable: config
+     A sample cpanel.config file *)
+let config = "#### NOTICE ####
+# After manually editing any configuration settings in this file,
+# please run '/usr/local/cpanel/whostmgr/bin/whostmgr2 --updatetweaksettings'
+# to fully update your server's configuration.
+skipantirelayd=1
+ionice_optimizefs=6
+account_login_access=owner_root
+enginepl=cpanel.pl
+stats_log=/usr/local/cpanel/logs/stats_log
+cpaddons_notify_users=Allow users to choose
+apache_port=0.0.0.0:80
+allow_server_info_status_from=
+system_diskusage_warn_percent=82.5500
+maxemailsperhour
+email_send_limits_max_defer_fail_percentage
+default_archive-logs=1
+SecurityPolicy::xml-api=1\n"
+
+(* Test: CPanel.lns
+     Get <config> *)
+test CPanel.lns get config =
+  { "#comment" = "### NOTICE ####" }
+  { "#comment" = "After manually editing any configuration settings in this file," }
+  { "#comment" = "please run '/usr/local/cpanel/whostmgr/bin/whostmgr2 --updatetweaksettings'" }
+  { "#comment" = "to fully update your server's configuration." }
+  {  }
+  { "skipantirelayd" = "1" }
+  { "ionice_optimizefs" = "6" }
+  { "account_login_access" = "owner_root" }
+  { "enginepl" = "cpanel.pl" }
+  { "stats_log" = "/usr/local/cpanel/logs/stats_log" }
+  { "cpaddons_notify_users" = "Allow users to choose" }
+  { "apache_port" = "0.0.0.0:80" }
+  { "allow_server_info_status_from" = "" }
+  { "system_diskusage_warn_percent" = "82.5500" }
+  { "maxemailsperhour" }
+  { "email_send_limits_max_defer_fail_percentage" }
+  { "default_archive-logs" = "1" }
+  { "SecurityPolicy::xml-api" = "1" }
diff --git a/lenses/tests/test_cups.aug b/lenses/tests/test_cups.aug
new file mode 100644 (file)
index 0000000..62c5460
--- /dev/null
@@ -0,0 +1,495 @@
+(*
+Module: Test_Cups
+  Provides unit tests and examples for the <Cups> lens.
+*)
+
+module Test_Cups =
+
+(* Variable: conf *)
+let conf = "# Sample configuration file for the CUPS scheduler.
+LogLevel warn
+
+# Deactivate CUPS' internal logrotating, as we provide a better one, especially
+# LogLevel debug2 gets usable now
+MaxLogSize 0
+
+# Administrator user group...
+SystemGroup lpadmin
+
+
+# Only listen for connections from the local machine.
+Listen localhost:631
+Listen /var/run/cups/cups.sock
+
+# Show shared printers on the local network.
+BrowseOrder allow,deny
+BrowseAllow all
+BrowseLocalProtocols CUPS dnssd
+BrowseAddress @LOCAL
+
+# Default authentication type, when authentication is required...
+DefaultAuthType Basic
+
+# Web interface setting...
+WebInterface Yes
+
+# Restrict access to the server...
+<Location />
+  Order allow,deny
+</Location>
+
+# Restrict access to the admin pages...
+<Location /admin>
+  Order allow,deny
+</Location>
+
+# Restrict access to configuration files...
+<Location /admin/conf>
+  AuthType Default
+  Require user @SYSTEM
+  Order allow,deny
+</Location>
+
+# Set the default printer/job policies...
+<Policy default>
+  # Job/subscription privacy...
+  JobPrivateAccess default
+  JobPrivateValues default
+  SubscriptionPrivateAccess default
+  SubscriptionPrivateValues default
+
+  # Job-related operations must be done by the owner or an administrator...
+  <Limit Create-Job Print-Job Print-URI Validate-Job>
+    Order deny,allow
+  </Limit>
+
+  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
+    Require user @OWNER @SYSTEM
+    Order deny,allow
+  </Limit>
+
+  # All administration operations require an administrator to authenticate...
+  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>
+    AuthType Default
+    Require user @SYSTEM
+    Order deny,allow
+  </Limit>
+
+  # All printer operations require a printer operator to authenticate...
+  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
+    AuthType Default
+    Require user @SYSTEM
+    Order deny,allow
+  </Limit>
+
+  # Only the owner or an administrator can cancel or authenticate a job...
+  <Limit Cancel-Job CUPS-Authenticate-Job>
+    Require user @OWNER @SYSTEM
+    Order deny,allow
+  </Limit>
+
+  <Limit All>
+    Order deny,allow
+  </Limit>
+</Policy>
+
+# Set the authenticated printer/job policies...
+<Policy authenticated>
+  # Job/subscription privacy...
+  JobPrivateAccess default
+  JobPrivateValues default
+  SubscriptionPrivateAccess default
+  SubscriptionPrivateValues default
+
+  # Job-related operations must be done by the owner or an administrator...
+  <Limit Create-Job Print-Job Print-URI Validate-Job>
+    AuthType Default
+    Order deny,allow
+  </Limit>
+
+  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
+    AuthType Default
+    Require user @OWNER @SYSTEM
+    Order deny,allow
+  </Limit>
+
+  # All administration operations require an administrator to authenticate...
+  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
+    AuthType Default
+    Require user @SYSTEM
+    Order deny,allow
+  </Limit>
+
+  # All printer operations require a printer operator to authenticate...
+  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
+    AuthType Default
+    Require user @SYSTEM
+    Order deny,allow
+  </Limit>
+
+  # Only the owner or an administrator can cancel or authenticate a job...
+  <Limit Cancel-Job CUPS-Authenticate-Job>
+    AuthType Default
+    Require user @OWNER @SYSTEM
+    Order deny,allow
+  </Limit>
+
+  <Limit All>
+    Order deny,allow
+  </Limit>
+</Policy>
+"
+
+(* Test: Simplevars.lns *)
+test Cups.lns get conf =
+  { "#comment" = "Sample configuration file for the CUPS scheduler." }
+  { "directive" = "LogLevel"
+    { "arg" = "warn" }
+  }
+  {  }
+  { "#comment" = "Deactivate CUPS' internal logrotating, as we provide a better one, especially" }
+  { "#comment" = "LogLevel debug2 gets usable now" }
+  { "directive" = "MaxLogSize"
+    { "arg" = "0" }
+  }
+  {  }
+  { "#comment" = "Administrator user group..." }
+  { "directive" = "SystemGroup"
+    { "arg" = "lpadmin" }
+  }
+  {  }
+  {  }
+  { "#comment" = "Only listen for connections from the local machine." }
+  { "directive" = "Listen"
+    { "arg" = "localhost:631" }
+  }
+  { "directive" = "Listen"
+    { "arg" = "/var/run/cups/cups.sock" }
+  }
+  {  }
+  { "#comment" = "Show shared printers on the local network." }
+  { "directive" = "BrowseOrder"
+    { "arg" = "allow,deny" }
+  }
+  { "directive" = "BrowseAllow"
+    { "arg" = "all" }
+  }
+  { "directive" = "BrowseLocalProtocols"
+    { "arg" = "CUPS" }
+    { "arg" = "dnssd" }
+  }
+  { "directive" = "BrowseAddress"
+    { "arg" = "@LOCAL" }
+  }
+  {  }
+  { "#comment" = "Default authentication type, when authentication is required..." }
+  { "directive" = "DefaultAuthType"
+    { "arg" = "Basic" }
+  }
+  {  }
+  { "#comment" = "Web interface setting..." }
+  { "directive" = "WebInterface"
+    { "arg" = "Yes" }
+  }
+  {  }
+  { "#comment" = "Restrict access to the server..." }
+  { "Location"
+    { "arg" = "/" }
+    { "directive" = "Order"
+      { "arg" = "allow,deny" }
+    }
+  }
+  {  }
+  { "#comment" = "Restrict access to the admin pages..." }
+  { "Location"
+    { "arg" = "/admin" }
+    { "directive" = "Order"
+      { "arg" = "allow,deny" }
+    }
+  }
+  {  }
+  { "#comment" = "Restrict access to configuration files..." }
+  { "Location"
+    { "arg" = "/admin/conf" }
+    { "directive" = "AuthType"
+      { "arg" = "Default" }
+    }
+    { "directive" = "Require"
+      { "arg" = "user" }
+      { "arg" = "@SYSTEM" }
+    }
+    { "directive" = "Order"
+      { "arg" = "allow,deny" }
+    }
+  }
+  {  }
+  { "#comment" = "Set the default printer/job policies..." }
+  { "Policy"
+    { "arg" = "default" }
+    { "#comment" = "Job/subscription privacy..." }
+    { "directive" = "JobPrivateAccess"
+      { "arg" = "default" }
+    }
+    { "directive" = "JobPrivateValues"
+      { "arg" = "default" }
+    }
+    { "directive" = "SubscriptionPrivateAccess"
+      { "arg" = "default" }
+    }
+    { "directive" = "SubscriptionPrivateValues"
+      { "arg" = "default" }
+    }
+    {  }
+    { "#comment" = "Job-related operations must be done by the owner or an administrator..." }
+    { "Limit"
+      { "arg" = "Create-Job" }
+      { "arg" = "Print-Job" }
+      { "arg" = "Print-URI" }
+      { "arg" = "Validate-Job" }
+      { "directive" = "Order"
+        { "arg" = "deny,allow" }
+      }
+    }
+    {  }
+    { "Limit"
+      { "arg" = "Send-Document" }
+      { "arg" = "Send-URI" }
+      { "arg" = "Hold-Job" }
+      { "arg" = "Release-Job" }
+      { "arg" = "Restart-Job" }
+      { "arg" = "Purge-Jobs" }
+      { "arg" = "Set-Job-Attributes" }
+      { "arg" = "Create-Job-Subscription" }
+      { "arg" = "Renew-Subscription" }
+      { "arg" = "Cancel-Subscription" }
+      { "arg" = "Get-Notifications" }
+      { "arg" = "Reprocess-Job" }
+      { "arg" = "Cancel-Current-Job" }
+      { "arg" = "Suspend-Current-Job" }
+      { "arg" = "Resume-Job" }
+      { "arg" = "Cancel-My-Jobs" }
+      { "arg" = "Close-Job" }
+      { "arg" = "CUPS-Move-Job" }
+      { "arg" = "CUPS-Get-Document" }
+      { "directive" = "Require"
+        { "arg" = "user" }
+        { "arg" = "@OWNER" }
+        { "arg" = "@SYSTEM" }
+      }
+      { "directive" = "Order"
+        { "arg" = "deny,allow" }
+      }
+    }
+    {  }
+    { "#comment" = "All administration operations require an administrator to authenticate..." }
+    { "Limit"
+      { "arg" = "CUPS-Add-Modify-Printer" }
+      { "arg" = "CUPS-Delete-Printer" }
+      { "arg" = "CUPS-Add-Modify-Class" }
+      { "arg" = "CUPS-Delete-Class" }
+      { "arg" = "CUPS-Set-Default" }
+      { "arg" = "CUPS-Get-Devices" }
+      { "directive" = "AuthType"
+        { "arg" = "Default" }
+      }
+      { "directive" = "Require"
+        { "arg" = "user" }
+        { "arg" = "@SYSTEM" }
+      }
+      { "directive" = "Order"
+        { "arg" = "deny,allow" }
+      }
+    }
+    {  }
+    { "#comment" = "All printer operations require a printer operator to authenticate..." }
+    { "Limit"
+      { "arg" = "Pause-Printer" }
+      { "arg" = "Resume-Printer" }
+      { "arg" = "Enable-Printer" }
+      { "arg" = "Disable-Printer" }
+      { "arg" = "Pause-Printer-After-Current-Job" }
+      { "arg" = "Hold-New-Jobs" }
+      { "arg" = "Release-Held-New-Jobs" }
+      { "arg" = "Deactivate-Printer" }
+      { "arg" = "Activate-Printer" }
+      { "arg" = "Restart-Printer" }
+      { "arg" = "Shutdown-Printer" }
+      { "arg" = "Startup-Printer" }
+      { "arg" = "Promote-Job" }
+      { "arg" = "Schedule-Job-After" }
+      { "arg" = "Cancel-Jobs" }
+      { "arg" = "CUPS-Accept-Jobs" }
+      { "arg" = "CUPS-Reject-Jobs" }
+      { "directive" = "AuthType"
+        { "arg" = "Default" }
+      }
+      { "directive" = "Require"
+        { "arg" = "user" }
+        { "arg" = "@SYSTEM" }
+      }
+      { "directive" = "Order"
+        { "arg" = "deny,allow" }
+      }
+    }
+    {  }
+    { "#comment" = "Only the owner or an administrator can cancel or authenticate a job..." }
+    { "Limit"
+      { "arg" = "Cancel-Job" }
+      { "arg" = "CUPS-Authenticate-Job" }
+      { "directive" = "Require"
+        { "arg" = "user" }
+        { "arg" = "@OWNER" }
+        { "arg" = "@SYSTEM" }
+      }
+      { "directive" = "Order"
+        { "arg" = "deny,allow" }
+      }
+    }
+    {  }
+    { "Limit"
+      { "arg" = "All" }
+      { "directive" = "Order"
+        { "arg" = "deny,allow" }
+      }
+    }
+  }
+  {  }
+  { "#comment" = "Set the authenticated printer/job policies..." }
+  { "Policy"
+    { "arg" = "authenticated" }
+    { "#comment" = "Job/subscription privacy..." }
+    { "directive" = "JobPrivateAccess"
+      { "arg" = "default" }
+    }
+    { "directive" = "JobPrivateValues"
+      { "arg" = "default" }
+    }
+    { "directive" = "SubscriptionPrivateAccess"
+      { "arg" = "default" }
+    }
+    { "directive" = "SubscriptionPrivateValues"
+      { "arg" = "default" }
+    }
+    {  }
+    { "#comment" = "Job-related operations must be done by the owner or an administrator..." }
+    { "Limit"
+      { "arg" = "Create-Job" }
+      { "arg" = "Print-Job" }
+      { "arg" = "Print-URI" }
+      { "arg" = "Validate-Job" }
+      { "directive" = "AuthType"
+        { "arg" = "Default" }
+      }
+      { "directive" = "Order"
+        { "arg" = "deny,allow" }
+      }
+    }
+    {  }
+    { "Limit"
+      { "arg" = "Send-Document" }
+      { "arg" = "Send-URI" }
+      { "arg" = "Hold-Job" }
+      { "arg" = "Release-Job" }
+      { "arg" = "Restart-Job" }
+      { "arg" = "Purge-Jobs" }
+      { "arg" = "Set-Job-Attributes" }
+      { "arg" = "Create-Job-Subscription" }
+      { "arg" = "Renew-Subscription" }
+      { "arg" = "Cancel-Subscription" }
+      { "arg" = "Get-Notifications" }
+      { "arg" = "Reprocess-Job" }
+      { "arg" = "Cancel-Current-Job" }
+      { "arg" = "Suspend-Current-Job" }
+      { "arg" = "Resume-Job" }
+      { "arg" = "Cancel-My-Jobs" }
+      { "arg" = "Close-Job" }
+      { "arg" = "CUPS-Move-Job" }
+      { "arg" = "CUPS-Get-Document" }
+      { "directive" = "AuthType"
+        { "arg" = "Default" }
+      }
+      { "directive" = "Require"
+        { "arg" = "user" }
+        { "arg" = "@OWNER" }
+        { "arg" = "@SYSTEM" }
+      }
+      { "directive" = "Order"
+        { "arg" = "deny,allow" }
+      }
+    }
+    {  }
+    { "#comment" = "All administration operations require an administrator to authenticate..." }
+    { "Limit"
+      { "arg" = "CUPS-Add-Modify-Printer" }
+      { "arg" = "CUPS-Delete-Printer" }
+      { "arg" = "CUPS-Add-Modify-Class" }
+      { "arg" = "CUPS-Delete-Class" }
+      { "arg" = "CUPS-Set-Default" }
+      { "directive" = "AuthType"
+        { "arg" = "Default" }
+      }
+      { "directive" = "Require"
+        { "arg" = "user" }
+        { "arg" = "@SYSTEM" }
+      }
+      { "directive" = "Order"
+        { "arg" = "deny,allow" }
+      }
+    }
+    {  }
+    { "#comment" = "All printer operations require a printer operator to authenticate..." }
+    { "Limit"
+      { "arg" = "Pause-Printer" }
+      { "arg" = "Resume-Printer" }
+      { "arg" = "Enable-Printer" }
+      { "arg" = "Disable-Printer" }
+      { "arg" = "Pause-Printer-After-Current-Job" }
+      { "arg" = "Hold-New-Jobs" }
+      { "arg" = "Release-Held-New-Jobs" }
+      { "arg" = "Deactivate-Printer" }
+      { "arg" = "Activate-Printer" }
+      { "arg" = "Restart-Printer" }
+      { "arg" = "Shutdown-Printer" }
+      { "arg" = "Startup-Printer" }
+      { "arg" = "Promote-Job" }
+      { "arg" = "Schedule-Job-After" }
+      { "arg" = "Cancel-Jobs" }
+      { "arg" = "CUPS-Accept-Jobs" }
+      { "arg" = "CUPS-Reject-Jobs" }
+      { "directive" = "AuthType"
+        { "arg" = "Default" }
+      }
+      { "directive" = "Require"
+        { "arg" = "user" }
+        { "arg" = "@SYSTEM" }
+      }
+      { "directive" = "Order"
+        { "arg" = "deny,allow" }
+      }
+    }
+    {  }
+    { "#comment" = "Only the owner or an administrator can cancel or authenticate a job..." }
+    { "Limit"
+      { "arg" = "Cancel-Job" }
+      { "arg" = "CUPS-Authenticate-Job" }
+      { "directive" = "AuthType"
+        { "arg" = "Default" }
+      }
+      { "directive" = "Require"
+        { "arg" = "user" }
+        { "arg" = "@OWNER" }
+        { "arg" = "@SYSTEM" }
+      }
+      { "directive" = "Order"
+        { "arg" = "deny,allow" }
+      }
+    }
+    {  }
+    { "Limit"
+      { "arg" = "All" }
+      { "directive" = "Order"
+        { "arg" = "deny,allow" }
+      }
+    }
+  }
+
diff --git a/lenses/tests/test_cyrus_imapd.aug b/lenses/tests/test_cyrus_imapd.aug
new file mode 100644 (file)
index 0000000..ecb4ff1
--- /dev/null
@@ -0,0 +1,37 @@
+module Test_cyrus_imapd =
+
+let conf = "configdirectory: /var/lib/imap
+partition-default: /var/spool/imap
+admins: cyrus-admin
+sievedir: /var/lib/imap/sieve
+sendmail: /usr/sbin/sendmail
+sasl_pwcheck_method: auxprop saslauthd
+sasl_mech_list: PLAIN LOGIN
+allowplaintext: no
+tls_cert_file: /etc/pki/cyrus-imapd/cyrus-imapd.pem
+tls_key_file: /etc/pki/cyrus-imapd/cyrus-imapd.pem
+tls_ca_file: /etc/pki/tls/certs/ca-bundle.crt
+# uncomment this if you're operating in a DSCP environment (RFC-4594)
+# qosmarking: af13\n"
+
+test Cyrus_Imapd.lns get conf =
+   { "configdirectory"  = "/var/lib/imap" }
+   { "partition-default"  = "/var/spool/imap" }
+   { "admins" = "cyrus-admin" }
+   { "sievedir" = "/var/lib/imap/sieve" }
+   { "sendmail" = "/usr/sbin/sendmail"  }
+   { "sasl_pwcheck_method" = "auxprop saslauthd" }
+   { "sasl_mech_list" = "PLAIN LOGIN" }
+   { "allowplaintext" = "no" }
+   { "tls_cert_file" = "/etc/pki/cyrus-imapd/cyrus-imapd.pem" }
+   { "tls_key_file" = "/etc/pki/cyrus-imapd/cyrus-imapd.pem" }
+   { "tls_ca_file" = "/etc/pki/tls/certs/ca-bundle.crt" }
+   { "#comment" = "uncomment this if you're operating in a DSCP environment (RFC-4594)" }
+   { "#comment" = "qosmarking: af13" }
+
+test Cyrus_Imapd.lns get "admins: cyrus-admin\n"
+     =
+  { "admins" = "cyrus-admin" }
+
+test Cyrus_Imapd.lns put "" after set "munge8bit" "false" =
+  "munge8bit: false\n"
index f81d1e2..11a37e1 100644 (file)
@@ -205,3 +205,230 @@ Description: dummy2
  dummy text 2
 "
 
+(* Test Augeas' own control file *)
+let augeas_control = "Source: augeas
+Priority: optional
+Maintainer: Nicolas Valcárcel Scerpella (Canonical) <nicolas.valcarcel@canonical.com>
+Uploaders: Free Ekanayaka <freee@debian.org>, Micah Anderson <micah@debian.org>
+Build-Depends: debhelper (>= 5), autotools-dev, libreadline-dev, chrpath,
+ naturaldocs (>= 1.51-1), texlive-latex-base
+Standards-Version: 3.9.2
+Section: libs
+Homepage: http://augeas.net/
+DM-Upload-Allowed: yes
+
+Package: augeas-tools
+Section: admin
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Augeas command line tools
+ Augeas is a configuration editing tool. It parses configuration files in their
+ native formats and transforms them into a tree. Configuration changes are made
+ by manipulating this tree and saving it back into native config files.
+ .
+ This package provides command line tools based on libaugeas0:
+ - augtool, a tool to manage configuration files.
+ - augparse, a testing and debugging tool for augeas lenses.
+
+Package: libaugeas-dev
+Section: libdevel
+Architecture: any
+Depends: libaugeas0 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
+Description: Development files for writing applications based on libaugeas0
+ Augeas is a configuration editing tool. It parses configuration files in their
+ native formats and transforms them into a tree. Configuration changes are made
+ by manipulating this tree and saving it back into native config files.
+ .
+ This package includes the development files to write programs using the Augeas
+ API.
+"
+test DebCtrl.lns get augeas_control =
+  { "srcpkg"
+    { "Source" = "augeas" }
+    { "Priority" = "optional" }
+    { "Maintainer" = "Nicolas Valcárcel Scerpella (Canonical) <nicolas.valcarcel@canonical.com>" }
+    { "Uploaders"
+      { "1" = "Free Ekanayaka <freee@debian.org>" }
+      { "2" = "Micah Anderson <micah@debian.org>" }
+    }
+    { "Build-Depends"
+      { "and"
+        { "or"
+          { "debhelper"
+            { "version"
+              { "relation" = ">=" }
+              { "number" = "5" }
+            }
+          }
+        }
+      }
+      { "and"
+        { "or"
+          { "autotools-dev" }
+        }
+      }
+      { "and"
+        { "or"
+          { "libreadline-dev" }
+        }
+      }
+      { "and"
+        { "or"
+          { "chrpath" }
+        }
+      }
+      { "and"
+        { "or"
+          { "naturaldocs"
+            { "version"
+              { "relation" = ">=" }
+              { "number" = "1.51-1" }
+            }
+          }
+        }
+      }
+      { "and"
+        { "or"
+          { "texlive-latex-base" }
+        }
+      }
+    }
+    { "Standards-Version" = "3.9.2" }
+    { "Section" = "libs" }
+    { "Homepage" = "http://augeas.net/" }
+    { "DM-Upload-Allowed" = "yes" }
+  }
+  { "binpkg"
+    { "Package" = "augeas-tools" }
+    { "Section" = "admin" }
+    { "Architecture" = "any" }
+    { "Depends"
+      { "and"
+        { "or"
+          { "${shlibs:Depends}" }
+        }
+      }
+      { "and"
+        { "or"
+          { "${misc:Depends}" }
+        }
+      }
+    }
+    { "Description"
+      { "summary" = "Augeas command line tools" }
+      { "text" = "Augeas is a configuration editing tool. It parses configuration files in their" }
+      { "text" = "native formats and transforms them into a tree. Configuration changes are made" }
+      { "text" = "by manipulating this tree and saving it back into native config files." }
+      { "text" = "." }
+      { "text" = "This package provides command line tools based on libaugeas0:" }
+      { "text" = "- augtool, a tool to manage configuration files." }
+      { "text" = "- augparse, a testing and debugging tool for augeas lenses." }
+    }
+  }
+  { "binpkg"
+    { "Package" = "libaugeas-dev" }
+    { "Section" = "libdevel" }
+    { "Architecture" = "any" }
+    { "Depends"
+      { "and"
+        { "or"
+          { "libaugeas0"
+            { "version"
+              { "relation" = "=" }
+              { "number" = "${binary:Version}" }
+            }
+          }
+        }
+      }
+      { "and"
+        { "or"
+          { "${shlibs:Depends}" }
+        }
+      }
+      { "and"
+        { "or"
+          { "${misc:Depends}" }
+        }
+      }
+    }
+    { "Description"
+      { "summary" = "Development files for writing applications based on libaugeas0" }
+      { "text" = "Augeas is a configuration editing tool. It parses configuration files in their" }
+      { "text" = "native formats and transforms them into a tree. Configuration changes are made" }
+      { "text" = "by manipulating this tree and saving it back into native config files." }
+      { "text" = "." }
+      { "text" = "This package includes the development files to write programs using the Augeas" }
+      { "text" = "API." }
+    }
+  }
+
+(* Bug #267: Python module extensions, from Debian Python Policy, chapter 2 *)
+let python_control = "Source: graphite-web
+Maintainer: Will Pearson (Editure Key) <wpearson@editure.co.uk>
+Section: python
+Priority: optional
+Build-Depends: debhelper (>= 7), python-support (>= 0.8.4)
+Standards-Version: 3.7.2
+XS-Python-Version: current
+
+Package: python-graphite-web
+Architecture: all
+Depends: ${python:Depends}
+XB-Python-Version: ${python:Versions}
+Provides: ${python:Provides}
+Description: Enterprise scalable realtime graphing
+"
+test Debctrl.lns get python_control =
+  { "srcpkg"
+    { "Source" = "graphite-web" }
+    { "Maintainer" = "Will Pearson (Editure Key) <wpearson@editure.co.uk>" }
+    { "Section" = "python" }
+    { "Priority" = "optional" }
+    { "Build-Depends"
+      { "and"
+        { "or"
+          { "debhelper"
+            { "version"
+              { "relation" = ">=" }
+              { "number" = "7" }
+            }
+          }
+        }
+      }
+      { "and"
+        { "or"
+          { "python-support"
+            { "version"
+              { "relation" = ">=" }
+              { "number" = "0.8.4" }
+            }
+          }
+        }
+      }
+    }
+    { "Standards-Version" = "3.7.2" }
+    { "XS-Python-Version" = "current" }
+  }
+  { "binpkg"
+    { "Package" = "python-graphite-web" }
+    { "Architecture" = "all" }
+    { "Depends"
+      { "and"
+        { "or"
+          { "${python:Depends}" }
+        }
+      }
+    }
+    { "XB-Python-Version" = "${python:Versions}" }
+    { "Provides"
+      { "and"
+        { "or"
+          { "${python:Provides}" }
+        }
+      }
+    }
+    { "Description"
+      { "summary" = "Enterprise scalable realtime graphing" }
+    }
+  }
+
index e82cf6a..de530ae 100644 (file)
@@ -31,3 +31,17 @@ test Desktop.lns get conf =
       { "X-KDE-Library" = "libfooview" }
       { "X-KDE-FactoryName" = "fooviewfactory" }
       { "X-KDE-ServiceType" = "FooService" } }
+
+(* Entries with square brackets *)
+test Desktop.lns get "[Desktop Entry]
+X-GNOME-FullName[ca]=En canadien
+" =
+    { "Desktop Entry"
+      { "X-GNOME-FullName[ca]" = "En canadien" } }
+
+(* Test: Desktop.lns
+     Allow @ in setting (GH issue #92) *)
+test Desktop.lns get "[Desktop Entry]
+Name[sr@latin] = foobar\n" =
+    { "Desktop Entry"
+      { "Name[sr@latin]" = "foobar" } }
index 2a7810a..9b5da50 100644 (file)
@@ -21,7 +21,7 @@ module Test_device_map =
     { "128"   = "/dev/sda" }
 
   test Device_map.lns put conf after
-    set "hd2,1" "/dev/sdb1"
+    set "hd2\,1" "/dev/sdb1"
   = "# this device map was generated by anaconda
 (fd0)     /dev/fda
 (hd0)     /dev/sda
index 3fa481d..791b5ec 100644 (file)
@@ -131,3 +131,20 @@ lease {
                { "hour"    = "00" }
                { "minute"  = "00" }
                { "second"  = "01" } } }
+
+
+test Dhclient.lns get "append option domain-name-servers 127.0.0.1;\n" =
+    { "append"
+        { "option"
+            { "domain-name-servers" = "127.0.0.1" }
+        }
+    }
+
+test Dhclient.lns put "" after set "/prepend/option/domain-name-servers" "127.0.0.1" = 
+    "prepend option domain-name-servers 127.0.0.1;\n"
+
+(* When = is used before the value, it's an evaluated string, see dhcp-eval *)
+test Dhclient.lns get "send dhcp-client-identifier = hardware;\n" =
+  { "send"
+    { "dhcp-client-identifier"
+      { "#eval" = "hardware" } } }
index c1f3cee..0af337c 100644 (file)
@@ -28,6 +28,9 @@ max-lease-time 7200;
 # network, the authoritative directive should be uncommented.
 authoritative;
 
+allow booting;
+allow bootp;
+
 # Use this to send dhcp log messages to a different log file (you also
 # have to hack syslog.conf to complete the redirection).
 log-facility local7;
@@ -179,7 +182,12 @@ fixed-address 10.1.1.1;}}" =
     }
   }
 
+test lns get "group fan-tas_tic { }" =
+  { "group" = "fan-tas_tic" }
+
 test Dhcpd.stmt_secu get "allow members of \"foo\";" =  { "allow-members-of" = "foo" }
+test Dhcpd.stmt_secu get "allow booting;" =  { "allow" = "booting" }
+test Dhcpd.stmt_secu get "allow bootp;" =  { "allow" = "bootp" }
 test Dhcpd.stmt_option get "option voip-boot-server code 66 = string;" =
   { "rfc-code"
     { "label" = "voip-boot-server" }
@@ -187,6 +195,30 @@ test Dhcpd.stmt_option get "option voip-boot-server code 66 = string;" =
     { "type" = "string" }
   }
 
+test Dhcpd.stmt_option get "option special-option code 25 = array of string;" =
+  { "rfc-code"
+    { "label" = "special-option" }
+    { "code" = "25" }
+    { "type" = "array of string" }
+  }
+
+test Dhcpd.stmt_option get "option special-option code 25 = integer 32;" =
+  { "rfc-code"
+    { "label" = "special-option" }
+    { "code" = "25" }
+    { "type" = "integer 32" }
+  }
+
+
+test Dhcpd.stmt_option get "option special-option code 25 = array of integer 32;" =
+  { "rfc-code"
+    { "label" = "special-option" }
+    { "code" = "25" }
+    { "type" = "array of integer 32" }
+  }
+
+
+
 test Dhcpd.lns get "authoritative;
 log-facility local7;
 ddns-update-style none;
@@ -242,7 +274,7 @@ failover peer \"redondance01\" {
     }
   }
   { "next-server" = "10.1.1.1" }
-  { "failover peer" = "\"redondance01\""
+  { "failover peer" = "redondance01"
     { "primary" }
     { "address" = "10.1.1.1" }
     { "port" = "647" }
@@ -259,6 +291,26 @@ failover peer \"redondance01\" {
     { "load balance max seconds" = "3" }
   }
 
+
+(* test get and put for record types *)
+let record_test = "option test_records code 123 = { string, ip-address, integer 32, ip6-address, domain-list };"
+
+test Dhcpd.lns get record_test =
+ { "rfc-code"
+   { "label" = "test_records" }
+   { "code" = "123" }
+     { "record"
+        { "1" = "string" }
+        { "2" = "ip-address" }
+        { "3" = "integer 32" }
+        { "4" = "ip6-address" }
+        { "5" = "domain-list" }
+     }
+ }
+
+test Dhcpd.lns put record_test after set "/rfc-code[1]/code" "124" = 
+  "option test_records code 124 = { string, ip-address, integer 32, ip6-address, domain-list };"
+
 test Dhcpd.lns get "
 option CallManager code 150 = ip-address;
 option slp-directory-agent true 10.1.1.1, 10.2.2.2;
@@ -334,6 +386,25 @@ test Dhcpd.stmt_match get "match if substring (option dhcp-client-identifier, 1,
     { "value" = "RAS" }
   }
 
+test Dhcpd.stmt_match get "match if suffix (option dhcp-client-identifier, 4) = \"RAS\";" =
+  { "match"
+    { "function" = "suffix"
+      { "args"
+        { "arg" = "option dhcp-client-identifier" }
+        { "arg" = "4" }
+      }
+    }
+    { "value" = "RAS" }
+  }
+
+test Dhcpd.stmt_match get "match if option vendor-class-identifier=\"RAS\";" =
+  { "match"
+    { "option" = "vendor-class-identifier"
+      { "value" = "RAS" }
+    }
+  }
+
+
 test Dhcpd.lns get "match pick-first-value (option dhcp-client-identifier, hardware);" =
   { "match"
     { "function" = "pick-first-value"
@@ -365,11 +436,171 @@ test Dhcpd.stmt_match get "match if binary-to-ascii(16, 32, \"\", substring(hard
     { "value" = "1525400" }
   }
 
+test Dhcpd.lns get "subclass allocation-class-1 1:8:0:2b:4c:39:ad;" =
+  { "subclass"
+    { "name" = "allocation-class-1" }
+    { "value" = "1:8:0:2b:4c:39:ad" }
+  }
+
+
 test Dhcpd.lns get "subclass \"allocation-class-1\" 1:8:0:2b:4c:39:ad;" =
   { "subclass"
     { "name" = "allocation-class-1" }
     { "value" = "1:8:0:2b:4c:39:ad" }
   }
 
+test Dhcpd.lns get "subclass \"quoted class\" \"quoted value\";" =
+  { "subclass"
+    { "name" = "quoted class" }
+    { "value" = "quoted value" }
+  }
+
+
 (* overall test *)
 test Dhcpd.lns put conf after rm "/x" = conf
+
+(* bug #293: primary should support argument *)
+let input293 = "zone EXAMPLE.ORG. {
+  primary 127.0.0.1;
+}"
+
+test Dhcpd.lns get input293 = 
+  { "zone" = "EXAMPLE.ORG."
+    { "primary" = "127.0.0.1" }
+  }
+
+(* bug #311: filename should be quoted *)
+let input311 = "subnet 172.16.0.0 netmask 255.255.255.0 {
+filename \"pxelinux.0\";
+}"
+
+test Dhcpd.lns put "subnet 172.16.0.0 netmask 255.255.255.0 {
+}" after
+  set "subnet/filename" "pxelinux.0" = input311
+
+(* GH issue #34: support conditional structures *)
+let gh34_empty = "if exists dhcp-parameter-request-list {
+}\n"
+
+test Dhcpd.lns get gh34_empty =
+  { "@if" = "exists dhcp-parameter-request-list" }
+
+let gh34_empty_multi = "subnet 192.168.100.0 netmask 255.255.255.0 {
+ if true {
+ } elsif false {
+ } else {
+ }
+}\n"
+
+test Dhcpd.lns get gh34_empty_multi =
+  { "subnet"
+    { "network" = "192.168.100.0" }
+    { "netmask" = "255.255.255.0" }
+    { "@if" = "true"
+      { "@elsif" = "false" }
+      { "@else" } }
+  }
+
+let gh34_simple = "if exists dhcp-parameter-request-list {
+  default-lease-time 600;
+  } else {
+default-lease-time 200;
+}\n"
+
+test Dhcpd.lns get gh34_simple =
+  { "@if" = "exists dhcp-parameter-request-list"
+    { "default-lease-time" = "600" }
+    { "@else"
+      { "default-lease-time" = "200" } } }
+
+test Dhcpd.lns get "omapi-key fookey;" =
+  { "omapi-key" = "fookey" }
+
+(* almost all DHCP groups should support braces starting on the next line *)
+test Dhcpd.lns get "class introduction
+{
+}" =
+  { "class" = "introduction" }
+
+(* equals should work the same *)
+test Dhcpd.lns get "option test_records code 123 =
+                             string;" =
+ { "rfc-code"
+   { "label" = "test_records" }
+   { "code" = "123" }
+   { "type" = "string" }
+ }
+
+test Dhcpd.lns get "deny members of \"Are things like () allowed?\";" =
+  { "deny-members-of" = "Are things like () allowed?" }
+
+test Dhcpd.lns get "deny unknown clients;" =
+  { "deny" = "unknown clients" }
+test Dhcpd.lns get "deny known-clients;" =
+  { "deny" = "known-clients" }
+
+test Dhcpd.lns get "set ClientMac = binary-to-ascii(16, 8, \":\" , substring(hardware, 1, 6));" =
+  { "set" = "ClientMac"
+    { "value" = "binary-to-ascii(16, 8, \":\" , substring(hardware, 1, 6))" }
+  }
+
+test Dhcpd.lns get "set myvariable = foo;" =
+  { "set" = "myvariable"
+    { "value" = "foo" }
+  }
+
+test Dhcpd.stmt_hardware get "hardware fddi 00:01:02:03:04:05;" =
+  { "hardware"
+    { "type" = "fddi" }
+    { "address" = "00:01:02:03:04:05" }
+  }
+
+test Dhcpd.lns get "on commit
+{
+  set test = thing;
+}" =
+  { "on" = "commit"
+    { "set" = "test"
+      { "value" = "thing" }
+    }
+  }
+
+(* key block get/put/set test *)
+let key_tests = "key sample {
+    algorithm hmac-md5;
+    secret \"secret==\";
+}
+
+key \"interesting\" { };
+
+key \"third key\" {
+    secret \"two==\";
+}"
+
+test Dhcpd.lns get key_tests =
+  { "key_block" = "sample"
+    { "algorithm"  = "hmac-md5" }
+    { "secret" = "secret==" }
+  }
+  { "key_block" = "interesting" }
+  { "key_block" = "third key"
+    { "secret" = "two==" }
+  }
+
+test Dhcpd.lns put key_tests after set "/key_block[1]" "sample2" =
+  "key sample2 {
+    algorithm hmac-md5;
+    secret \"secret==\";
+}
+
+key \"interesting\" { };
+
+key \"third key\" {
+    secret \"two==\";
+}"
+
+test Dhcpd.lns get "group \"hello\" { }" =
+  { "group" = "hello" }
+
+test Dhcpd.lns get "class \"testing class with spaces and quotes and ()\" {}" =
+  { "class" = "testing class with spaces and quotes and ()" }
diff --git a/lenses/tests/test_dovecot.aug b/lenses/tests/test_dovecot.aug
new file mode 100644 (file)
index 0000000..33ea16f
--- /dev/null
@@ -0,0 +1,886 @@
+(*
+Module: Test_Dovecot
+  Provides unit tests and examples for the <Dovecot> lens.
+*)
+
+module Test_Dovecot =
+
+(* *********************** /etc/dovecot.conf ******************************** *)
+
+let dovecot_conf = "# Dovecot configuration file
+
+# If you're in a hurry, see http://wiki2.dovecot.org/QuickConfiguration
+
+# Default values are shown for each setting, it's not required to uncomment
+# those. These are exceptions to this though: No sections (e.g. namespace {})
+# or plugin settings are added by default, they're listed only as examples.
+# Paths are also just examples with the real defaults being based on configure
+# options. The paths listed here are for configure --prefix=/usr
+# --sysconfdir=/etc --localstatedir=/var
+
+# include_try command
+!include_try /usr/share/dovecot/protocols.d/*.protocol
+
+# Wildcard, comma and space in value
+listen = *, ::
+
+# Filesystem path in value
+base_dir = /var/run/dovecot/
+instance_name = dovecot
+
+# Space and dot in value
+login_greeting = Dovecot ready.
+
+# Empty values
+login_trusted_networks =
+login_access_sockets = 
+
+# Simple values
+verbose_proctitle = no
+shutdown_clients = yes
+
+# Number in value
+doveadm_worker_count = 0
+# Dash in value
+doveadm_socket_path = doveadm-server
+
+import_environment = TZ
+
+##
+## Comment
+##
+
+# Simple commented dict block
+dict {
+  #quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
+  #expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext
+}
+
+# Simple uncommented dict block
+dict {
+  quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
+  expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext
+}
+
+# Include command
+!include conf.d/*.conf
+
+# Include_try command
+!include_try local.conf
+
+"
+
+test Dovecot.lns get dovecot_conf =  
+  { "#comment" = "Dovecot configuration file" }
+  {  }
+  { "#comment" = "If you're in a hurry, see http://wiki2.dovecot.org/QuickConfiguration" }
+  {  }
+  { "#comment" = "Default values are shown for each setting, it's not required to uncomment" }
+  { "#comment" = "those. These are exceptions to this though: No sections (e.g. namespace {})" }
+  { "#comment" = "or plugin settings are added by default, they're listed only as examples." }
+  { "#comment" = "Paths are also just examples with the real defaults being based on configure" }
+  { "#comment" = "options. The paths listed here are for configure --prefix=/usr" }
+  { "#comment" = "--sysconfdir=/etc --localstatedir=/var" }
+  {  }
+  { "#comment" = "include_try command" }
+  { "include_try" = "/usr/share/dovecot/protocols.d/*.protocol" }
+  {  }
+  { "#comment" = "Wildcard, comma and space in value" }
+  { "listen" = "*, ::" }
+  {  }
+  { "#comment" = "Filesystem path in value" }
+  { "base_dir" = "/var/run/dovecot/" }
+  { "instance_name" = "dovecot" }
+  {  }
+  { "#comment" = "Space and dot in value" }
+  { "login_greeting" = "Dovecot ready." }
+  {  }
+  { "#comment" = "Empty values" }
+  { "login_trusted_networks" }
+  { "login_access_sockets" }
+  {  }
+  { "#comment" = "Simple values" }
+  { "verbose_proctitle" = "no" }
+  { "shutdown_clients" = "yes" }
+  {  }
+  { "#comment" = "Number in value" }
+  { "doveadm_worker_count" = "0" }
+  { "#comment" = "Dash in value" }
+  { "doveadm_socket_path" = "doveadm-server" }
+  {  }
+  { "import_environment" = "TZ" }
+  {  }
+  { "#comment" = "#" }
+  { "#comment" = "# Comment" }
+  { "#comment" = "#" }
+  {  }
+  { "#comment" = "Simple commented dict block" }
+  { "dict"
+    { "#comment" = "quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext" }
+    { "#comment" = "expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext" }
+  }
+  {  }
+  { "#comment" = "Simple uncommented dict block" }
+  { "dict"
+    { "quota" = "mysql:/etc/dovecot/dovecot-dict-sql.conf.ext" }
+    { "expire" = "sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext" }
+  }
+  {  }
+  { "#comment" = "Include command" }
+  { "include" = "conf.d/*.conf" }
+  {  }
+  { "#comment" = "Include_try command" }
+  { "include_try" = "local.conf" }
+  {  }
+
+
+
+(* *********************************** dict ********************************* *)
+
+let dovecot_dict_sql_conf = "connect = host=localhost dbname=mails user=testuser password=pass
+
+# CREATE TABLE quota (
+#   username varchar(100) not null,
+#   bytes bigint not null default 0,
+#   messages integer not null default 0,
+#   primary key (username)
+# );
+
+map {
+  pattern = priv/quota/storage
+  table = quota
+  username_field = username
+  value_field = bytes
+}
+map {
+  pattern = priv/quota/messages
+  table = quota
+  username_field = username
+  value_field = messages
+}
+
+# CREATE TABLE expires (
+#   username varchar(100) not null,
+#   mailbox varchar(255) not null,
+#   expire_stamp integer not null,
+#   primary key (username, mailbox)
+# );
+
+map {
+  pattern = shared/expire/$user/$mailbox
+  table = expires
+  value_field = expire_stamp
+
+  fields {
+    username = $user
+    mailbox = $mailbox
+  }
+}
+"
+
+test Dovecot.lns get dovecot_dict_sql_conf =
+  { "connect" = "host=localhost dbname=mails user=testuser password=pass" }
+  {  }
+  { "#comment" = "CREATE TABLE quota (" }
+  { "#comment" = "username varchar(100) not null," }
+  { "#comment" = "bytes bigint not null default 0," }
+  { "#comment" = "messages integer not null default 0," }
+  { "#comment" = "primary key (username)" }
+  { "#comment" = ");" }
+  {  }
+  { "map"
+    { "pattern" = "priv/quota/storage" }
+    { "table" = "quota" }
+    { "username_field" = "username" }
+    { "value_field" = "bytes" }
+  }
+  { "map"
+    { "pattern" = "priv/quota/messages" }
+    { "table" = "quota" }
+    { "username_field" = "username" }
+    { "value_field" = "messages" }
+  }
+  {  }
+  { "#comment" = "CREATE TABLE expires (" }
+  { "#comment" = "username varchar(100) not null," }
+  { "#comment" = "mailbox varchar(255) not null," }
+  { "#comment" = "expire_stamp integer not null," }
+  { "#comment" = "primary key (username, mailbox)" }
+  { "#comment" = ");" }
+  {  }
+  { "map"
+    { "pattern" = "shared/expire/$user/$mailbox" }
+    { "table" = "expires" }
+    { "value_field" = "expire_stamp" }
+    {  }
+    { "fields"
+      { "username" = "$user" }
+      { "mailbox" = "$mailbox" }
+    }
+  }
+
+(* ********************************** auth ********************************** *)
+
+let auth_conf = "## Authentication processes
+
+disable_plaintext_auth = yes
+auth_cache_size = 0
+auth_cache_ttl = 1 hour
+auth_cache_negative_ttl = 1 hour
+auth_realms =
+auth_default_realm = 
+auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@
+auth_username_translation =
+auth_username_format =
+auth_master_user_separator =
+auth_anonymous_username = anonymous
+auth_worker_max_count = 30
+auth_gssapi_hostname =
+auth_krb5_keytab = 
+auth_use_winbind = no
+auth_winbind_helper_path = /usr/bin/ntlm_auth
+auth_failure_delay = 2 secs
+auth_ssl_require_client_cert = no
+auth_ssl_username_from_cert = no
+auth_mechanisms = plain
+
+!include auth-deny.conf.ext
+!include auth-master.conf.ext
+!include auth-system.conf.ext
+!include auth-sql.conf.ext
+!include auth-ldap.conf.ext
+!include auth-passwdfile.conf.ext
+!include auth-checkpassword.conf.ext
+!include auth-vpopmail.conf.ext
+!include auth-static.conf.ext
+
+passdb {
+  driver = passwd-file
+  deny = yes
+
+  # File contains a list of usernames, one per line
+  args = /etc/dovecot/deny-users
+}
+
+passdb {
+  driver = passwd-file
+  master = yes
+  args = /etc/dovecot/master-users
+
+  # Unless you're using PAM, you probably still want the destination user to
+  # be looked up from passdb that it really exists. pass=yes does that.
+  pass = yes
+}
+
+userdb {
+  driver = passwd-file
+  args = username_format=%u /etc/dovecot/users
+}
+"
+
+test Dovecot.lns get auth_conf =
+  { "#comment" = "# Authentication processes" }
+  {  }
+  { "disable_plaintext_auth" = "yes" }
+  { "auth_cache_size" = "0" }
+  { "auth_cache_ttl" = "1 hour" }
+  { "auth_cache_negative_ttl" = "1 hour" }
+  { "auth_realms" }
+  { "auth_default_realm" }
+  { "auth_username_chars" = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@" }
+  { "auth_username_translation" }
+  { "auth_username_format" }
+  { "auth_master_user_separator" }
+  { "auth_anonymous_username" = "anonymous" }
+  { "auth_worker_max_count" = "30" }
+  { "auth_gssapi_hostname" }
+  { "auth_krb5_keytab" }
+  { "auth_use_winbind" = "no" }
+  { "auth_winbind_helper_path" = "/usr/bin/ntlm_auth" }
+  { "auth_failure_delay" = "2 secs" }
+  { "auth_ssl_require_client_cert" = "no" }
+  { "auth_ssl_username_from_cert" = "no" }
+  { "auth_mechanisms" = "plain" }
+  {  }
+  { "include" = "auth-deny.conf.ext" }
+  { "include" = "auth-master.conf.ext" }
+  { "include" = "auth-system.conf.ext" }
+  { "include" = "auth-sql.conf.ext" }
+  { "include" = "auth-ldap.conf.ext" }
+  { "include" = "auth-passwdfile.conf.ext" }
+  { "include" = "auth-checkpassword.conf.ext" }
+  { "include" = "auth-vpopmail.conf.ext" }
+  { "include" = "auth-static.conf.ext" }
+  {  }
+  { "passdb"
+    { "driver" = "passwd-file" }
+    { "deny" = "yes" }
+    {  }
+    { "#comment" = "File contains a list of usernames, one per line" }
+    { "args" = "/etc/dovecot/deny-users" }
+  }
+  {  }
+  { "passdb"
+    { "driver" = "passwd-file" }
+    { "master" = "yes" }
+    { "args" = "/etc/dovecot/master-users" }
+    {  }
+    { "#comment" = "Unless you're using PAM, you probably still want the destination user to" }
+    { "#comment" = "be looked up from passdb that it really exists. pass=yes does that." }
+    { "pass" = "yes" }
+  }
+  {  }
+  { "userdb"
+    { "driver" = "passwd-file" }
+    { "args" = "username_format=%u /etc/dovecot/users" }
+  }
+
+(* ******************************** director ******************************** *)
+
+let director_conf = "## Director-specific settings.
+director_servers = 
+director_mail_servers = 
+director_user_expire = 15 min
+director_doveadm_port = 0
+
+service director {
+  unix_listener login/director {
+    mode = 0666
+  }
+  fifo_listener login/proxy-notify {
+    mode = 0666
+  }
+  unix_listener director-userdb {
+    #mode = 0600
+  }
+  inet_listener {
+    port = 
+  }
+}
+
+service imap-login {
+  executable = imap-login director
+}
+service pop3-login {
+  executable = pop3-login director
+}
+protocol lmtp {
+  auth_socket_path = director-userdb
+}
+"
+
+test Dovecot.lns get director_conf =
+  { "#comment" = "# Director-specific settings." }
+  { "director_servers" }
+  { "director_mail_servers" }
+  { "director_user_expire" = "15 min" }
+  { "director_doveadm_port" = "0" }
+  {  }
+  { "service" = "director"
+    { "unix_listener" = "login/director"
+      { "mode" = "0666" }
+    }
+    { "fifo_listener" = "login/proxy-notify"
+      { "mode" = "0666" }
+    }
+    { "unix_listener" = "director-userdb"
+      { "#comment" = "mode = 0600" }
+    }
+    { "inet_listener"
+      { "port" }
+    }
+  }
+  {  }
+  { "service" = "imap-login"
+    { "executable" = "imap-login director" }
+  }
+  { "service" = "pop3-login"
+    { "executable" = "pop3-login director" }
+  }
+  { "protocol" = "lmtp"
+    { "auth_socket_path" = "director-userdb" }
+  }
+
+(* ********************************* logging ******************************** *)
+
+let logging_conf = "## Log destination.
+log_path = syslog
+info_log_path = 
+debug_log_path = 
+syslog_facility = mail
+auth_verbose = no
+auth_verbose_passwords = no
+auth_debug = no
+auth_debug_passwords = no
+mail_debug = no
+verbose_ssl = no
+
+plugin {
+  mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename
+  mail_log_fields = uid box msgid size
+}
+
+log_timestamp = \"%b %d %H:%M:%S \"
+login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c
+login_log_format = %$: %s
+mail_log_prefix = \"%s(%u): \"
+deliver_log_format = msgid=%m: %$
+"
+
+test Dovecot.lns get logging_conf =
+  { "#comment" = "# Log destination." }
+  { "log_path" = "syslog" }
+  { "info_log_path" }
+  { "debug_log_path" }
+  { "syslog_facility" = "mail" }
+  { "auth_verbose" = "no" }
+  { "auth_verbose_passwords" = "no" }
+  { "auth_debug" = "no" }
+  { "auth_debug_passwords" = "no" }
+  { "mail_debug" = "no" }
+  { "verbose_ssl" = "no" }
+  {  }
+  { "plugin"
+    { "mail_log_events" = "delete undelete expunge copy mailbox_delete mailbox_rename" }
+    { "mail_log_fields" = "uid box msgid size" }
+  }
+  {  }
+  { "log_timestamp" = "\"%b %d %H:%M:%S \"" }
+  { "login_log_format_elements" = "user=<%u> method=%m rip=%r lip=%l mpid=%e %c" }
+  { "login_log_format" = "%$: %s" }
+  { "mail_log_prefix" = "\"%s(%u): \"" }
+  { "deliver_log_format" = "msgid=%m: %$" }
+
+
+(* ********************************** mail ********************************** *)
+
+let mail_conf = "## Mailbox locations and namespaces
+mail_location = 
+namespace {
+  type = private
+  separator = 
+  prefix = 
+  location =
+  inbox = no
+  hidden = no
+  list = yes
+  subscriptions = yes
+  mailbox \"Sent Messages\" {
+    special_use = \Sent
+  }
+}
+
+# Example shared namespace configuration
+namespace {
+  type = shared
+  separator = /
+  prefix = shared/%%u/
+  location = maildir:%%h/Maildir:INDEX=~/Maildir/shared/%%u
+  subscriptions = no
+  list = children
+}
+
+mail_uid =
+mail_gid =
+mail_privileged_group =
+mail_access_groups =
+mail_full_filesystem_access = no
+mmap_disable = no
+dotlock_use_excl = yes
+mail_fsync = optimized
+mail_nfs_storage = no
+mail_nfs_index = no
+lock_method = fcntl
+mail_temp_dir = /tmp
+first_valid_uid = 500
+last_valid_uid = 0
+first_valid_gid = 1
+last_valid_gid = 0
+mail_max_keyword_length = 50
+valid_chroot_dirs = 
+mail_chroot = 
+auth_socket_path = /var/run/dovecot/auth-userdb
+mail_plugin_dir = /usr/lib/dovecot/modules
+mail_plugins = 
+mail_cache_min_mail_count = 0
+mailbox_idle_check_interval = 30 secs
+mail_save_crlf = no
+maildir_stat_dirs = no
+maildir_copy_with_hardlinks = yes
+maildir_very_dirty_syncs = no
+mbox_read_locks = fcntl
+mbox_write_locks = dotlock fcntl
+mbox_lock_timeout = 5 mins
+mbox_dotlock_change_timeout = 2 mins
+mbox_dirty_syncs = yes
+mbox_very_dirty_syncs = no
+mbox_lazy_writes = yes
+mbox_min_index_size = 0
+mdbox_rotate_size = 2M
+mdbox_rotate_interval = 0
+mdbox_preallocate_space = no
+mail_attachment_dir =
+mail_attachment_min_size = 128k
+mail_attachment_fs = sis posix
+mail_attachment_hash = %{sha1}
+"
+test Dovecot.lns get mail_conf =
+  { "#comment" = "# Mailbox locations and namespaces" }
+  { "mail_location" }
+  { "namespace"
+    { "type" = "private" }
+    { "separator" }
+    { "prefix" }
+    { "location" }
+    { "inbox" = "no" }
+    { "hidden" = "no" }
+    { "list" = "yes" }
+    { "subscriptions" = "yes" }
+    { "mailbox" = "Sent Messages" 
+      { "special_use" = "\Sent" }
+    }
+  }
+  {  }
+  { "#comment" = "Example shared namespace configuration" }
+  { "namespace"
+    { "type" = "shared" }
+    { "separator" = "/" }
+    { "prefix" = "shared/%%u/" }
+    { "location" = "maildir:%%h/Maildir:INDEX=~/Maildir/shared/%%u" }
+    { "subscriptions" = "no" }
+    { "list" = "children" }
+  }
+  {  }
+  { "mail_uid" }
+  { "mail_gid" }
+  { "mail_privileged_group" }
+  { "mail_access_groups" }
+  { "mail_full_filesystem_access" = "no" }
+  { "mmap_disable" = "no" }
+  { "dotlock_use_excl" = "yes" }
+  { "mail_fsync" = "optimized" }
+  { "mail_nfs_storage" = "no" }
+  { "mail_nfs_index" = "no" }
+  { "lock_method" = "fcntl" }
+  { "mail_temp_dir" = "/tmp" }
+  { "first_valid_uid" = "500" }
+  { "last_valid_uid" = "0" }
+  { "first_valid_gid" = "1" }
+  { "last_valid_gid" = "0" }
+  { "mail_max_keyword_length" = "50" }
+  { "valid_chroot_dirs" }
+  { "mail_chroot" }
+  { "auth_socket_path" = "/var/run/dovecot/auth-userdb" }
+  { "mail_plugin_dir" = "/usr/lib/dovecot/modules" }
+  { "mail_plugins" }
+  { "mail_cache_min_mail_count" = "0" }
+  { "mailbox_idle_check_interval" = "30 secs" }
+  { "mail_save_crlf" = "no" }
+  { "maildir_stat_dirs" = "no" }
+  { "maildir_copy_with_hardlinks" = "yes" }
+  { "maildir_very_dirty_syncs" = "no" }
+  { "mbox_read_locks" = "fcntl" }
+  { "mbox_write_locks" = "dotlock fcntl" }
+  { "mbox_lock_timeout" = "5 mins" }
+  { "mbox_dotlock_change_timeout" = "2 mins" }
+  { "mbox_dirty_syncs" = "yes" }
+  { "mbox_very_dirty_syncs" = "no" }
+  { "mbox_lazy_writes" = "yes" }
+  { "mbox_min_index_size" = "0" }
+  { "mdbox_rotate_size" = "2M" }
+  { "mdbox_rotate_interval" = "0" }
+  { "mdbox_preallocate_space" = "no" }
+  { "mail_attachment_dir" }
+  { "mail_attachment_min_size" = "128k" }
+  { "mail_attachment_fs" = "sis posix" }
+  { "mail_attachment_hash" = "%{sha1}" }
+
+
+(* ********************************* master ********************************* *)
+
+let master_conf = "
+default_process_limit = 100
+default_client_limit = 1000
+default_vsz_limit = 256M
+default_login_user = dovenull
+default_internal_user = dovecot
+
+service imap-login {
+  inet_listener imap {
+    port = 143
+  }
+  inet_listener imaps {
+    port = 993
+    ssl = yes
+  }
+  service_count = 1
+  process_min_avail = 0
+  vsz_limit = 64M
+}
+
+service pop3-login {
+  inet_listener pop3 {
+    port = 110
+  }
+  inet_listener pop3s {
+    port = 995
+    ssl = yes
+  }
+}
+
+service lmtp {
+  unix_listener lmtp {
+    mode = 0666
+  }
+  inet_listener lmtp {
+    address =
+    port = 
+  }
+}
+
+service imap {
+  vsz_limit = 256M
+  process_limit = 1024
+}
+
+service auth {
+  unix_listener auth-userdb {
+    mode = 0600
+    user = 
+    group = 
+  }
+}
+
+service auth-worker {
+  user = root
+}
+
+service dict {
+  unix_listener dict {
+    mode = 0600
+    user = 
+    group = 
+  }
+}
+"
+
+test Dovecot.lns get master_conf =
+  {  }
+  { "default_process_limit" = "100" }
+  { "default_client_limit" = "1000" }
+  { "default_vsz_limit" = "256M" }
+  { "default_login_user" = "dovenull" }
+  { "default_internal_user" = "dovecot" }
+  {  }
+  { "service" = "imap-login"
+    { "inet_listener" = "imap"
+      { "port" = "143" }
+    }
+    { "inet_listener" = "imaps"
+      { "port" = "993" }
+      { "ssl" = "yes" }
+    }
+    { "service_count" = "1" }
+    { "process_min_avail" = "0" }
+    { "vsz_limit" = "64M" }
+  }
+  {  }
+  { "service" = "pop3-login"
+    { "inet_listener" = "pop3"
+      { "port" = "110" }
+    }
+    { "inet_listener" = "pop3s"
+      { "port" = "995" }
+      { "ssl" = "yes" }
+    }
+  }
+  {  }
+  { "service" = "lmtp"
+    { "unix_listener" = "lmtp"
+      { "mode" = "0666" }
+    }
+    { "inet_listener" = "lmtp"
+      { "address" }
+      { "port" }
+    }
+  }
+  {  }
+  { "service" = "imap"
+    { "vsz_limit" = "256M" }
+    { "process_limit" = "1024" }
+  }
+  {  }
+  { "service" = "auth"
+    { "unix_listener" = "auth-userdb"
+      { "mode" = "0600" }
+      { "user" }
+      { "group" }
+    }
+  }
+  {  }
+  { "service" = "auth-worker"
+    { "user" = "root" }
+  }
+  {  }
+  { "service" = "dict"
+    { "unix_listener" = "dict"
+      { "mode" = "0600" }
+      { "user" }
+      { "group" }
+    }
+  }
+
+(* *********************************** ssl ********************************** *)
+
+let ssl_conf = "## SSL settings
+ssl = yes
+ssl_cert = </etc/ssl/certs/dovecot.pem
+ssl_key = </etc/ssl/private/dovecot.pem
+ssl_key_password =
+ssl_ca = 
+ssl_verify_client_cert = no
+ssl_cert_username_field = commonName
+ssl_parameters_regenerate = 168
+ssl_cipher_list = ALL:!LOW:!SSLv2:!EXP:!aNULL
+"
+test Dovecot.lns get ssl_conf =
+  { "#comment" = "# SSL settings" }
+  { "ssl" = "yes" }
+  { "ssl_cert" = "</etc/ssl/certs/dovecot.pem" }
+  { "ssl_key" = "</etc/ssl/private/dovecot.pem" }
+  { "ssl_key_password" }
+  { "ssl_ca" }
+  { "ssl_verify_client_cert" = "no" }
+  { "ssl_cert_username_field" = "commonName" }
+  { "ssl_parameters_regenerate" = "168" }
+  { "ssl_cipher_list" = "ALL:!LOW:!SSLv2:!EXP:!aNULL" }
+
+(* ********************* /etc/dovecot/conf.d/15-lda.conf ******************** *)
+
+let lda_conf = "## LDA specific settings (also used by LMTP)
+postmaster_address =
+hostname = 
+quota_full_tempfail = no
+sendmail_path = /usr/sbin/sendmail
+submission_host =
+rejection_subject = Rejected: %s
+rejection_reason = Your message to <%t> was automatically rejected:%n%r
+recipient_delimiter = +
+lda_original_recipient_header =
+lda_mailbox_autocreate = no
+lda_mailbox_autosubscribe = no
+
+protocol lda {
+  mail_plugins = $mail_plugins
+}
+"
+test Dovecot.lns get lda_conf =
+  { "#comment" = "# LDA specific settings (also used by LMTP)" }
+  { "postmaster_address" }
+  { "hostname" }
+  { "quota_full_tempfail" = "no" }
+  { "sendmail_path" = "/usr/sbin/sendmail" }
+  { "submission_host" }
+  { "rejection_subject" = "Rejected: %s" }
+  { "rejection_reason" = "Your message to <%t> was automatically rejected:%n%r" }
+  { "recipient_delimiter" = "+" }
+  { "lda_original_recipient_header" }
+  { "lda_mailbox_autocreate" = "no" }
+  { "lda_mailbox_autosubscribe" = "no" }
+  {  }
+  { "protocol" = "lda"
+    { "mail_plugins" = "$mail_plugins" }
+  }
+
+(* *********************************** acl ********************************** *)
+
+let acl_conf = "## Mailbox access control lists.
+plugin {
+  acl = vfile:/etc/dovecot/global-acls:cache_secs=300
+}
+plugin {
+  acl_shared_dict = file:/var/lib/dovecot/shared-mailboxes
+}
+"
+
+test Dovecot.lns get acl_conf =
+  { "#comment" = "# Mailbox access control lists." }
+  { "plugin"
+    { "acl" = "vfile:/etc/dovecot/global-acls:cache_secs=300" }
+  }
+  { "plugin"
+    { "acl_shared_dict" = "file:/var/lib/dovecot/shared-mailboxes" }
+  }
+
+(* ******************************** plugins ********************************* *)
+
+let plugins_conf = "
+plugin {
+  quota_rule = *:storage=1G
+  quota_rule2 = Trash:storage=+100M
+}
+plugin {
+  quota_warning = storage=95%% quota-warning 95 %u
+  quota_warning2 = storage=80%% quota-warning 80 %u
+}
+service quota-warning {
+  executable = script /usr/local/bin/quota-warning.sh
+  user = dovecot
+  unix_listener quota-warning {
+    user = vmail
+  }
+}
+plugin {
+  quota = dirsize:User quota
+  quota = maildir:User quota
+  quota = dict:User quota::proxy::quota
+  quota = fs:User quota
+}
+plugin {
+  quota = dict:user::proxy::quota
+  quota2 = dict:domain:%d:proxy::quota_domain
+  quota_rule = *:storage=102400
+  quota2_rule = *:storage=1048576
+}
+plugin {
+  acl = vfile:/etc/dovecot/global-acls:cache_secs=300
+}
+plugin {
+  acl_shared_dict = file:/var/lib/dovecot/shared-mailboxes
+}
+"
+test Dovecot.lns get plugins_conf =
+  {  }
+  { "plugin"
+    { "quota_rule" = "*:storage=1G" }
+    { "quota_rule2" = "Trash:storage=+100M" }
+  }
+  { "plugin"
+    { "quota_warning" = "storage=95%% quota-warning 95 %u" }
+    { "quota_warning2" = "storage=80%% quota-warning 80 %u" }
+  }
+  { "service" = "quota-warning"
+    { "executable" = "script /usr/local/bin/quota-warning.sh" }
+    { "user" = "dovecot" }
+    { "unix_listener" = "quota-warning"
+      { "user" = "vmail" }
+    }
+  }
+  { "plugin"
+    { "quota" = "dirsize:User quota" }
+    { "quota" = "maildir:User quota" }
+    { "quota" = "dict:User quota::proxy::quota" }
+    { "quota" = "fs:User quota" }
+  }
+  { "plugin"
+    { "quota" = "dict:user::proxy::quota" }
+    { "quota2" = "dict:domain:%d:proxy::quota_domain" }
+    { "quota_rule" = "*:storage=102400" }
+    { "quota2_rule" = "*:storage=1048576" }
+  }
+  { "plugin"
+    { "acl" = "vfile:/etc/dovecot/global-acls:cache_secs=300" }
+  }
+  { "plugin"
+    { "acl_shared_dict" = "file:/var/lib/dovecot/shared-mailboxes" }
+  }
diff --git a/lenses/tests/test_erlang.aug b/lenses/tests/test_erlang.aug
new file mode 100644 (file)
index 0000000..5560a71
--- /dev/null
@@ -0,0 +1,78 @@
+(*
+Module: Test_Erlang
+  Provides unit tests and examples for the <Erlang> lens.
+*)
+module Test_Erlang =
+
+(* Group: comments *)
+test Erlang.comment get "% This is a comment\n" =
+  { "#comment" = "This is a comment" }
+
+(* Group: simple values *)
+
+let value_bare = Erlang.value Rx.word Erlang.bare
+
+test value_bare get "{foo, bar}" = { "foo" = "bar" }
+
+let value_decimal = Erlang.value Rx.word Erlang.decimal
+
+test value_bare get "{foo, 0.25}" = { "foo" = "0.25" }
+
+let value_quoted = Erlang.value Rx.word Erlang.quoted
+
+test value_quoted get "{foo, '0.25'}" = { "foo" = "0.25" }
+
+let value_glob = Erlang.value Rx.word Erlang.glob
+
+test value_glob get "{foo, <<\".*\">>}" = { "foo" = ".*" }
+
+let value_boolean = Erlang.value Rx.word Erlang.boolean
+
+test value_boolean get "{foo, false}" = { "foo" = "false" }
+
+
+(* Group: list values *)
+
+let list_bare = Erlang.value_list Rx.word Erlang.bare
+
+test list_bare get "{foo, [bar, baz]}" =
+  { "foo"
+    { "value" = "bar" }
+    { "value" = "baz" } }
+
+(* Group: tuple values *)
+
+let tuple_bare = Erlang.tuple Erlang.bare Erlang.bare
+
+test tuple_bare get "{foo, bar}" =
+  { "tuple"
+    { "value" = "foo" }
+    { "value" = "bar" } }
+
+(* Group: application *)
+
+let list_bare_app = Erlang.application Rx.word list_bare
+
+test list_bare_app get "{foo, [{bar, [baz, bat]}]}" =
+  { "foo"
+    { "bar"
+      { "value" = "baz" }
+      { "value" = "bat" } } }
+
+(* Group: config *)
+
+let list_bare_config = Erlang.config list_bare_app
+
+test list_bare_config get "[
+  {foo, [{bar, [baz, bat]}]},
+  {goo, [{gar, [gaz, gat]}]}
+  ].\n" =
+  { "foo"
+    { "bar"
+      { "value" = "baz" }
+      { "value" = "bat" } } }
+  { "goo"
+    { "gar"
+      { "value" = "gaz" }
+      { "value" = "gat" } } }
+
index 14a51e8..3d0e9c2 100644 (file)
@@ -8,6 +8,7 @@ let s = "/local 172.31.0.0/16(rw,sync) \t
 /local2 somehost(rw,sync)
 /local3 some-host(rw,sync)
 /local3 an-other-host(rw,sync)
+/local4 2000:123:456::/64(rw)
 "
 
 test Exports.lns get s =
@@ -43,3 +44,6 @@ test Exports.lns get s =
       { "client" = "an-other-host"
           { "option" = "rw" }
           { "option" = "sync" } } }
+  { "dir" = "/local4"
+      { "client" = "2000:123:456::/64"
+          { "option" = "rw" } } }
diff --git a/lenses/tests/test_fonts.aug b/lenses/tests/test_fonts.aug
new file mode 100644 (file)
index 0000000..9591149
--- /dev/null
@@ -0,0 +1,809 @@
+(*
+Module: Test_Fonts
+  Provides unit tests and examples for the <Fonts> lens.
+*)
+
+module Test_Fonts =
+
+(* Variable: conf *)
+let conf = "<?xml version=\"1.0\"?>
+<!DOCTYPE fontconfig SYSTEM \"fonts.dtd\">
+<!-- /etc/fonts/fonts.conf file to configure system font access -->
+<fontconfig>
+
+<!--
+       DO NOT EDIT THIS FILE.
+       IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.
+       LOCAL CHANGES BELONG IN 'local.conf'.
+
+       The intent of this standard configuration file is to be adequate for
+       most environments.  If you have a reasonably normal environment and
+       have found problems with this configuration, they are probably
+       things that others will also want fixed.  Please submit any
+       problems to the fontconfig bugzilla system located at fontconfig.org
+
+       Note that the normal 'make install' procedure for fontconfig is to
+       replace any existing fonts.conf file with the new version.  Place
+       any local customizations in local.conf which this file references.
+
+       Keith Packard
+-->
+
+<!-- Font directory list -->
+
+       <dir>/usr/share/fonts</dir>
+       <dir>/usr/X11R6/lib/X11/fonts</dir> <dir>/usr/local/share/fonts</dir>
+       <dir>~/.fonts</dir>
+
+<!--
+  Accept deprecated 'mono' alias, replacing it with 'monospace'
+-->
+       <match target=\"pattern\">
+               <test qual=\"any\" name=\"family\">
+                       <string>mono</string>
+               </test>
+               <edit name=\"family\" mode=\"assign\">
+                       <string>monospace</string>
+               </edit>
+       </match>
+
+<!--
+  Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'
+-->
+       <match target=\"pattern\">
+               <test qual=\"any\" name=\"family\">
+                       <string>sans serif</string>
+               </test>
+               <edit name=\"family\" mode=\"assign\">
+                       <string>sans-serif</string>
+               </edit>
+       </match>
+
+<!--
+  Accept deprecated 'sans' alias, replacing it with 'sans-serif'
+-->
+       <match target=\"pattern\">
+               <test qual=\"any\" name=\"family\">
+                       <string>sans</string>
+               </test>
+               <edit name=\"family\" mode=\"assign\">
+                       <string>sans-serif</string>
+               </edit>
+       </match>
+
+<!--
+  Load local system customization file
+-->
+       <include ignore_missing=\"yes\">conf.d</include>
+
+<!-- Font cache directory list -->
+
+       <cachedir>/var/cache/fontconfig</cachedir>
+       <cachedir>~/.fontconfig</cachedir>
+
+       <config>
+<!--
+  These are the default Unicode chars that are expected to be blank
+  in fonts.  All other blank chars are assumed to be broken and
+  won't appear in the resulting charsets
+ -->
+               <blank>
+                       <int>0x0020</int>       <!-- SPACE -->
+                       <int>0x00A0</int>       <!-- NO-BREAK SPACE -->
+                       <int>0x00AD</int>       <!-- SOFT HYPHEN -->
+                       <int>0x034F</int>       <!-- COMBINING GRAPHEME JOINER -->
+                       <int>0x0600</int>       <!-- ARABIC NUMBER SIGN -->
+                       <int>0x0601</int>       <!-- ARABIC SIGN SANAH -->
+                       <int>0x0602</int>       <!-- ARABIC FOOTNOTE MARKER -->
+                       <int>0x0603</int>       <!-- ARABIC SIGN SAFHA -->
+                       <int>0x06DD</int>       <!-- ARABIC END OF AYAH -->
+                       <int>0x070F</int>       <!-- SYRIAC ABBREVIATION MARK -->
+                       <int>0x115F</int>       <!-- HANGUL CHOSEONG FILLER -->
+                       <int>0x1160</int>       <!-- HANGUL JUNGSEONG FILLER -->
+                       <int>0x1680</int>       <!-- OGHAM SPACE MARK -->
+                       <int>0x17B4</int>       <!-- KHMER VOWEL INHERENT AQ -->
+                       <int>0x17B5</int>       <!-- KHMER VOWEL INHERENT AA -->
+                       <int>0x180E</int>       <!-- MONGOLIAN VOWEL SEPARATOR -->
+                       <int>0x2000</int>       <!-- EN QUAD -->
+                       <int>0x2001</int>       <!-- EM QUAD -->
+                       <int>0x2002</int>       <!-- EN SPACE -->
+                       <int>0x2003</int>       <!-- EM SPACE -->
+                       <int>0x2004</int>       <!-- THREE-PER-EM SPACE -->
+                       <int>0x2005</int>       <!-- FOUR-PER-EM SPACE -->
+                       <int>0x2006</int>       <!-- SIX-PER-EM SPACE -->
+                       <int>0x2007</int>       <!-- FIGURE SPACE -->
+                       <int>0x2008</int>       <!-- PUNCTUATION SPACE -->
+                       <int>0x2009</int>       <!-- THIN SPACE -->
+                       <int>0x200A</int>       <!-- HAIR SPACE -->
+                       <int>0x200B</int>       <!-- ZERO WIDTH SPACE -->
+                       <int>0x200C</int>       <!-- ZERO WIDTH NON-JOINER -->
+                       <int>0x200D</int>       <!-- ZERO WIDTH JOINER -->
+                       <int>0x200E</int>       <!-- LEFT-TO-RIGHT MARK -->
+                       <int>0x200F</int>       <!-- RIGHT-TO-LEFT MARK -->
+                       <int>0x2028</int>       <!-- LINE SEPARATOR -->
+                       <int>0x2029</int>       <!-- PARAGRAPH SEPARATOR -->
+                       <int>0x202A</int>       <!-- LEFT-TO-RIGHT EMBEDDING -->
+                       <int>0x202B</int>       <!-- RIGHT-TO-LEFT EMBEDDING -->
+                       <int>0x202C</int>       <!-- POP DIRECTIONAL FORMATTING -->
+                       <int>0x202D</int>       <!-- LEFT-TO-RIGHT OVERRIDE -->
+                       <int>0x202E</int>       <!-- RIGHT-TO-LEFT OVERRIDE -->
+                       <int>0x202F</int>       <!-- NARROW NO-BREAK SPACE -->
+                       <int>0x205F</int>       <!-- MEDIUM MATHEMATICAL SPACE -->
+                       <int>0x2060</int>       <!-- WORD JOINER -->
+                       <int>0x2061</int>       <!-- FUNCTION APPLICATION -->
+                       <int>0x2062</int>       <!-- INVISIBLE TIMES -->
+                       <int>0x2063</int>       <!-- INVISIBLE SEPARATOR -->
+                       <int>0x206A</int>       <!-- INHIBIT SYMMETRIC SWAPPING -->
+                       <int>0x206B</int>       <!-- ACTIVATE SYMMETRIC SWAPPING -->
+                       <int>0x206C</int>       <!-- INHIBIT ARABIC FORM SHAPING -->
+                       <int>0x206D</int>       <!-- ACTIVATE ARABIC FORM SHAPING -->
+                       <int>0x206E</int>       <!-- NATIONAL DIGIT SHAPES -->
+                       <int>0x206F</int>       <!-- NOMINAL DIGIT SHAPES -->
+                       <int>0x2800</int>       <!-- BRAILLE PATTERN BLANK -->
+                       <int>0x3000</int>       <!-- IDEOGRAPHIC SPACE -->
+                       <int>0x3164</int>       <!-- HANGUL FILLER -->
+                       <int>0xFEFF</int>       <!-- ZERO WIDTH NO-BREAK SPACE -->
+                       <int>0xFFA0</int>       <!-- HALFWIDTH HANGUL FILLER -->
+                       <int>0xFFF9</int>       <!-- INTERLINEAR ANNOTATION ANCHOR -->
+                       <int>0xFFFA</int>       <!-- INTERLINEAR ANNOTATION SEPARATOR -->
+                       <int>0xFFFB</int>       <!-- INTERLINEAR ANNOTATION TERMINATOR -->
+               </blank>
+<!--
+  Rescan configuration every 30 seconds when FcFontSetList is called
+ -->
+               <rescan>
+                       <int>30</int>
+               </rescan>
+       </config>
+
+</fontconfig>
+"
+
+(* Test: Fonts.lns *)
+test Fonts.lns get conf =
+  { "#declaration"
+    { "#attribute"
+      { "version" = "1.0" }
+    }
+  }
+  { "!DOCTYPE" = "fontconfig"
+    { "SYSTEM" = "fonts.dtd" }
+  }
+  { "#comment" = " /etc/fonts/fonts.conf file to configure system font access " }
+  { "fontconfig"
+    { "#text" = "
+
+" }
+    { "#comment" = "
+       DO NOT EDIT THIS FILE.
+       IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.
+       LOCAL CHANGES BELONG IN 'local.conf'.
+
+       The intent of this standard configuration file is to be adequate for
+       most environments.  If you have a reasonably normal environment and
+       have found problems with this configuration, they are probably
+       things that others will also want fixed.  Please submit any
+       problems to the fontconfig bugzilla system located at fontconfig.org
+
+       Note that the normal 'make install' procedure for fontconfig is to
+       replace any existing fonts.conf file with the new version.  Place
+       any local customizations in local.conf which this file references.
+
+       Keith Packard
+" }
+    { "#text" = "
+
+" }
+    { "#comment" = " Font directory list " }
+    { "#text" = "
+
+       " }
+    { "dir"
+      { "#text" = "/usr/share/fonts" }
+    }
+    { "#text" = "      " }
+    { "dir"
+      { "#text" = "/usr/X11R6/lib/X11/fonts" }
+    }
+    { "#text" = " " }
+    { "dir"
+      { "#text" = "/usr/local/share/fonts" }
+    }
+    { "#text" = "      " }
+    { "dir"
+      { "#text" = "~/.fonts" }
+    }
+    { "#text" = "
+" }
+    { "#comment" = "
+  Accept deprecated 'mono' alias, replacing it with 'monospace'
+" }
+    { "#text" = "
+       " }
+    { "match"
+      { "#attribute"
+        { "target" = "pattern" }
+      }
+      { "#text" = "
+               " }
+      { "test"
+        { "#attribute"
+          { "qual" = "any" }
+          { "name" = "family" }
+        }
+        { "#text" = "
+                       " }
+        { "string"
+          { "#text" = "mono" }
+        }
+        { "#text" = "          " }
+      }
+      { "#text" = "            " }
+      { "edit"
+        { "#attribute"
+          { "name" = "family" }
+          { "mode" = "assign" }
+        }
+        { "#text" = "
+                       " }
+        { "string"
+          { "#text" = "monospace" }
+        }
+        { "#text" = "          " }
+      }
+      { "#text" = "    " }
+    }
+    { "#text" = "
+" }
+    { "#comment" = "
+  Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'
+" }
+    { "#text" = "
+       " }
+    { "match"
+      { "#attribute"
+        { "target" = "pattern" }
+      }
+      { "#text" = "
+               " }
+      { "test"
+        { "#attribute"
+          { "qual" = "any" }
+          { "name" = "family" }
+        }
+        { "#text" = "
+                       " }
+        { "string"
+          { "#text" = "sans serif" }
+        }
+        { "#text" = "          " }
+      }
+      { "#text" = "            " }
+      { "edit"
+        { "#attribute"
+          { "name" = "family" }
+          { "mode" = "assign" }
+        }
+        { "#text" = "
+                       " }
+        { "string"
+          { "#text" = "sans-serif" }
+        }
+        { "#text" = "          " }
+      }
+      { "#text" = "    " }
+    }
+    { "#text" = "
+" }
+    { "#comment" = "
+  Accept deprecated 'sans' alias, replacing it with 'sans-serif'
+" }
+    { "#text" = "
+       " }
+    { "match"
+      { "#attribute"
+        { "target" = "pattern" }
+      }
+      { "#text" = "
+               " }
+      { "test"
+        { "#attribute"
+          { "qual" = "any" }
+          { "name" = "family" }
+        }
+        { "#text" = "
+                       " }
+        { "string"
+          { "#text" = "sans" }
+        }
+        { "#text" = "          " }
+      }
+      { "#text" = "            " }
+      { "edit"
+        { "#attribute"
+          { "name" = "family" }
+          { "mode" = "assign" }
+        }
+        { "#text" = "
+                       " }
+        { "string"
+          { "#text" = "sans-serif" }
+        }
+        { "#text" = "          " }
+      }
+      { "#text" = "    " }
+    }
+    { "#text" = "
+" }
+    { "#comment" = "
+  Load local system customization file
+" }
+    { "#text" = "
+       " }
+    { "include"
+      { "#attribute"
+        { "ignore_missing" = "yes" }
+      }
+      { "#text" = "conf.d" }
+    }
+    { "#text" = "
+" }
+    { "#comment" = " Font cache directory list " }
+    { "#text" = "
+
+       " }
+    { "cachedir"
+      { "#text" = "/var/cache/fontconfig" }
+    }
+    { "#text" = "      " }
+    { "cachedir"
+      { "#text" = "~/.fontconfig" }
+    }
+    { "#text" = "
+       " }
+    { "config"
+      { "#text" = "
+" }
+      { "#comment" = "
+  These are the default Unicode chars that are expected to be blank
+  in fonts.  All other blank chars are assumed to be broken and
+  won't appear in the resulting charsets
+ " }
+      { "#text" = "
+               " }
+      { "blank"
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x0020" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " SPACE " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x00A0" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " NO-BREAK SPACE " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x00AD" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " SOFT HYPHEN " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x034F" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " COMBINING GRAPHEME JOINER " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x0600" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " ARABIC NUMBER SIGN " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x0601" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " ARABIC SIGN SANAH " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x0602" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " ARABIC FOOTNOTE MARKER " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x0603" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " ARABIC SIGN SAFHA " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x06DD" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " ARABIC END OF AYAH " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x070F" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " SYRIAC ABBREVIATION MARK " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x115F" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " HANGUL CHOSEONG FILLER " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x1160" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " HANGUL JUNGSEONG FILLER " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x1680" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " OGHAM SPACE MARK " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x17B4" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " KHMER VOWEL INHERENT AQ " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x17B5" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " KHMER VOWEL INHERENT AA " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x180E" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " MONGOLIAN VOWEL SEPARATOR " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x2000" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " EN QUAD " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x2001" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " EM QUAD " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x2002" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " EN SPACE " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x2003" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " EM SPACE " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x2004" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " THREE-PER-EM SPACE " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x2005" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " FOUR-PER-EM SPACE " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x2006" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " SIX-PER-EM SPACE " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x2007" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " FIGURE SPACE " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x2008" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " PUNCTUATION SPACE " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x2009" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " THIN SPACE " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x200A" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " HAIR SPACE " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x200B" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " ZERO WIDTH SPACE " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x200C" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " ZERO WIDTH NON-JOINER " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x200D" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " ZERO WIDTH JOINER " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x200E" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " LEFT-TO-RIGHT MARK " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x200F" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " RIGHT-TO-LEFT MARK " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x2028" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " LINE SEPARATOR " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x2029" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " PARAGRAPH SEPARATOR " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x202A" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " LEFT-TO-RIGHT EMBEDDING " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x202B" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " RIGHT-TO-LEFT EMBEDDING " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x202C" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " POP DIRECTIONAL FORMATTING " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x202D" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " LEFT-TO-RIGHT OVERRIDE " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x202E" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " RIGHT-TO-LEFT OVERRIDE " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x202F" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " NARROW NO-BREAK SPACE " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x205F" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " MEDIUM MATHEMATICAL SPACE " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x2060" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " WORD JOINER " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x2061" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " FUNCTION APPLICATION " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x2062" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " INVISIBLE TIMES " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x2063" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " INVISIBLE SEPARATOR " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x206A" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " INHIBIT SYMMETRIC SWAPPING " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x206B" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " ACTIVATE SYMMETRIC SWAPPING " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x206C" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " INHIBIT ARABIC FORM SHAPING " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x206D" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " ACTIVATE ARABIC FORM SHAPING " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x206E" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " NATIONAL DIGIT SHAPES " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x206F" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " NOMINAL DIGIT SHAPES " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x2800" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " BRAILLE PATTERN BLANK " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x3000" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " IDEOGRAPHIC SPACE " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0x3164" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " HANGUL FILLER " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0xFEFF" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " ZERO WIDTH NO-BREAK SPACE " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0xFFA0" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " HALFWIDTH HANGUL FILLER " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0xFFF9" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " INTERLINEAR ANNOTATION ANCHOR " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0xFFFA" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " INTERLINEAR ANNOTATION SEPARATOR " }
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "0xFFFB" }
+        }
+        { "#text" = "  " }
+        { "#comment" = " INTERLINEAR ANNOTATION TERMINATOR " }
+        { "#text" = "
+               " }
+      }
+      { "#comment" = "
+  Rescan configuration every 30 seconds when FcFontSetList is called
+ " }
+      { "#text" = "
+               " }
+      { "rescan"
+        { "#text" = "
+                       " }
+        { "int"
+          { "#text" = "30" }
+        }
+        { "#text" = "          " }
+      }
+      { "#text" = "    " }
+    }
+    { "#text" = "
+" }
+  }
+
index 24c6d44..fa044ae 100644 (file)
@@ -34,6 +34,13 @@ module Test_fstab =
         { "vfstype" = "ext3" }
         { "opt" = "defaults" } }
 
+  let no_opts = "/dev/vg00/lv00\t /\t ext3\n"
+
+  let no_opts_tree =
+    { "1"
+        { "spec" = "/dev/vg00/lv00" }
+        { "file" = "/" }
+        { "vfstype" = "ext3" } }
 
   let multi_opts = "devpts\t /dev/pts\t devpts  gid=5,mode=620,fscontext=system_u:object_r:removable_t  0 0\n"
 
@@ -61,6 +68,8 @@ module Test_fstab =
 
   test Fstab.lns get no_dump = no_dump_tree
 
+  test Fstab.lns get no_opts = no_opts_tree
+
   test Fstab.lns get multi_opts = multi_opts_tree
 
   test Fstab.lns get "/dev/hdc        /media/cdrom0   udf,iso9660 user,noauto\t0\t0\n" =
@@ -113,6 +122,36 @@ module Test_fstab =
     { "dump" = "0" }
     { "passno" = "0" } }
 
+  (* Parse when empty option value given, only equals sign *)
+  test Fstab.lns get "//host.example.org/a_share /mnt cifs defaults,ro,password= 0 0\n" =
+  { "1"
+    { "spec" = "//host.example.org/a_share" }
+    { "file" = "/mnt" }
+    { "vfstype" = "cifs" }
+    { "opt" = "defaults" }
+    { "opt" = "ro" }
+    { "opt" = "password"
+      { "value" }
+    }
+    { "dump" = "0" }
+    { "passno" = "0" }
+  }
+
+  (* Allow end of line comments *)
+  test Fstab.lns get "UUID=0314be77-bb1e-47d4-b2a2-e69ae5bc954f        /       ext4    rw,errors=remount-ro    0       1       # device at install: /dev/sda3\n" =
+  { "1"
+    { "spec" = "UUID=0314be77-bb1e-47d4-b2a2-e69ae5bc954f" }
+    { "file" = "/" }
+    { "vfstype" = "ext4" }
+    { "opt" = "rw" }
+    { "opt" = "errors"
+      { "value" = "remount-ro" }
+    }
+    { "dump" = "0" }
+    { "passno" = "1" }
+    { "#comment" = "device at install: /dev/sda3" }
+  }
+
 (* Local Variables: *)
 (* mode: caml       *)
 (* End:             *)
diff --git a/lenses/tests/test_fuse.aug b/lenses/tests/test_fuse.aug
new file mode 100644 (file)
index 0000000..58ffa3d
--- /dev/null
@@ -0,0 +1,22 @@
+(*
+Module: Test_Fuse
+  Provides unit tests and examples for the <Fuse> lens.
+*)
+
+module Test_Fuse =
+
+(* Variable: conf *)
+let conf = "# Set the maximum number of FUSE mounts allowed to non-root users.
+mount_max = 1000
+
+# Allow non-root users to specify the 'allow_other' or 'allow_root'
+user_allow_other
+"
+
+(* Test: Fuse.lns *)
+test Fuse.lns get conf =
+   { "#comment" = "Set the maximum number of FUSE mounts allowed to non-root users." }
+   { "mount_max" = "1000" }
+   {  }
+   { "#comment" = "Allow non-root users to specify the 'allow_other' or 'allow_root'" }
+   { "user_allow_other" }
index 92f590a..6d657b5 100644 (file)
@@ -38,3 +38,12 @@ test Group.lns get "testgrp:*:0:testusr\n" =
     { "password" = "*" }
     { "gid" = "0" }
     { "user" = "testusr" } }
+
+(* NIS defaults *)
+test Group.lns get "+\n" =
+  { "@nisdefault" }
+
+test Group.lns get "+:::\n" =
+  { "@nisdefault"
+    { "password" = "" }
+    { "gid" = "" } }
index c23a57c..71b84dd 100644 (file)
@@ -12,10 +12,13 @@ module Test_grub =
 device (hd0) HD(1,800,64000,9895c137-d4b2-4e3b-a93b-dc9ac4)
 password --md5 $1$M9NLj$p2gs87vwNv48BUu.wAfVw0
 default=0
+setkey
+setkey less backquote
 background 103332
 timeout=5
 splashimage=(hd0,0)/grub/splash.xpm.gz
 gfxmenu=(hd0,0)/boot/message
+verbose = 0
 hiddenmenu
 title Fedora (2.6.24.4-64.fc8)
         root (hd0,0)
@@ -36,6 +39,8 @@ title Fedora (2.6.24.3-34.fc8)
         initrd /initrd-2.6.24.3-34.fc8.img
         map (hd0) (hd1)
 title othermenu
+        lock
+        makeactive
         configfile /boot/grub/othergrub.conf
 "
 
@@ -50,14 +55,19 @@ title othermenu
     { "#comment" = "initrd /initrd-version.img" }
     { "#comment" = "boot=/dev/sda" }
     { "device"   = "(hd0)"
-           { "file" = "HD(1,800,64000,9895c137-d4b2-4e3b-a93b-dc9ac4)" } }
+        { "file" = "HD(1,800,64000,9895c137-d4b2-4e3b-a93b-dc9ac4)" } }
     { "password" = "$1$M9NLj$p2gs87vwNv48BUu.wAfVw0"
         { "md5" } }
     { "default" = "0" }
+    { "setkey" }
+    { "setkey"
+        { "to" = "less" }
+        { "from" = "backquote" } }
     { "background" = "103332" }
     { "timeout" = "5" }
     { "splashimage" = "(hd0,0)/grub/splash.xpm.gz" }
     { "gfxmenu" = "(hd0,0)/boot/message" }
+    { "verbose" = "0" }
     { "hiddenmenu" }
     { "title" = "Fedora (2.6.24.4-64.fc8)"
         { "root" = "(hd0,0)" }
@@ -82,6 +92,8 @@ title othermenu
         { "initrd" = "/initrd-2.6.24.3-34.fc8.img" }
         { "map" { "from" = "(hd0)" } { "to" = "(hd1)" } } }
     { "title" = "othermenu"
+        { "lock" }
+        { "makeactive" }
         { "configfile" = "/boot/grub/othergrub.conf" } }
 
 
@@ -151,6 +163,24 @@ initrd\t\t/boot/initrd.img-2.6.18-6-vserver-686
   test Grub.savedefault put "savedefault\n" after
     set "/savedefault" "3" = "savedefault 3\n"
 
+  test Grub.lns get
+"password foo
+password foo /boot/grub/custom.lst
+password --md5 $1$Ahx/T0$Sgcp7Z0xgGlyANIJCdESi.
+password --encrypted ^9^32kwzzX./3WISQ0C
+password --encrypted ^9^32kwzzX./3WISQ0C /boot/grub/custom.lst
+" =
+    { "password" = "foo" }
+    { "password" = "foo"
+        { "file" = "/boot/grub/custom.lst" } }
+    { "password" = "$1$Ahx/T0$Sgcp7Z0xgGlyANIJCdESi."
+        { "md5" } }
+    { "password" = "^9^32kwzzX./3WISQ0C"
+        { "encrypted" } }
+    { "password" = "^9^32kwzzX./3WISQ0C"
+        { "encrypted" }
+        { "file" = "/boot/grub/custom.lst" } }
+
   (* BZ 590067 - handle comments in a title section *)
   (* Comments within a boot stanza belong to that boot stanza *)
   test Grub.lns get "title Red Hat Enterprise Linux AS (2.4.21-63.ELsmp)
diff --git a/lenses/tests/test_gshadow.aug b/lenses/tests/test_gshadow.aug
new file mode 100644 (file)
index 0000000..b226a3e
--- /dev/null
@@ -0,0 +1,18 @@
+module Test_Gshadow =
+
+let conf = "root:x::
+uucp:x::
+sudo:x:suadmin1,suadmin2:coadmin1,coadmin2
+"
+
+test Gshadow.lns get conf =
+  { "root"
+    { "password" = "x" } }
+  { "uucp"
+    { "password" = "x" } }
+  { "sudo"
+    { "password" = "x" }
+    { "admin" = "suadmin1" }
+    { "admin" = "suadmin2" }
+    { "member" = "coadmin1" }
+    { "member" = "coadmin2" } }
diff --git a/lenses/tests/test_gtkbookmarks.aug b/lenses/tests/test_gtkbookmarks.aug
new file mode 100644 (file)
index 0000000..404a4fd
--- /dev/null
@@ -0,0 +1,25 @@
+(*
+Module: Test_GtkBookmarks
+  Provides unit tests and examples for the <GtkBookmarks> lens.
+*)
+
+module Test_GtkBookmarks =
+
+(* Test: GtkBookmarks.lns
+     Test without label *)
+test GtkBookmarks.lns get "ftp://user@myftp.com/somedir\n" =
+ { "bookmark" = "ftp://user@myftp.com/somedir" }
+
+(* Test: GtkBookmarks.lns
+     Test with label *)
+test GtkBookmarks.lns get "file:///home/rpinson/Ubuntu%20One Ubuntu One\n" =
+ { "bookmark" = "file:///home/rpinson/Ubuntu%20One"
+   { "label" = "Ubuntu One" } }
+
+(* Test: GtkBookmarks.lns
+     Empty lines are allowed, not comments *)
+test GtkBookmarks.lns get "ftp://user@myftp.com/somedir\n\nfile:///home/rpinson/Ubuntu%20One Ubuntu One\n" =
+ { "bookmark" = "ftp://user@myftp.com/somedir" }
+ { }
+ { "bookmark" = "file:///home/rpinson/Ubuntu%20One"
+   { "label" = "Ubuntu One" } }
index 343ec95..e677078 100644 (file)
@@ -9,6 +9,15 @@ test Hosts_Access.lns get multi_daemon =
     { "client" = "10.234." }
   }
 
+let multi_daemon_spc = "sshd sendmail : 10.234.\n"
+
+test Hosts_Access.lns get multi_daemon_spc =
+  { "1"
+    { "process" = "sshd" }
+    { "process" = "sendmail" }
+    { "client" = "10.234." }
+  }
+
 let multi_client = "sshd: 10.234. , 192.168.\n"
 
 test Hosts_Access.lns get multi_client =
@@ -18,6 +27,15 @@ test Hosts_Access.lns get multi_client =
     { "client" = "192.168." }
   }
 
+let multi_client_spc = "sshd: 10.234. 192.168.\n"
+
+test Hosts_Access.lns get multi_client_spc =
+  { "1"
+    { "process" = "sshd" }
+    { "client" = "10.234." }
+    { "client" = "192.168." }
+  }
+
 let daemon_except = "ALL Except sshd : 10.234.\n"
 
 test Hosts_Access.lns get daemon_except =
@@ -69,6 +87,51 @@ test Hosts_Access.lns get shell_command =
     { "shell_command" = "/usr/bin/my_cmd -t -f some_arg" }
   }
 
+let client_netgroup = "sshd: @hostgroup\n"
+test Hosts_Access.lns get client_netgroup =
+  { "1"
+    { "process" = "sshd" }
+    { "client" = "@hostgroup" }
+  }
+
+let client_netmask = "sshd: 192.168.0.0/255.255.0.0\n"
+test Hosts_Access.lns get client_netmask =
+  { "1"
+    { "process" = "sshd" }
+    { "client" = "192.168.0.0"
+      { "netmask" = "255.255.0.0" } }
+  }
+
+let client_cidr_v4 = "sshd: 192.168.0.0/24\n"
+test Hosts_Access.lns get client_cidr_v4 =
+  { "1"
+    { "process" = "sshd" }
+    { "client" = "192.168.0.0"
+      { "netmask" = "24" } }
+  }
+
+let client_cidr_v6 = "sshd: [fe80::%fxp0]/64\n"
+test Hosts_Access.lns get client_cidr_v6 =
+  { "1"
+    { "process" = "sshd" }
+    { "client" = "[fe80::%fxp0]"
+      { "netmask" = "64" } }
+  }
+
+let client_file = "sshd: /etc/external_file\n"
+test Hosts_Access.lns get client_file =
+  { "1"
+    { "process" = "sshd" }
+    { "file" = "/etc/external_file" }
+  }
+
+let client_wildcard = "sshd: 192.168.?.*\n"
+test Hosts_Access.lns get client_wildcard =
+  { "1"
+    { "process" = "sshd" }
+    { "client" = "192.168.?.*" }
+  }
+
 let sample_hosts_allow = "# hosts.allow        This file describes the names of the hosts which are
 #              allowed to use the local INET services, as decided
 #              by the '/usr/sbin/tcpd' server.
@@ -128,3 +191,63 @@ test Hosts_Access.lns get sample_hosts_deny =
     { "client" = "64.179." }
     { "client" = "65." }
   }
+
+
+let ip_mask = "sshd: 61./255.255.255.255\n"
+
+test Hosts_Access.lns get ip_mask =
+  { "1"
+    { "process" = "sshd" }
+    { "client" = "61." { "netmask" = "255.255.255.255" } } }
+
+(* Support options from hosts_options(5) *)
+test Hosts_Access.lns get "sshd: all: keepalive\n" =
+  { "1"
+    { "process" = "sshd" }
+    { "client" = "all" }
+    { "keepalive" } }
+
+test Hosts_Access.lns get "sshd: all: severity mail.info\n" =
+  { "1"
+    { "process" = "sshd" }
+    { "client" = "all" }
+    { "severity" = "mail.info" } }
+
+test Hosts_Access.lns get "sshd: all: severity mail.info : rfc931 5 : DENY\n" =
+  { "1"
+    { "process" = "sshd" }
+    { "client" = "all" }
+    { "severity" = "mail.info" }
+    { "rfc931" = "5" }
+    { "DENY" } }
+
+(* Ticket #255, from FreeBSD *)
+let host_options_cmds = "# You need to be clever with finger; do _not_ backfinger!! You can easily
+# start a \"finger war\".
+fingerd : ALL \
+        : spawn (echo Finger. | \
+         /usr/bin/mail -s \"tcpd\: %u@%h[%a] fingered me!\" root) & \
+        : deny
+
+# The rest of the daemons are protected.
+ALL : ALL : \
+          severity auth.info \
+        : twist /bin/echo \"You are not welcome to use %d from %h.\"
+"
+
+test Hosts_Access.lns get host_options_cmds = 
+  { "#comment" = "You need to be clever with finger; do _not_ backfinger!! You can easily" }
+  { "#comment" = "start a \"finger war\"." }
+  { "1"
+    { "process" = "fingerd" }
+    { "client" = "ALL" }
+    { "spawn" = "(echo Finger. | \
+         /usr/bin/mail -s \"tcpd\\: %u@%h[%a] fingered me!\" root) &" }
+    { "deny" } }
+  {  }
+  { "#comment" = "The rest of the daemons are protected." }
+  { "2"
+    { "process" = "ALL" }
+    { "client" = "ALL" }
+    { "severity" = "auth.info" }
+    { "twist" = "/bin/echo \"You are not welcome to use %d from %h.\"" } }
diff --git a/lenses/tests/test_htpasswd.aug b/lenses/tests/test_htpasswd.aug
new file mode 100644 (file)
index 0000000..6b45a87
--- /dev/null
@@ -0,0 +1,19 @@
+(*
+Module: Test_Htpasswd
+  Provides unit tests and examples for the <Htpasswd> lens.
+*)
+
+module Test_Htpasswd =
+
+let htpasswd = "foo-plain:bar
+foo-crypt:78YuxG9nnfUCo
+foo-md5:$apr1$NqCzyXmd$WLc/Wb35AkC.8tQQB3/Uw/
+foo-sha1:{SHA}Ys23Ag/5IOWqZCw9QGaVDdHwH00=
+"
+
+test Htpasswd.lns get htpasswd =
+  { "foo-plain" = "bar" }
+  { "foo-crypt" = "78YuxG9nnfUCo" }
+  { "foo-md5" = "$apr1$NqCzyXmd$WLc/Wb35AkC.8tQQB3/Uw/" }
+  { "foo-sha1" = "{SHA}Ys23Ag/5IOWqZCw9QGaVDdHwH00=" }
+
index af6cdc1..c1dd808 100644 (file)
@@ -339,3 +339,68 @@ test Httpd.lns get conf2 =
     {  }
   }
 
+(* Eol comment *)
+test Httpd.lns get "<a> # a comment
+MyDirective Foo
+</a>\n" =
+  { "a"
+    { "#comment" = "a comment" }
+    { "directive" = "MyDirective" { "arg" = "Foo" } } }
+
+test Httpd.lns get "<a>
+# a comment
+</a>\n" =
+  { "a" { "#comment" = "a comment" } }
+
+(* Test: Httpd.lns
+     Newlines inside quoted value (GH issue #104) *)
+test Httpd.lns get "Single 'Foo\\
+bar'
+Double \"Foo\\
+bar\"\n" =
+  { "directive" = "Single"
+    { "arg" = "'Foo\\\nbar'" } }
+  { "directive" = "Double"
+    { "arg" = "\"Foo\\\nbar\"" } }
+
+(* Test: Httpd.lns
+     Support >= in tags (GH #154) *)
+let versioncheck = "
+<IfVersion = 2.1>
+<IfModule !proxy_ajp_module>
+LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
+</IfModule>
+</IfVersion>
+
+<IfVersion >= 2.4>
+<IfModule !proxy_ajp_module>
+LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
+</IfModule>
+</IfVersion>
+"
+
+test Httpd.lns get versioncheck =
+  { }
+  { "IfVersion"
+    { "arg" = "=" }
+    { "arg" = "2.1" }
+    { "IfModule"
+      { "arg" = "!proxy_ajp_module" }
+      { "directive" = "LoadModule"
+        { "arg" = "proxy_ajp_module" }
+        { "arg" = "modules/mod_proxy_ajp.so" }
+      }
+    }
+  }
+  {}
+  { "IfVersion"
+    { "arg" = ">=" }
+    { "arg" = "2.4" }
+    { "IfModule"
+      { "arg" = "!proxy_ajp_module" }
+      { "directive" = "LoadModule"
+        { "arg" = "proxy_ajp_module" }
+        { "arg" = "modules/mod_proxy_ajp.so" }
+      }
+    }
+  }
index 8f9f656..93e035b 100644 (file)
@@ -13,6 +13,7 @@ arguserve     dgram   udp     wait    mary    /usr/bin/usenet         foo bar wombat
 faff.fred.com:
 127.0.0.1,faff.fred.com:
 *:
+[::1]:addrsrv  stream  tcp     nowait  fred    /usr/bin/addrsrv
 
 sndbufsrv      stream  tcp,sndbuf=12k  nowait  fred    /usr/bin/sndbufsrv
 rcvbufsrv      stream  tcp,rcvbuf=24k  nowait  fred    /usr/bin/rcvbufsrv
@@ -88,6 +89,16 @@ dummy/1       tli     rpc/circuit_v,udp       wait    root    /tmp/test_svc   te
                { "address"
                        { "1" = "*" }
                }
+               { "service" = "addrsrv"
+                       { "address"
+                               { "1" = "[::1]" }
+                       }
+                       { "socket" = "stream" }
+                       { "protocol" = "tcp" }
+                       { "wait" = "nowait" }
+                       { "user" = "fred" }
+                       { "command" = "/usr/bin/addrsrv" }
+               }
                {}
                { "service" = "sndbufsrv"
                        { "socket" = "stream" }
index a97e925..873e1fd 100644 (file)
@@ -37,6 +37,7 @@ module Test_IniFile =
 [section1]
 test_ace = value # end of line comment
 test_ace =
+test_ace = \"value with spaces\"
 ; comment with colon
 
 "
@@ -49,9 +50,26 @@ test_ace =
           { "test_ace" = "value"
             { "#comment" = "end of line comment" } }
          { "test_ace" }
+          { "test_ace" = "value with spaces" }
          { "#comment"  = "comment with colon" }
          {} }
 
+  test lns_ace put conf_ace after
+    set "section1/foo" "yes" = "# comment with sharp
+
+[section1]
+test_ace = value # end of line comment
+test_ace =
+test_ace = \"value with spaces\"
+; comment with colon
+
+foo=yes
+"
+
+  (* Test: lns_ace
+       Quotes can appear within bare values *)
+  test lns_ace get "[section]\ntest_ace = value \"with quotes\" inside\n" =
+  { "section" { "test_ace" = "value \"with quotes\" inside" } }
 
   (* Group: TEST a/c/f *)
   (* Variable: comment_acf *)
@@ -289,10 +307,90 @@ test_bdf =
   (* Group: TEST multiline values *)
   (* Variable: multiline_test *)
   let multiline_test = "test_ace = val1\n  val2\n   val3\n"
+  (* Variable: multiline_nl *)
+  let multiline_nl = "test_ace =\n  val2\n   val3\n"
   (* Variable: multiline_ace *)
   let multiline_ace = IniFile.entry_multiline IniFile.entry_re sep_ace comment_ace
   (* Test: multiline_ace
        Testing the a/c/e combination with a multiline entry *)
   test multiline_ace get multiline_test =
       { "test_ace" = "val1\n  val2\n   val3" }
+  (* Test: multiline_nl
+       Multiline values can begin with a single newline *)
+  test multiline_ace get multiline_nl =
+      { "test_ace" = "\n  val2\n   val3" }
+
+  (* Test: lns_ace
+       Ticket #243 *)
+  test lns_ace get "[section1]
+ticket_243 = \"value1;value2#value3\" # end of line comment
+" =
+  { "section1"
+    { "ticket_243" = "value1;value2#value3"
+      { "#comment" = "end of line comment" }
+    }
+  }
+
+  (* Group: TEST list entries *)
+  (* Variable: list_test *)
+  let list_test = "test_ace = val1,val2,val3 # a comment\n"
+  (* Lens: list_ace *)
+  let list_ace = IniFile.entry_list IniFile.entry_re sep_ace RX.word Sep.comma comment_ace
+  (* Test: list_ace
+       Testing the a/c/e combination with a list entry *)
+  test list_ace get list_test =
+  { "test_ace"
+    { "1" = "val1" }
+    { "2" = "val2" }
+    { "3" = "val3" }
+    { "#comment" = "a comment" }
+  }
+
+  (* Variable: list_nocomment_test *)
+  let list_nocomment_test = "test_ace = val1,val2,val3 \n"
+  (* Lens: list_nocomment_ace *)
+  let list_nocomment_ace = IniFile.entry_list_nocomment IniFile.entry_re sep_ace RX.word Sep.comma
+  (* Test: list_nocomment_ace
+       Testing the a/c/e combination with a list entry without end-of-line comment *)
+  test list_nocomment_ace get list_nocomment_test =
+  { "test_ace"
+    { "1" = "val1" }
+    { "2" = "val2" }
+    { "3" = "val3" }
+  }
+
+  (* Test: IniFile.lns_loose *)
+  test IniFile.lns_loose get conf_ace =
+  { "section" = ".anon"
+    { "#comment" = "comment with sharp" }
+    {  }
+  }
+  { "section" = "section1"
+    { "test_ace" = "value"
+      { "#comment" = "end of line comment" }
+    }
+    { "test_ace" }
+    { "test_ace" = "value with spaces" }
+    { "#comment" = "comment with colon" }
+    {  }
+  }
+
+  (* Test: IniFile.lns_loose_multiline *)
+  test IniFile.lns_loose_multiline get conf_ace =
+  { "section" = ".anon"
+    { "#comment" = "comment with sharp" }
+    {  }
+  }
+  { "section" = "section1"
+    { "test_ace" = "value"
+      { "#comment" = "end of line comment" }
+    }
+    { "test_ace" }
+    { "test_ace" = "value with spaces" }
+    { "#comment" = "comment with colon" }
+    {  }
+  }
+  
+  test IniFile.lns_loose_multiline get multiline_test =
+      { "section" = ".anon" { "test_ace" = "val1\n  val2\n   val3" } }
 
diff --git a/lenses/tests/test_inputrc.aug b/lenses/tests/test_inputrc.aug
new file mode 100644 (file)
index 0000000..e269fd5
--- /dev/null
@@ -0,0 +1,171 @@
+(*
+Module: Test_Inputrc
+  Provides unit tests and examples for the <Inputrc> lens.
+*)
+
+module Test_Inputrc =
+
+(* Variable: conf *)
+let conf = "# /etc/inputrc - global inputrc for libreadline
+# See readline(3readline) and `info rluserman' for more information.
+
+# Be 8 bit clean.
+set input-meta on
+set output-meta on
+
+# To allow the use of 8bit-characters like the german umlauts, uncomment
+# the line below. However this makes the meta key not work as a meta key,
+# which is annoying to those which don't need to type in 8-bit characters.
+
+# set convert-meta off
+
+# try to enable the application keypad when it is called.  Some systems
+# need this to enable the arrow keys.
+# set enable-keypad on
+
+# see /usr/share/doc/bash/inputrc.arrows for other codes of arrow keys
+
+# do not bell on tab-completion
+# set bell-style none
+# set bell-style visible
+
+# some defaults / modifications for the emacs mode
+$if mode=emacs
+
+# allow the use of the Home/End keys
+\"\\e[1~\": beginning-of-line
+\"\\e[4~\": end-of-line
+
+# allow the use of the Delete/Insert keys
+\"\\e[3~\": delete-char
+\"\\e[2~\": quoted-insert
+
+# mappings for \"page up\" and \"page down\" to step to the beginning/end
+# of the history
+# \"\\e[5~\": beginning-of-history
+# \"\\e[6~\": end-of-history
+
+# alternate mappings for \"page up\" and \"page down\" to search the history
+# \"\\e[5~\": history-search-backward
+# \"\\e[6~\": history-search-forward
+
+# mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
+\"\\e[1;5C\": forward-word
+\"\\e[1;5D\": backward-word
+\"\\e[5C\": forward-word
+\"\\e[5D\": backward-word
+\"\\e\\e[C\": forward-word
+\"\\e\\e[D\": backward-word
+
+$if term=rxvt
+\"\\e[8~\": end-of-line
+\"\\eOc\": forward-word
+\"\\eOd\": backward-word
+$endif
+
+# for non RH/Debian xterm, can't hurt for RH/Debian xterm
+# \"\\eOH\": beginning-of-line
+# \"\\eOF\": end-of-line
+
+# for freebsd console
+# \"\\e[H\": beginning-of-line
+# \"\\e[F\": end-of-line
+
+$endif
+"
+
+(* Test: Inputrc.lns *)
+test Inputrc.lns get conf =
+  { "#comment" = "/etc/inputrc - global inputrc for libreadline" }
+  { "#comment" = "See readline(3readline) and `info rluserman' for more information." }
+  {  }
+  { "#comment" = "Be 8 bit clean." }
+  { "input-meta" = "on" }
+  { "output-meta" = "on" }
+  {  }
+  { "#comment" = "To allow the use of 8bit-characters like the german umlauts, uncomment" }
+  { "#comment" = "the line below. However this makes the meta key not work as a meta key," }
+  { "#comment" = "which is annoying to those which don't need to type in 8-bit characters." }
+  {  }
+  { "#comment" = "set convert-meta off" }
+  {  }
+  { "#comment" = "try to enable the application keypad when it is called.  Some systems" }
+  { "#comment" = "need this to enable the arrow keys." }
+  { "#comment" = "set enable-keypad on" }
+  {  }
+  { "#comment" = "see /usr/share/doc/bash/inputrc.arrows for other codes of arrow keys" }
+  {  }
+  { "#comment" = "do not bell on tab-completion" }
+  { "#comment" = "set bell-style none" }
+  { "#comment" = "set bell-style visible" }
+  {  }
+  { "#comment" = "some defaults / modifications for the emacs mode" }
+  { "@if" = "mode=emacs"
+    {  }
+    { "#comment" = "allow the use of the Home/End keys" }
+    { "entry" = "\\e[1~"
+      { "mapping" = "beginning-of-line" }
+    }
+    { "entry" = "\\e[4~"
+      { "mapping" = "end-of-line" }
+    }
+    {  }
+    { "#comment" = "allow the use of the Delete/Insert keys" }
+    { "entry" = "\\e[3~"
+      { "mapping" = "delete-char" }
+    }
+    { "entry" = "\\e[2~"
+      { "mapping" = "quoted-insert" }
+    }
+    {  }
+    { "#comment" = "mappings for \"page up\" and \"page down\" to step to the beginning/end" }
+    { "#comment" = "of the history" }
+    { "#comment" = "\"\\e[5~\": beginning-of-history" }
+    { "#comment" = "\"\\e[6~\": end-of-history" }
+    {  }
+    { "#comment" = "alternate mappings for \"page up\" and \"page down\" to search the history" }
+    { "#comment" = "\"\\e[5~\": history-search-backward" }
+    { "#comment" = "\"\\e[6~\": history-search-forward" }
+    {  }
+    { "#comment" = "mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving" }
+    { "entry" = "\\e[1;5C"
+      { "mapping" = "forward-word" }
+    }
+    { "entry" = "\\e[1;5D"
+      { "mapping" = "backward-word" }
+    }
+    { "entry" = "\\e[5C"
+      { "mapping" = "forward-word" }
+    }
+    { "entry" = "\\e[5D"
+      { "mapping" = "backward-word" }
+    }
+    { "entry" = "\\e\\e[C"
+      { "mapping" = "forward-word" }
+    }
+    { "entry" = "\\e\\e[D"
+      { "mapping" = "backward-word" }
+    }
+    {  }
+    { "@if" = "term=rxvt"
+      { "entry" = "\\e[8~"
+        { "mapping" = "end-of-line" }
+      }
+      { "entry" = "\\eOc"
+        { "mapping" = "forward-word" }
+      }
+      { "entry" = "\\eOd"
+        { "mapping" = "backward-word" }
+      }
+    }
+    {  }
+    { "#comment" = "for non RH/Debian xterm, can't hurt for RH/Debian xterm" }
+    { "#comment" = "\"\\eOH\": beginning-of-line" }
+    { "#comment" = "\"\\eOF\": end-of-line" }
+    {  }
+    { "#comment" = "for freebsd console" }
+    { "#comment" = "\"\\e[H\": beginning-of-line" }
+    { "#comment" = "\"\\e[F\": end-of-line" }
+    {  }
+  }
+
index 71dda13..818322a 100644 (file)
@@ -4,6 +4,8 @@ module Test_interfaces =
 # and how to activate them. For more information, see interfaces(5).
 # The loopback network interface
 
+source /etc/network/interfaces.d/*.conf
+
 auto lo eth0 #foo
 allow-hotplug eth1
 
@@ -29,12 +31,25 @@ address 192.168.1.1
 allow-auto eth1
 iface eth1 inet dhcp
 
+iface tap0 inet static
+  vde2-switch -
+
 mapping eth1
        # I like mapping ...
         # ... and I like comments
 
        script\
  /usr/local/sbin/map-scheme
+
+iface bond0 inet dhcp
+  bridge-ports eth2 eth3 eth4
+
+iface br0 inet static
+  bond-slaves eth5 eth6
+  address 10.0.0.1
+  netmask 255.0.0.0
+
+source /etc/network.d/*.net.conf
 "
 
     test Interfaces.lns get conf =
@@ -42,6 +57,8 @@ mapping eth1
         { "#comment" = "and how to activate them. For more information, see interfaces(5)." }
         { "#comment" = "The loopback network interface" }
         {}
+        {"source" = "/etc/network/interfaces.d/*.conf"}
+        {}
         { "auto"
             { "1" = "lo" }
             { "2" = "eth0" }
@@ -76,14 +93,44 @@ mapping eth1
             { "family" = "inet"}
             { "method" = "dhcp"}
            {} }
+        { "iface" = "tap0"
+          { "family" = "inet" }
+          { "method" = "static" }
+          { "vde2-switch" = "-" }
+        {} }
         { "mapping" = "eth1"
             { "#comment" = "I like mapping ..." }
             { "#comment" = "... and I like comments" }
             {}
-            { "script" = "/usr/local/sbin/map-scheme"} }
+            { "script" = "/usr/local/sbin/map-scheme"}
+        {} }
+        { "iface" = "bond0"
+            { "family" = "inet" }
+            { "method" = "dhcp" }
+            { "bridge-ports"
+                { "1" = "eth2" }
+                { "2" = "eth3" }
+                { "3" = "eth4" }
+            }
+        {} }
+        { "iface" = "br0"
+            { "family" = "inet" }
+            { "method" = "static" }
+            { "bond-slaves"
+                { "1" = "eth5" }
+                { "2" = "eth6" }
+            }
+            { "address" = "10.0.0.1" }
+            { "netmask" = "255.0.0.0" }
+        {} }
+        {"source" = "/etc/network.d/*.net.conf"}
 
 test Interfaces.lns put "" after
        set "/iface[1]" "eth0";
        set "/iface[1]/family" "inet";
        set "/iface[1]/method" "dhcp"
 = "iface eth0 inet dhcp\n"
+
+test Interfaces.lns put "" after
+    set "/source[0]" "/etc/network/conf.d/*.conf"
+= "source /etc/network/conf.d/*.conf\n"
diff --git a/lenses/tests/test_iproute2.aug b/lenses/tests/test_iproute2.aug
new file mode 100644 (file)
index 0000000..2acd367
--- /dev/null
@@ -0,0 +1,63 @@
+module Test_IPRoute2 =
+
+let conf = "
+# /etc/iproute2/rt_tables
+#
+# reserved values
+#
+255    local
+254    main
+253    default
+0      unspec
+#
+# local
+#
+#1     inr.ruhep
+200    h3g0
+201    adsl1
+202    adsl2
+203    adsl3
+204    adsl4
+205    wifi0
+#
+# From rt_dsfield
+#
+0x00  default
+0x80  flash-override
+
+# From rt_protos
+#
+254 gated/aggr
+253 gated/bgp
+"
+
+test IPRoute2.lns get conf =
+  { }
+  { "#comment" = "/etc/iproute2/rt_tables" }
+  { }
+  { "#comment" = "reserved values" }
+  { }
+  { "255" = "local" }
+  { "254" = "main" }
+  { "253" = "default" }
+  { "0" = "unspec" }
+  { }
+  { "#comment" = "local" }
+  { }
+  { "#comment" = "1    inr.ruhep" }
+  { "200" = "h3g0" }
+  { "201" = "adsl1" }
+  { "202" = "adsl2" }
+  { "203" = "adsl3" }
+  { "204" = "adsl4" }
+  { "205" = "wifi0" }
+  { }
+  { "#comment" = "From rt_dsfield" }
+  { }
+  { "0x00" = "default" }
+  { "0x80" = "flash-override" }
+  { }
+  { "#comment" = "From rt_protos" }
+  { }
+  { "254" = "gated/aggr" }
+  { "253" = "gated/bgp" }
index 8f40e89..5be9afc 100644 (file)
@@ -83,6 +83,22 @@ COMMIT\n" =
           { "in-interface" = "lo" }
           { "jump" = "ACCEPT" } } }
 
+test Iptables.table get "*filter
+
+:RH-Firewall-1-INPUT - [0:0]
+
+-A FORWARD -j RH-Firewall-1-INPUT
+
+COMMIT\n" =
+  { "table" = "filter"
+      { }
+      { "chain" = "RH-Firewall-1-INPUT"
+          { "policy" = "-" } }
+      { }
+      { "append" = "FORWARD"
+          { "jump" = "RH-Firewall-1-INPUT" } }
+      { } }
+
 let conf = "# Generated by iptables-save v1.2.6a on Wed Apr 24 10:19:55 2002
 *filter
 :INPUT DROP [1:229]
diff --git a/lenses/tests/test_jaas.aug b/lenses/tests/test_jaas.aug
new file mode 100644 (file)
index 0000000..dc27838
--- /dev/null
@@ -0,0 +1,112 @@
+(* Module Jaas *)
+(* Author: Simon Vocella <voxsim@gmail.com> *)
+module Test_jaas =
+
+let conf = "
+/*
+  This is the JAAS configuration file used by the Shibboleth IdP.
+
+  A JAAS configuration file is a grouping of LoginModules defined in the following manner:
+  <LoginModuleClass> <Flag> <ModuleOptions>;
+
+  LoginModuleClass - fully qualified class name of the LoginModule class
+  Flag             - indicates whether the requirement level for the modules;
+                         allowed values: required, requisite, sufficient, optional
+  ModuleOptions    - a space delimited list of name=\"value\" options
+
+  For complete documentation on the format of this file see:
+  http://java.sun.com/j2se/1.5.0/docs/api/javax/security/auth/login/Configuration.html
+
+  For LoginModules available within the Sun JVM see:
+  http://java.sun.com/j2se/1.5.0/docs/guide/security/jaas/tutorials/LoginConfigFile.html
+
+  Warning: Do NOT use Sun's JNDI LoginModule to authentication against an LDAP directory,
+  Use the LdapLoginModule that ships with Shibboleth and is demonstrated below.
+
+  Note, the application identifier MUST be ShibUserPassAuth
+*/
+
+
+ShibUserPassAuth {
+
+// Example LDAP authentication
+// See: https://wiki.shibboleth.net/confluence/display/SHIB2/IdPAuthUserPass
+/*
+   edu.vt.middleware.ldap.jaas.LdapLoginModule required
+      ldapUrl=\"ldap://ldap.example.org\"
+      baseDn=\"ou=people,dc=example,dc=org\"
+      ssl=\"true\"
+      userFilter=\"uid={0}\";
+*/
+
+// Example Kerberos authentication, requires Sun's JVM
+// See: https://wiki.shibboleth.net/confluence/display/SHIB2/IdPAuthUserPass
+/*
+   com.sun.security.auth.module.Krb5LoginModule required
+      useKeyTab=\"true\"
+      keyTab=\"/path/to/idp/keytab/file\";
+*/
+
+   edu.vt.middleware.ldap.jaas.LdapLoginModule required
+      host = \"ldap://127.0.0.1:389\"
+      base = \"dc=example,dc=com\"
+      serviceUser = \"cn=admin,dc=example,dc=com\"
+      serviceCredential = \"ldappassword\"
+      ssl = \"false\"
+      userField = \"uid\"
+      subtreeSearch = \"true\";
+};"
+
+test Jaas.lns get conf =
+  {  }
+  { "#mcomment"
+    { "1" = "This is the JAAS configuration file used by the Shibboleth IdP." }
+    { "2" = "A JAAS configuration file is a grouping of LoginModules defined in the following manner:" }
+    { "3" = "<LoginModuleClass> <Flag> <ModuleOptions>;" }
+    { "4" = "LoginModuleClass - fully qualified class name of the LoginModule class" }
+    { "5" = "Flag             - indicates whether the requirement level for the modules;" }
+    { "6" = "allowed values: required, requisite, sufficient, optional" }
+    { "7" = "ModuleOptions    - a space delimited list of name=\"value\" options" }
+    { "8" = "For complete documentation on the format of this file see:" }
+    { "9" = "http://java.sun.com/j2se/1.5.0/docs/api/javax/security/auth/login/Configuration.html" }
+    { "10" = "For LoginModules available within the Sun JVM see:" }
+    { "11" = "http://java.sun.com/j2se/1.5.0/docs/guide/security/jaas/tutorials/LoginConfigFile.html" }
+    { "12" = "Warning: Do NOT use Sun's JNDI LoginModule to authentication against an LDAP directory," }
+    { "13" = "Use the LdapLoginModule that ships with Shibboleth and is demonstrated below." }
+    { "14" = "Note, the application identifier MUST be ShibUserPassAuth" }
+  }
+  {  }
+  {  }
+  { "login" = "ShibUserPassAuth"
+    {  }
+    {  }
+    { "#comment" = "Example LDAP authentication" }
+    { "#comment" = "See: https://wiki.shibboleth.net/confluence/display/SHIB2/IdPAuthUserPass" }
+    { "#mcomment"
+      { "1" = "edu.vt.middleware.ldap.jaas.LdapLoginModule required" }
+      { "2" = "ldapUrl=\"ldap://ldap.example.org\"" }
+      { "3" = "baseDn=\"ou=people,dc=example,dc=org\"" }
+      { "4" = "ssl=\"true\"" }
+      { "5" = "userFilter=\"uid={0}\";" }
+    }
+    {  }
+    { "#comment" = "Example Kerberos authentication, requires Sun's JVM" }
+    { "#comment" = "See: https://wiki.shibboleth.net/confluence/display/SHIB2/IdPAuthUserPass" }
+    { "#mcomment"
+      { "1" = "com.sun.security.auth.module.Krb5LoginModule required" }
+      { "2" = "useKeyTab=\"true\"" }
+      { "3" = "keyTab=\"/path/to/idp/keytab/file\";" }
+    }
+    {  }
+    { "loginModuleClass" = "edu.vt.middleware.ldap.jaas.LdapLoginModule"
+      { "flag" = "required"
+        { "host" = "\"ldap://127.0.0.1:389\"" }
+        { "base" = "\"dc=example,dc=com\"" }
+        { "serviceUser" = "\"cn=admin,dc=example,dc=com\"" }
+        { "serviceCredential" = "\"ldappassword\"" }
+        { "ssl" = "\"false\"" }
+        { "userField" = "\"uid\"" }
+        { "subtreeSearch" = "\"true\";" }
+      }
+    }
+  }
diff --git a/lenses/tests/test_jettyrealm.aug b/lenses/tests/test_jettyrealm.aug
new file mode 100644 (file)
index 0000000..620ffa3
--- /dev/null
@@ -0,0 +1,51 @@
+(*
+Module: Test_JettyRealm
+  Provides unit tests and examples for the <JettyRealm> lens.
+*)
+
+module Test_JettyRealm =
+
+(* Variable: conf *)
+let conf = "### Comment
+admin: admin, admin
+"
+
+(* Variable: conf_norealm *)
+let conf_norealm = "### Comment
+admin: admin
+"
+
+(* Variable: new_conf *) 
+let new_conf = "### Comment
+admin: password, admin
+"
+
+let lns = JettyRealm.lns 
+
+(* Test: JettyRealm.lns  
+ * Get test against tree structure
+*)
+test lns get conf = 
+  { "#comment" = "## Comment" }
+  { "user" 
+    { "username" = "admin" }
+    { "password" = "admin" }
+    { "realm" = "admin" }
+  }
+
+(* Test: JettyRealm.lns  
+ * Get test against tree structure without a realm
+*)
+test lns get conf_norealm = 
+  { "#comment" = "## Comment" }
+  { "user" 
+    { "username" = "admin" }
+    { "password" = "admin" }
+  }
+
+(* Test: JettyRealm.lns  
+ * Put test changing password to password
+*)
+test lns put conf after set "/user/password" "password" = new_conf
+
+(* vim: set ts=4  expandtab  sw=4: *)
diff --git a/lenses/tests/test_jmxaccess.aug b/lenses/tests/test_jmxaccess.aug
new file mode 100644 (file)
index 0000000..14e095e
--- /dev/null
@@ -0,0 +1,35 @@
+(*
+Module: Test_JMXAccess
+  Provides unit tests and examples for the <JMXAccess> lens.
+*)
+
+module Test_JMXAccess =
+
+(* Variable: conf *)
+let conf = "# Comment
+admin readwrite
+"
+
+(* Variable: new_conf *) 
+let new_conf = "# Comment
+admin readonly
+" 
+
+let lns = JMXAccess.lns 
+
+(* Test: JMXAccess.lns  
+ * Get test against tree structure
+*)
+test lns get conf = 
+  { "#comment" = "Comment" }
+  { "user" 
+    { "username" = "admin" }
+    { "access" = "readwrite" }
+  }
+
+(* Test: JMXAccess.lns  
+ * Put test changing access to readonly
+*)
+test lns put conf after set "/user/access" "readonly" = new_conf
+
+(* vim: set ts=4  expandtab  sw=4: *)
diff --git a/lenses/tests/test_jmxpassword.aug b/lenses/tests/test_jmxpassword.aug
new file mode 100644 (file)
index 0000000..5365162
--- /dev/null
@@ -0,0 +1,35 @@
+(*
+Module: Test_JMXPassword
+  Provides unit tests and examples for the <JMXPassword> lens.
+*)
+
+module Test_JMXPassword =
+
+(* Variable: conf *)
+let conf = "# Comment
+admin activemq
+"
+
+(* Variable: new_conf *) 
+let new_conf = "# Comment
+admin password
+" 
+
+let lns = JMXPassword.lns 
+
+(* Test: JMXPassword.lns  
+ * Get test against tree structure
+*)
+test lns get conf = 
+  { "#comment" = "Comment" }
+  { "user" 
+    { "username" = "admin" }
+    { "password" = "activemq" }
+  }
+
+(* Test: JMXPassword.lns  
+ * Put test changing password to password
+*)
+test lns put conf after set "/user/password" "password" = new_conf
+
+(* vim: set ts=4  expandtab  sw=4: *)
index 0bcd25d..aec7d4c 100644 (file)
@@ -8,6 +8,9 @@ test lns get "true" = { "const" = "true" }
 
 test lns get "3.141" = { "number" = "3.141" }
 
+test lns get "{ \"key\" : 666 }" =
+  { "dict" { "entry" = "key" { "number" = "666" } } }
+
 test lns get "[true, 0, \"yo\"]" =
   { "array" { "const" = "true" } { "number" = "0" } { "string" = "yo" } }
 
@@ -27,6 +30,11 @@ test lns get "{ \"0\": true, \"1\":false }" =
 test lns get "{\"menu\": \"entry one\"}" =
   { "dict" { "entry" = "menu" { "string" = "entry one" } } }
 
+test lns get "[ ]" =
+  { "array" }
+
+test lns get "{}" =
+  { "dict" }
 
 let s = "{\"menu\": {
   \"id\": \"file\",
index 7057782..51c79a3 100644 (file)
@@ -1,6 +1,9 @@
-(* Test for kdump lens *)
+(*
+Module: Test_Kdump
+  Provides unit tests and examples for the <Kdump> lens.
+*)
 
-module Test_kdump =
+module Test_Kdump =
 
    let conf = "# this is a comment
 #another commented line
@@ -8,36 +11,92 @@ module Test_kdump =
 #comment after empty line
 #
 #comment after empty comment
-path /var/crash
+path /var/crash  #comment after entry
 core_collector makedumpfile -c
 default poweroff
 raw /dev/sda5
 ext3 /dev/sda3
 net my.server.com:/export/tmp
+nfs my.server.com:/export/tmp
 net user@my.server.com
+ssh user@my.server.com
 link_delay 60
+kdump_pre /var/crash/scripts/kdump-pre.sh
 kdump_post /var/crash/scripts/kdump-post.sh
 #extra_bins /usr/bin/lftp /a/b/c
-extra_bins /usr/bin/lftp          /a/b/c
+extra_bins /usr/bin/lftp          /a/b/c  # comment
 disk_timeout 30
 extra_modules gfs2 extra modules more
 options babla   labl    kbak            df=dfg
 options babla   labl    kbak            df=dfg
-options babla   labl    kbak            df=dfg
-"
-
-   let conf2 = "#comment
-kdump_post /var/crash/scripts/kdump-post.sh
-extra_modules gfs2 extra modules more
+options babla   labl    kbak            df=dfg  # comment
+sshkey /root/.ssh/kdump_id_rsa
+force_rebuild 1
+override_resettable 1
+dracut_args --omit-drivers \"cfg80211 snd\" --add-drivers \"ext2 ext3\"
+fence_kdump_args -p 7410 -f auto
+fence_kdump_nodes 192.168.1.10 10.34.63.155
+debug_mem_level 3
+blacklist gfs2
 "
 
-(*   test Kdump.lns get conf = ?*)
-   test Kdump.lns get conf2 =
-  { "#comment" = "comment" }
-  { "kdump_post" = "/var/crash/scripts/kdump-post.sh" }
-  { "extra_modules"
-    { "1" = "gfs2" }
-    { "2" = "extra" }
-    { "3" = "modules" }
-    { "4" = "more" }
-  }
+  (* Test: Kdump.lns
+     Check whole config file *)
+  test Kdump.lns get conf =
+    { "#comment" = "this is a comment" }
+    { "#comment" = "another commented line" }
+    {  }
+    { "#comment" = "comment after empty line" }
+    {  }
+    { "#comment" = "comment after empty comment" }
+    { "path" = "/var/crash"
+      { "#comment" = "comment after entry" } }
+    { "core_collector" = "makedumpfile -c" }
+    { "default" = "poweroff" }
+    { "raw" = "/dev/sda5" }
+    { "ext3" = "/dev/sda3" }
+    { "net" = "my.server.com:/export/tmp" }
+    { "nfs" = "my.server.com:/export/tmp" }
+    { "net" = "user@my.server.com" }
+    { "ssh" = "user@my.server.com" }
+    { "link_delay" = "60" }
+    { "kdump_pre" = "/var/crash/scripts/kdump-pre.sh" }
+    { "kdump_post" = "/var/crash/scripts/kdump-post.sh" }
+    { "#comment" = "extra_bins /usr/bin/lftp /a/b/c" }
+    { "extra_bins"
+      { "1" = "/usr/bin/lftp" }
+      { "2" = "/a/b/c" }
+      { "#comment" = "comment" } }
+    { "disk_timeout" = "30" }
+    { "extra_modules"
+      { "1" = "gfs2" }
+      { "2" = "extra" }
+      { "3" = "modules" }
+      { "4" = "more" } }
+    { "options"
+      { "babla"
+        { "labl" }
+        { "kbak" }
+        { "df" = "dfg" } } }
+    { "options"
+      { "babla"
+        { "labl" }
+        { "kbak" }
+        { "df" = "dfg" } } }
+    { "options"
+      { "babla"
+        { "labl" }
+        { "kbak" }
+        { "df" = "dfg" } }
+      { "#comment" = "comment" } }
+    { "sshkey" = "/root/.ssh/kdump_id_rsa" }
+    { "force_rebuild" = "1" }
+    { "override_resettable" = "1" }
+    { "dracut_args" = "--omit-drivers \"cfg80211 snd\" --add-drivers \"ext2 ext3\"" }
+    { "fence_kdump_args" = "-p 7410 -f auto" }
+    { "fence_kdump_nodes"
+      { "1" = "192.168.1.10" }
+      { "2" = "10.34.63.155" } }
+    { "debug_mem_level" = "3" }
+    { "blacklist"
+      { "1" = "gfs2" } }
index 0932629..371df25 100644 (file)
@@ -118,6 +118,8 @@ virtual_server 192.168.1.11 22 {
 
     protocol TCP 
 
+    sorry_server 10.20.40.30 22
+
     ! there can be as many real_server blocks as you need 
 
     real_server 10.20.40.10 22 { 
@@ -163,10 +165,8 @@ weight 2                        # add 2 points of prio if OK
      { "#comment" = "Configuration File for keepalived" }
      {}
      { "global_defs"
-       { }
        { "#comment" = "this is who emails will go to on alerts" }
        { "notification_email"
-            { }
             { "email" = "admins@example.com" }
             { "email" = "fakepager@example.com" }
             { "#comment" = "add a few more email addresses here if you would like" } }
@@ -182,35 +182,28 @@ weight 2                        # add 2 points of prio if OK
        { "lvs_id" = "LVS_EXAMPLE_01" } }
      {}
      { "vrrp_sync_group" = "VG1"
-       { }
        { "group"
-         { }
          { "inside_network"
            { "#comment" = "name of vrrp_instance (below)" } }
          { "outside_network"
            { "#comment" = "One for each moveable IP." } } } }
      {}
      { "vrrp_instance" = "VI_1"
-       { }
        { "state" = "MASTER" }
        { "interface" = "eth0" }
        { }
        { "track_interface"
-         { }
          { "eth0" { "#comment" = "Back" } }
          { "eth1" { "#comment" = "DMZ" } } }
        { "track_script"
-         { }
          { "check_apache2" { "#comment" = "weight = +2 si ok, 0 si nok" } } }
        { "garp_master_delay" = "5" }
        { "priority" = "50" }
        { "advert_int" = "2" }
        { "authentication"
-         { }
          { "auth_type" = "PASS" }
          { "auth_pass" = "mypass" } }
        { "virtual_ipaddress"
-         { }
          { "ipaddr" = "10.234.66.146"
            { "prefixlen" = "32" }
            { "dev" = "eth0" } } }
@@ -247,7 +240,6 @@ weight 2                        # add 2 points of prio if OK
        { "#comment" = "I don't use AH" }
        { "#comment" = "yet as many people have reported problems with it" }
        { "authentication"
-         { }
          { "auth_type" = "PASS" }
          { "auth_pass" = "example" } }
        { }
@@ -258,7 +250,6 @@ weight 2                        # add 2 points of prio if OK
        { "#comment" = "any IP addresses" }
        { }
        { "virtual_ipaddress"
-         { }
          { "ipaddr" = "192.168.1.11" }
          { "ipaddr" = "10.234.66.146"
            { "prefixlen" = "32" }
@@ -269,7 +260,6 @@ weight 2                        # add 2 points of prio if OK
        { "virtual_server"
          { "ip" = "192.168.1.11" }
          { "port" = "22" }
-         { }
          { "delay_loop" = "6" }
          { }
          { "#comment" = "use round-robin as a load balancing algorithm" }
@@ -281,13 +271,15 @@ weight 2                        # add 2 points of prio if OK
          { }
          { "protocol" = "TCP" }
          { }
+         { "sorry_server"
+           { "ip" = "10.20.40.30" }
+           { "port" = "22" } }
+         { }
          { "#comment" = "there can be as many real_server blocks as you need" }
          { }
          { "real_server"
            { "ip" = "10.20.40.10" }
            { "port" = "22" }
-           { }
-           { }
            { "#comment" = "if we used weighted round-robin or a similar lb algo," }
            { "#comment" = "we include the weight of this server" }
            { }
@@ -300,12 +292,10 @@ weight 2                        # add 2 points of prio if OK
            { "#comment" = "if it fails, we will pull this realserver out of the pool" }
            { "#comment" = "and send email about the removal" }
            { "TCP_CHECK"
-             { }
              { "connect_timeout" = "3" }
              { "connect_port" = "22" } } } }
        { }
        { "virtual_server_group" = "DNS_1"
-         { }
          { "vip"
           { "ipaddr" = "192.168.0.1" }
           { "port" = "22" } }
@@ -328,3 +318,125 @@ weight 2                        # add 2 points of prio if OK
        { }
        { "#comment" = "that's all" }
 
+(* Variable: tcp_check
+   An example of a TCP health checker *)
+let tcp_check = "virtual_server 192.168.1.11 22 {
+    real_server 10.20.40.10 22 {
+        TCP_CHECK {
+            connect_timeout 3
+            connect_port 22
+            bindto 192.168.1.1
+        }
+    }
+}
+"
+test Keepalived.lns get tcp_check =
+  { "virtual_server"
+    { "ip" = "192.168.1.11" }
+    { "port" = "22" }
+    { "real_server"
+      { "ip" = "10.20.40.10" }
+      { "port" = "22" }
+      { "TCP_CHECK"
+        { "connect_timeout" = "3" }
+        { "connect_port" = "22" }
+        { "bindto" = "192.168.1.1" } } } }
+
+(* Variable: misc_check
+   An example of a MISC health checker *)
+let misc_check = "virtual_server 192.168.1.11 22 {
+    real_server 10.20.40.10 22 {
+        MISC_CHECK {
+            misc_path /usr/local/bin/server_test
+            misc_timeout 3
+            misc_dynamic
+        }
+    }
+}
+"
+test Keepalived.lns get misc_check =
+  { "virtual_server"
+    { "ip" = "192.168.1.11" }
+    { "port" = "22" }
+    { "real_server"
+      { "ip" = "10.20.40.10" }
+      { "port" = "22" }
+      { "MISC_CHECK"
+        { "misc_path" = "/usr/local/bin/server_test" }
+        { "misc_timeout" = "3" }
+        { "misc_dynamic" } } } }
+
+(* Variable: smtp_check
+   An example of an SMTP health checker *)
+let smtp_check = "virtual_server 192.168.1.11 22 {
+    real_server 10.20.40.10 22 {
+        SMTP_CHECK {
+            host {
+              connect_ip 10.20.40.11
+              connect_port 587
+              bindto 192.168.1.1
+            }
+            connect_timeout 3
+            retry 5
+            delay_before_retry 10
+            helo_name \"Testing Augeas\"
+        }
+    }
+}
+"
+test Keepalived.lns get smtp_check =
+  { "virtual_server"
+    { "ip" = "192.168.1.11" }
+    { "port" = "22" }
+    { "real_server"
+      { "ip" = "10.20.40.10" }
+      { "port" = "22" }
+      { "SMTP_CHECK"
+        { "host"
+          { "connect_ip" = "10.20.40.11" }
+          { "connect_port" = "587" }
+          { "bindto" = "192.168.1.1" } }
+        { "connect_timeout" = "3" }
+        { "retry" = "5" }
+        { "delay_before_retry" = "10" }
+        { "helo_name" = "\"Testing Augeas\"" } } } }
+
+(* Variable: http_check
+   An example of an HTTP health checker *)
+let http_check = "virtual_server 192.168.1.11 22 {
+    real_server 10.20.40.10 22 {
+        HTTP_GET {
+            url {
+              path /mrtg2/
+              digest 9b3a0c85a887a256d6939da88aabd8cd
+              status_code 200
+            }
+            connect_timeout 3
+            connect_port 8080
+            nb_get_retry 5
+            delay_before_retry 10
+        }
+        SSL_GET {
+            connect_port 8443
+        }
+    }
+}
+"
+test Keepalived.lns get http_check =
+  { "virtual_server"
+    { "ip" = "192.168.1.11" }
+    { "port" = "22" }
+    { "real_server"
+      { "ip" = "10.20.40.10" }
+      { "port" = "22" }
+      { "HTTP_GET"
+        { "url"
+          { "path" = "/mrtg2/" }
+          { "digest" = "9b3a0c85a887a256d6939da88aabd8cd" }
+          { "status_code" = "200" } }
+        { "connect_timeout" = "3" }
+        { "connect_port" = "8080" }
+        { "nb_get_retry" = "5" }
+        { "delay_before_retry" = "10" } }
+      { "SSL_GET"
+        { "connect_port" = "8443" } } } }
diff --git a/lenses/tests/test_known_hosts.aug b/lenses/tests/test_known_hosts.aug
new file mode 100644 (file)
index 0000000..19bec0e
--- /dev/null
@@ -0,0 +1,20 @@
+(*
+Module: Test_Known_Hosts
+  Provides unit tests and examples for the <Known_Hosts> lens.
+*)
+
+module Test_Known_Hosts =
+
+(* Test: Known_Hosts.lns
+     Simple get test *)
+test Known_Hosts.lns get "# A comment
+foo.example.com ecdsa-sha2-nistp256 AAABBBDKDFX=
+|1|FhUqf1kMlRWNfK6InQSAmXiNiSY=|jwbKFwD4ipl6D0k6OoshmW7xOao= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBIvNOU8OedkWalFmoFcJWP3nasnCLx6M78F9y0rzTQtplggNd0dvR0A4SQOBfHInmk5dH6YGGcpT3PM3cJBR7rI=\n" =
+  { "#comment" = "A comment" }
+  { "1" = "foo.example.com"
+    { "type" = "ecdsa-sha2-nistp256" }
+    { "key" = "AAABBBDKDFX=" } }
+  { "2" = "|1|FhUqf1kMlRWNfK6InQSAmXiNiSY=|jwbKFwD4ipl6D0k6OoshmW7xOao="
+    { "type" = "ecdsa-sha2-nistp256" }
+    { "key" = "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBIvNOU8OedkWalFmoFcJWP3nasnCLx6M78F9y0rzTQtplggNd0dvR0A4SQOBfHInmk5dH6YGGcpT3PM3cJBR7rI=" } }
+
diff --git a/lenses/tests/test_koji.aug b/lenses/tests/test_koji.aug
new file mode 100644 (file)
index 0000000..729e07f
--- /dev/null
@@ -0,0 +1,65 @@
+(*
+Module: Test_Koji
+  Provides unit tests and examples for the <Koji> lens.
+*)
+
+module Test_koji =
+
+  (* Variable: conf
+     A full koji.conf *)
+  let conf = "[koji]
+
+;configuration for koji cli tool
+
+;url of XMLRPC server
+server = http://localhost/kojihub
+
+;url of web interface
+weburl = http://localhost/koji
+
+;url of package download site
+pkgurl = http://localhost/packages
+
+;path to the koji top directory
+topdir = /mnt/koji
+
+;configuration for SSL athentication
+
+;client certificate
+cert = /etc/pki/koji/kojiadm.pem
+
+;certificate of the CA that issued the client certificate
+ca = /etc/pki/koji/koji_ca_cert.crt
+
+;certificate of the CA that issued the HTTP server certificate
+serverca = /etc/pki/koji/koji_ca_cert.crt
+"
+
+  test Koji.lns get conf =
+  { "section" = "koji"
+    {  }
+    { "#comment" = "configuration for koji cli tool" }
+    {  }
+    { "#comment" = "url of XMLRPC server" }
+    { "server" = "http://localhost/kojihub" }
+    {  }
+    { "#comment" = "url of web interface" }
+    { "weburl" = "http://localhost/koji" }
+    {  }
+    { "#comment" = "url of package download site" }
+    { "pkgurl" = "http://localhost/packages" }
+    {  }
+    { "#comment" = "path to the koji top directory" }
+    { "topdir" = "/mnt/koji" }
+    {  }
+    { "#comment" = "configuration for SSL athentication" }
+    {  }
+    { "#comment" = "client certificate" }
+    { "cert" = "/etc/pki/koji/kojiadm.pem" }
+    {  }
+    { "#comment" = "certificate of the CA that issued the client certificate" }
+    { "ca" = "/etc/pki/koji/koji_ca_cert.crt" }
+    {  }
+    { "#comment" = "certificate of the CA that issued the HTTP server certificate" }
+    { "serverca" = "/etc/pki/koji/koji_ca_cert.crt" }
+  }
index 86996eb..b0ec6d6 100644 (file)
@@ -1,6 +1,6 @@
 module Test_krb5 =
 
-  (* Krb5.conf from Fermi labs *)
+  (* Krb5.conf from Fermilab *)
   let fermi_str = "###
 ### This krb5.conf template is intended for use with Fermi
 ### Kerberos v1_2 and later.  Earlier versions may choke on the
@@ -15,6 +15,7 @@ module Test_krb5 =
        ccache_type = 4
        default_tgs_enCtypes = des-cbc-crc
        default_tkt_enctypes = des-cbc-crc
+       permitted_enctypes = des-cbc-crc des3-cbc-sha1
        default_lifetime = 7d
        renew_lifetime = 7d
        autologin = true
@@ -22,6 +23,11 @@ module Test_krb5 =
        forwardable = true
        renewable = true
        encrypt = true
+        v4_name_convert = {
+                host = {
+                        rcmd = host
+                        }
+                }
 
 [realms]
        FNAL.GOV = {
@@ -80,6 +86,11 @@ module Test_krb5 =
                default_domain = cern.ch
                kpasswd_server = afskrb5m.cern.ch
                admin_server = afskrb5m.cern.ch
+               v4_name_convert = {
+                        host = {
+                                rcmd = host
+                        }
+                }
        }
 
 [instancemapping]
@@ -271,8 +282,13 @@ test Krb5.lns get fermi_str =
     { "ticket_lifetime" = "1560m" }
     { "default_realm" = "FNAL.GOV" }
     { "ccache_type" = "4" }
-    { "default_tgs_enCtypes" = "des-cbc-crc" }
+    { "default_tgs_enctypes" = "des-cbc-crc" }
+    { "#eol" }
     { "default_tkt_enctypes" = "des-cbc-crc" }
+    { "#eol" }
+    { "permitted_enctypes" = "des-cbc-crc" }
+    { "permitted_enctypes" = "des3-cbc-sha1" }
+    { "#eol" }
     { "default_lifetime" = "7d" }
     { "renew_lifetime" = "7d" }
     { "autologin" = "true" }
@@ -280,6 +296,11 @@ test Krb5.lns get fermi_str =
     { "forwardable" = "true" }
     { "renewable" = "true" }
     { "encrypt" = "true" }
+    { "v4_name_convert"
+      { "host"
+        { "rcmd" = "host" }
+      }
+    }
     {  } }
   { "realms"
     { "realm" = "FNAL.GOV"
@@ -330,7 +351,13 @@ test Krb5.lns get fermi_str =
       { "kdc" = "afsdb1.cern.ch" }
       { "default_domain" = "cern.ch" }
       { "kpasswd_server" = "afskrb5m.cern.ch" }
-      { "admin_server" = "afskrb5m.cern.ch" } }
+      { "admin_server" = "afskrb5m.cern.ch" }
+      { "v4_name_convert"
+        { "host"
+          { "rcmd" = "host" }
+        }
+      }
+    }
     { } }
   { "instancemapping"
     { "afs"
@@ -348,7 +375,7 @@ test Krb5.lns get fermi_str =
     { "#comment" = "reside.  The WINBETA and FERMIBETA domains are the equivalent" }
     { "#comment" = "testing realms for the FERMIBETA domain.  The 2-way transitive" }
     { "#comment" = "trust structure of this complex is as follows:" }
-    { "#comment" }
+    {}
     { "#comment" = "FNAL.GOV <=> PILOT.FNAL.GOV" }
     { "#comment" = "FNAL.GOV <=> WIN.FERMI.GOV <=> FERMI.WIN.FERMI.GOV" }
     { "#comment" = "PILOT.FNAL.GOV <=> WINBETA.FNAL.GOV <=> FERMIBETA.WINBETA.FNAL.GOV" }
@@ -754,6 +781,8 @@ let realms_str = "[realms]
         admin_server = KERBEROS.MIT.EDU
         default_domain = MIT.EDU
         database_module = ldapconf
+
+        # test
         v4_instance_convert = {
              mit = mit.edu
              lithium = lithium.lcs.mit.edu
@@ -767,6 +796,8 @@ test Krb5.lns get realms_str =
       { "admin_server" = "KERBEROS.MIT.EDU" }
       { "default_domain" = "MIT.EDU" }
       { "database_module" = "ldapconf" }
+      { }
+      { "#comment" = "test" }
       { "v4_instance_convert"
         { "mit" = "mit.edu" }
         { "lithium" = "lithium.lcs.mit.edu" } }
@@ -907,3 +938,67 @@ test Krb5.lns get pam_str =
       { "renew_lifetime" = "36000" }
       { "forwardable" = "true" }
       { "krb4_convert" = "false" } }
+
+(* Ticket #274 - multiple *enctypes values *)
+let multiple_enctypes = "[libdefaults]
+permitted_enctypes = arcfour-hmac-md5 arcfour-hmac des3-cbc-sha1 des-cbc-md5 des-cbc-crc aes128-cts
+default_tgs_enctypes = des3-cbc-sha1 des-cbc-md5
+default_tkt_enctypes = des-cbc-md5
+"
+
+test Krb5.lns get multiple_enctypes =
+  { "libdefaults"
+    { "permitted_enctypes" = "arcfour-hmac-md5" }
+    { "permitted_enctypes" = "arcfour-hmac" }
+    { "permitted_enctypes" = "des3-cbc-sha1" }
+    { "permitted_enctypes" = "des-cbc-md5" }
+    { "permitted_enctypes" = "des-cbc-crc" }
+    { "permitted_enctypes" = "aes128-cts" }
+    { "#eol" }
+    { "default_tgs_enctypes" = "des3-cbc-sha1" }
+    { "default_tgs_enctypes" = "des-cbc-md5" }
+    { "#eol" }
+    { "default_tkt_enctypes" = "des-cbc-md5" }
+    { "#eol" }
+  }
+
+(* Ticket #274 - v4_name_convert subsection *)
+let v4_name_convert = "[realms]
+ EXAMPLE.COM = {
+  kdc = kerberos.example.com:88
+  admin_server = kerberos.example.com:749
+  default_domain = example.com
+  ticket_lifetime = 12h
+  v4_name_convert = {
+     host = {
+       rcmd = host
+     }
+  }
+ }
+"
+
+test Krb5.lns get v4_name_convert =
+  { "realms"
+    { "realm" = "EXAMPLE.COM"
+      { "kdc" = "kerberos.example.com:88" }
+      { "admin_server" = "kerberos.example.com:749" }
+      { "default_domain" = "example.com" }
+      { "ticket_lifetime" = "12h" }
+      { "v4_name_convert"
+        { "host"
+          { "rcmd" = "host" }
+        }
+      }
+    }
+  }
+
+(* Ticket #288: semicolons for comments *)
+test Krb5.lns get "; AD  : This Kerberos configuration is for CERN's Active Directory realm.\n" =
+    { "#comment" = "AD  : This Kerberos configuration is for CERN's Active Directory realm." }
+
+(* RHBZ#1066419: braces in values *)
+test Krb5.lns get "[libdefaults]\n
+default_ccache_name = KEYRING:persistent:%{uid}\n" =
+  { "libdefaults"
+    {  }
+    { "default_ccache_name" = "KEYRING:persistent:%{uid}" } }
diff --git a/lenses/tests/test_ldif.aug b/lenses/tests/test_ldif.aug
new file mode 100644 (file)
index 0000000..e7c220b
--- /dev/null
@@ -0,0 +1,150 @@
+(* Test for LDIF lens *)
+module Test_ldif =
+
+  (* Test LDIF content only *)
+  let content = "version: 1
+dn: cn=foo bar,dc=example,dc=com
+# test
+ou: example value
+cn:: Zm9vIGJhcg==
+# test
+telephoneNumber;foo;bar: +1 123 456 789
+binary;foo:< file:///file/something
+# test
+
+dn: cn=simple,dc=example,dc=com
+cn: simple
+test: split line starts with
+  :colon
+
+dn:: Y249c2ltcGxlLGRjPWV4YW1wbGUsZGM9Y29t
+# test
+cn: simple
+
+dn: cn=simple,dc=exam
+    ple,dc=com
+cn: simple
+telephoneNumber:: KzEgMTIzIDQ1
+  NiA3ODk=
+
+# test
+"
+
+  test Ldif.lns get content =
+    { "@content"
+        { "version" = "1" }
+        { "1" = "cn=foo bar,dc=example,dc=com"
+            { "#comment" = "test" }
+            { "ou" = "example value" }
+            { "cn"
+                { "@base64" = "Zm9vIGJhcg==" } }
+            { "#comment" = "test" }
+            { "telephoneNumber" = "+1 123 456 789"
+                { "@option" = "foo" }
+                { "@option" = "bar" } }
+            { "binary"
+                { "@option" = "foo" }
+                { "@url" = "file:///file/something" } } }
+        { "#comment" = "test" }
+        {}
+        { "2" = "cn=simple,dc=example,dc=com"
+            { "cn" = "simple" }
+            { "test" = "split line starts with
+  :colon" } }
+        {}
+        { "3"
+            { "@base64" = "Y249c2ltcGxlLGRjPWV4YW1wbGUsZGM9Y29t" }
+            { "#comment" = "test" }
+            { "cn" = "simple" } }
+        {}
+        { "4" = "cn=simple,dc=exam
+    ple,dc=com"
+            { "cn" = "simple" }
+            { "telephoneNumber"
+                { "@base64" = "KzEgMTIzIDQ1
+  NiA3ODk=" } } }
+        {}
+        { "#comment" = "test" }
+    }
+
+  (* Test LDIF changes *)
+  let changes = "version: 1
+dn: cn=foo,dc=example,dc=com
+changetype: delete
+
+dn: cn=simple,dc=example,dc=com
+control: 1.2.3.4
+control: 1.2.3.4  true
+# test
+control: 1.2.3.4  true: foo bar
+control: 1.2.3.4  true:: Zm9vIGJhcg==
+changetype: add
+cn: simple
+
+dn: cn=foo bar,dc=example,dc=com
+changeType: modify
+add: telephoneNumber
+telephoneNumber: +1 123 456 789
+-
+replace: homePostalAddress;lang-fr
+homePostalAddress;lang-fr: 34 rue de Seine
+# test
+-
+delete: telephoneNumber
+-
+replace: telephoneNumber
+telephoneNumber:: KzEgMTIzIDQ1NiA3ODk=
+-
+
+dn: cn=foo,dc=example,dc=com
+changetype: moddn
+newrdn: cn=bar
+deleteoldrdn: 0
+newsuperior: dc=example,dc=net
+"
+
+  test Ldif.lns get changes =
+    { "@changes"
+        { "version" = "1" }
+        { "1" = "cn=foo,dc=example,dc=com"
+            { "changetype" = "delete" } }
+        {}
+        { "2" = "cn=simple,dc=example,dc=com"
+            { "control" = "1.2.3.4" }
+            { "control" = "1.2.3.4"
+                { "criticality" = "true" } }
+            { "#comment" = "test" }
+            { "control" = "1.2.3.4"
+                { "criticality" = "true" }
+                { "value" = "foo bar" } }
+            { "control" = "1.2.3.4"
+                { "criticality" = "true" }
+                { "value"
+                    { "@base64" = "Zm9vIGJhcg==" } } }
+            { "changetype" = "add" }
+            { "cn" = "simple" } }
+        {}
+        { "3" = "cn=foo bar,dc=example,dc=com"
+            { "changeType" = "modify" }
+            { "add" = "telephoneNumber"
+                { "telephoneNumber" = "+1 123 456 789" } }
+            { "replace" = "homePostalAddress"
+                { "@option" = "lang-fr" }
+                { "homePostalAddress" = "34 rue de Seine"
+                    { "@option" = "lang-fr" } }
+                { "#comment" = "test" } }
+            { "delete" = "telephoneNumber" }
+            { "replace" = "telephoneNumber"
+                { "telephoneNumber"
+                    { "@base64" = "KzEgMTIzIDQ1NiA3ODk=" } } } }
+        {}
+        { "4" = "cn=foo,dc=example,dc=com"
+            { "changetype" = "moddn" }
+            { "newrdn" = "cn=bar" }
+            { "deleteoldrdn" = "0" }
+            { "newsuperior" = "dc=example,dc=net" } }
+    }
+
+(* Local Variables: *)
+(* mode: caml       *)
+(* End:             *)
diff --git a/lenses/tests/test_ldso.aug b/lenses/tests/test_ldso.aug
new file mode 100644 (file)
index 0000000..70ee07d
--- /dev/null
@@ -0,0 +1,26 @@
+(*
+Module: Test_Ldso
+  Provides unit tests and examples for the <Ldso> lens.
+*)
+
+module Test_Ldso =
+
+(* Variable: conf *)
+let conf = "include /etc/ld.so.conf.d/*.conf
+
+# libc default configuration
+/usr/local/lib
+
+hwcap 1 nosegneg
+"
+
+(* Test: Ldso.lns *)
+test Ldso.lns get conf =
+   { "include" = "/etc/ld.so.conf.d/*.conf" }
+   { }
+   { "#comment" = "libc default configuration" }
+   { "path" = "/usr/local/lib" }
+   { }
+   { "hwcap"
+     { "bit" = "1" }
+     { "name" = "nosegneg" } }
diff --git a/lenses/tests/test_lightdm.aug b/lenses/tests/test_lightdm.aug
new file mode 100644 (file)
index 0000000..90f3b47
--- /dev/null
@@ -0,0 +1,125 @@
+(* 
+Module: Test_Lightdm
+   Module to test Lightdm module for Augeas
+
+Author: David Salmen <dsalmen@dsalmen.com>
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+*)
+
+module Test_lightdm =
+
+    let conf_lightdm = "
+[SeatDefaults]
+greeter-session=unity-greeter
+user-session=ubuntu
+"
+
+   test Lightdm.lns get conf_lightdm =
+      {}
+      { "SeatDefaults"
+         { "greeter-session" = "unity-greeter" }
+         { "user-session" = "ubuntu" }
+      }
+
+    test Lightdm.lns put conf_lightdm after
+       set "SeatDefaults/allow-guest" "false"
+    = "
+[SeatDefaults]
+greeter-session=unity-greeter
+user-session=ubuntu
+allow-guest=false
+"
+
+    test Lightdm.lns put conf_lightdm after
+       set "SeatDefaults/allow-guest" "true"
+    = "
+[SeatDefaults]
+greeter-session=unity-greeter
+user-session=ubuntu
+allow-guest=true
+"
+
+    let conf_unity_greeter = "
+#
+# background = Background file to use, either an image path or a color (e.g. #772953)
+# logo = Logo file to use
+# theme-name = GTK+ theme to use
+# font-name = Font to use
+# xft-antialias = Whether to antialias Xft fonts (true or false)
+# xft-dpi = Resolution for Xft in dots per inch (e.g. 96)
+# xft-hintstyle = What degree of hinting to use (hintnone, hintslight, hintmedium, or hintfull)
+# xft-rgba = Type of subpixel antialiasing (none, rgb, bgr, vrgb or vbgr)
+#
+[greeter]
+background=/usr/share/backgrounds/warty-final-ubuntu.png
+logo=/usr/share/unity-greeter/logo.png
+theme-name=Ambiance
+icon-theme-name=ubuntu-mono-dark
+font-name=Ubuntu 11
+xft-antialias=true
+xft-dpi=96
+xft-hintstyle=hintslight
+xft-rgba=rgb
+" 
+
+    test Lightdm.lns get conf_unity_greeter =
+        {}
+        {}
+        { "#comment" = "background = Background file to use, either an image path or a color (e.g. #772953)" }
+        { "#comment" = "logo = Logo file to use" }
+        { "#comment" = "theme-name = GTK+ theme to use" }
+        { "#comment" = "font-name = Font to use" }
+        { "#comment" = "xft-antialias = Whether to antialias Xft fonts (true or false)" }
+        { "#comment" = "xft-dpi = Resolution for Xft in dots per inch (e.g. 96)" }
+        { "#comment" = "xft-hintstyle = What degree of hinting to use (hintnone, hintslight, hintmedium, or hintfull)" }
+        { "#comment" = "xft-rgba = Type of subpixel antialiasing (none, rgb, bgr, vrgb or vbgr)" }
+        {}
+        { "greeter"
+            { "background" = "/usr/share/backgrounds/warty-final-ubuntu.png" }
+            { "logo" = "/usr/share/unity-greeter/logo.png" }
+            { "theme-name" = "Ambiance" }
+            { "icon-theme-name" = "ubuntu-mono-dark" }
+            { "font-name" = "Ubuntu 11" }
+            { "xft-antialias" = "true" }
+            { "xft-dpi" = "96" }
+            { "xft-hintstyle" = "hintslight" }
+            { "xft-rgba" = "rgb" }
+        }
+
+    let conf_users = "
+#
+# User accounts configuration
+#
+# NOTE: If you have AccountsService installed on your system, then LightDM will
+# use this instead and these settings will be ignored
+#
+# minimum-uid = Minimum UID required to be shown in greeter
+# hidden-users = Users that are not shown to the user
+# hidden-shells = Shells that indicate a user cannot login
+#
+[UserAccounts]
+minimum-uid=500
+hidden-users=nobody nobody4 noaccess
+hidden-shells=/bin/false /usr/sbin/nologin
+"
+
+    test Lightdm.lns get conf_users =
+        {}
+        {}
+        { "#comment" = "User accounts configuration" }
+        {}
+        { "#comment" = "NOTE: If you have AccountsService installed on your system, then LightDM will" }
+        { "#comment" = "use this instead and these settings will be ignored" }
+        {}
+        { "#comment" = "minimum-uid = Minimum UID required to be shown in greeter" }
+        { "#comment" = "hidden-users = Users that are not shown to the user" }
+        { "#comment" = "hidden-shells = Shells that indicate a user cannot login" }
+        {}
+        { "UserAccounts"
+            { "minimum-uid" = "500" }
+            { "hidden-users" = "nobody nobody4 noaccess" }
+            { "hidden-shells" = "/bin/false /usr/sbin/nologin" }
+        }
+
index 6c8df40..1c2c035 100644 (file)
@@ -1,6 +1,20 @@
 module Test_logrotate =
 
-   let conf = "# see man logrotate for details
+test Logrotate.body get "\n{\n monthly\n}" =
+  { "schedule" = "monthly" }
+
+test Logrotate.rule get "/var/log/foo\n{\n monthly\n}\n" =
+  { "rule"
+    { "file" = "/var/log/foo" }
+    { "schedule" = "monthly" } }
+
+test Logrotate.rule get "/var/log/foo /var/log/bar\n{\n monthly\n}\n" =
+  { "rule"
+    { "file" = "/var/log/foo" }
+    { "file" = "/var/log/bar" }
+    { "schedule" = "monthly" } }
+
+let conf = "# see man logrotate for details
 # rotate log files weekly
 weekly
 
@@ -59,9 +73,35 @@ include /etc/logrotate.d
                 fi
         endscript
 }
+/var/log/mailman/digest {
+    su root list
+    monthly
+    missingok
+    create 0664 list list
+    rotate 4
+    compress
+    delaycompress
+        sharedscripts
+        postrotate
+            [ -f '/var/run/mailman/mailman.pid' ] && /usr/lib/mailman/bin/mailmanctl -q reopen || exit 0
+        endscript
+}
+/var/log/ntp {
+    compress
+    dateext
+    maxage 365
+    rotate 99
+    size=+2048k
+    notifempty
+    missingok
+    copytruncate
+    postrotate
+        chmod 644 /var/log/ntp
+    endscript
+}
 "
 
-   test Logrotate.lns get conf =
+test Logrotate.lns get conf =
       { "#comment" = "see man logrotate for details" }
       { "#comment" = "rotate log files weekly" }
       { "schedule" = "weekly" }
@@ -105,7 +145,7 @@ include /etc/logrotate.d
            { "rotate" = "1" } }
       { "rule"
            { "file"      = "/var/log/vsftpd.log" }
-           { "#comment"   = "ftpd doesn't handle SIGHUP properly" }
+           { "#comment"  = "ftpd doesn't handle SIGHUP properly" }
            { "compress"  = "nocompress" }
            { "missingok" = "missingok" }
            { "ifempty"   = "notifempty" }
@@ -128,38 +168,65 @@ include /etc/logrotate.d
            { "prerotate" = "                if [ -f /var/run/apache2.pid ]; then
                         /etc/init.d/apache2 restart > /dev/null
                 fi" } }
+      { "rule"
+           { "file" = "/var/log/mailman/digest" }
+           { "su"
+               { "owner" = "root" }
+               { "group" = "list" } }
+           { "schedule"  = "monthly" }
+           { "missingok" = "missingok" }
+           { "create"
+               { "mode"  = "0664" }
+               { "owner" = "list" }
+               { "group" = "list" } }
+           { "rotate"        = "4" }
+           { "compress"      = "compress" }
+           { "delaycompress" = "delaycompress" }
+           { "sharedscripts" = "sharedscripts" }
+           { "postrotate"    = "            [ -f '/var/run/mailman/mailman.pid' ] && /usr/lib/mailman/bin/mailmanctl -q reopen || exit 0" } }
+      { "rule"
+           { "file" = "/var/log/ntp" }
+           { "compress" = "compress" }
+           { "dateext" = "dateext" }
+           { "maxage" = "365" }
+           { "rotate" = "99" }
+           { "size" = "+2048k" }
+           { "ifempty" = "notifempty" }
+           { "missingok" = "missingok" }
+           { "copytruncate" = "copytruncate" }
+           { "postrotate" = "        chmod 644 /var/log/ntp" } }
 
-  test Logrotate.lns get "/var/log/file {\n dateext\n}\n" =
+test Logrotate.lns get "/var/log/file {\n dateext\n}\n" =
     { "rule"
       { "file" = "/var/log/file" }
       { "dateext" = "dateext" } }
 
   (* Make sure 'minsize 1M' works *)
-  test Logrotate.lns get "/avr/log/wtmp {\n minsize 1M\n}\n" =
+test Logrotate.lns get "/avr/log/wtmp {\n minsize 1M\n}\n" =
   { "rule"
       { "file" = "/avr/log/wtmp" }
       { "minsize" = "1M" } }
 
   (* '=' is a legal separator, file names can be indented *)
-   test Logrotate.lns get " \t /file {\n size=5M\n}\n" =
+test Logrotate.lns get " \t /file {\n size=5M\n}\n" =
      { "rule"
          { "file" = "/file" }
          { "size" = "5M" } }
 
   (* Can leave owner/group off a create statement *)
-  test Logrotate.lns get "/file {
+test Logrotate.lns get "/file {
        create 600\n}\n" =
      { "rule"
          { "file" = "/file" }
          { "create"
              { "mode" = "600" } } }
 
-  test Logrotate.lns put "/file {\n    create 600\n}\n" after
+test Logrotate.lns put "/file {\n      create 600\n}\n" after
     set "/rule/create/owner" "user"
   = "/file {\n create 600 user\n}\n"
 
   (* The newline at the end of a script is optional *)
-  test Logrotate.lns put "/file {\n size=5M\n}\n" after
+test Logrotate.lns put "/file {\n size=5M\n}\n" after
     set "/rule/prerotate" "\tfoobar"
   =
 "/file {
@@ -168,7 +235,7 @@ include /etc/logrotate.d
 \tfoobar
 \tendscript\n}\n"
 
-  test Logrotate.lns put "/file {\n size=5M\n}\n" after
+test Logrotate.lns put "/file {\n size=5M\n}\n" after
     set "/rule/prerotate" "\tfoobar\n"
   =
 "/file {
diff --git a/lenses/tests/test_logwatch.aug b/lenses/tests/test_logwatch.aug
new file mode 100644 (file)
index 0000000..f2ba806
--- /dev/null
@@ -0,0 +1,15 @@
+module Test_logwatch =
+
+let conf = "# Configuration file for logwatch.
+#
+#Mailto_host1 = user@example.com
+
+MailFrom = root@example.com
+"
+
+test Logwatch.lns get conf =
+  { "#comment" = "Configuration file for logwatch." }
+  {}
+  { "#comment" = "Mailto_host1 = user@example.com" }
+  {}
+  { "MailFrom" = "root@example.com" }
diff --git a/lenses/tests/test_lvm.aug b/lenses/tests/test_lvm.aug
new file mode 100644 (file)
index 0000000..8ee2377
--- /dev/null
@@ -0,0 +1,253 @@
+(*
+Module: Test_LVM
+  Provides unit tests and examples for the <LVM> lens.
+*)
+
+module Test_LVM =
+
+(* Variable: conf
+   A full configuration file *)
+let conf = "# Generated by LVM2: date
+
+contents = \"Text Format Volume Group\"
+version = 1
+
+description = \"Created *after* executing 'eek'\"
+
+creation_host = \"eek\"                # Linux eek
+creation_time = 6666666666     # eeeek
+
+VG1 {
+       id = \"uuid-uuid-uuid-uuid\"
+       seqno = 2
+       status = [\"RESIZEABLE\", \"READ\", \"WRITE\"]
+       extent_size = 8192              # 4 Megabytes
+       max_lv = 0
+       max_pv = 0
+       process_priority = -18
+
+       physical_volumes {
+               pv0 {
+                       id = \"uuid-uuid-uuid-uuid\"
+                       device = \"/dev/sda6\"  # Hint only
+
+                       status = [\"ALLOCATABLE\"]
+                       pe_start = 123
+                       pe_count = 123456       # many Gigabytes
+               }
+       }
+
+       logical_volumes {
+               LogicalEek {
+                       id = \"uuid-uuid-uuid-uuid\"
+                       status = [\"READ\", \"WRITE\", \"VISIBLE\"]
+                       segment_count = 1
+
+                       segment1 {
+                               start_extent = 0
+                               extent_count = 123456   # beaucoup Gigabytes
+
+                               type = \"striped\"
+                               stripe_count = 1        # linear
+
+                               stripes = [
+                                       \"pv0\", 0
+                               ]
+                       }
+               }
+       }
+}
+"
+
+test LVM.int get "5" = { "int" = "5" }
+test LVM.str get "\"abc\"" = { "str" = "abc"}
+test LVM.lns get "\n" = {}
+test LVM.lns get "#foo\n" = { "#comment" = "foo"}
+
+test LVM.lns get "# Generated by LVM2: date
+
+contents = \"Text Format Volume Group\"
+version = 1
+
+description = \"Created *after* executing 'eek'\"
+
+creation_host = \"eek\"                # Linux eek
+creation_time = 6666666666     # eeeek\n" =
+       { "#comment" = "Generated by LVM2: date" }
+       {}
+       { "contents"
+               { "str" = "Text Format Volume Group" }
+       }
+       { "version"
+               { "int" = "1" }
+       }
+       {}
+       { "description"
+               { "str" = "Created *after* executing 'eek'" }
+       }
+       {}
+       { "creation_host"
+               { "str" = "eek" }
+               { "#comment" = "Linux eek" }
+       }
+       { "creation_time"
+               { "int" = "6666666666" }
+               { "#comment" = "eeeek" }
+       }
+
+(* Test: LVM.lns
+   Test the full <conf> *)
+test LVM.lns get conf =
+       { "#comment" = "Generated by LVM2: date" }
+       {}
+       { "contents"
+               { "str" = "Text Format Volume Group" }
+       }
+       { "version"
+               { "int" = "1" }
+       }
+       {}
+       { "description"
+               { "str" = "Created *after* executing 'eek'" }
+       }
+       {}
+       { "creation_host"
+               { "str" = "eek" }
+               { "#comment" = "Linux eek" }
+       }
+       { "creation_time"
+               { "int" = "6666666666" }
+               { "#comment" = "eeeek" }
+       }
+       {}
+       { "VG1"
+               { "dict"
+                       { "id"
+                               { "str" = "uuid-uuid-uuid-uuid" }
+                       }
+                       { "seqno"
+                               { "int" = "2" }
+                       }
+                       { "status"
+                               { "list"
+                                       { "1"
+                                               { "str" = "RESIZEABLE" }
+                                       }
+                                       { "2"
+                                               { "str" = "READ" }
+                                       }
+                                       { "3"
+                                               { "str" = "WRITE" }
+                                       }
+                               }
+                       }
+                       { "extent_size"
+                               { "int" = "8192" }
+                               { "#comment" = "4 Megabytes" }
+                       }
+                       { "max_lv"
+                               { "int" = "0" }
+                       }
+                       { "max_pv"
+                               { "int" = "0" }
+                       }
+                       { "process_priority"
+                               { "int" = "-18" }
+                       }
+                       {}
+                       { "physical_volumes"
+                               { "dict"
+                                       { "pv0"
+                                               { "dict"
+                                                       { "id"
+                                                               { "str" = "uuid-uuid-uuid-uuid" }
+                                                       }
+                                                       { "device"
+                                                               { "str" = "/dev/sda6" }
+                                                               { "#comment" = "Hint only" }
+                                                       }
+                                                       {}
+                                                       { "status"
+                                                               { "list"
+                                                                       { "1"
+                                                                               { "str" = "ALLOCATABLE" }
+                                                                       }
+                                                               }
+                                                       }
+                                                       { "pe_start"
+                                                               { "int" = "123" }
+                                                       }
+                                                       { "pe_count"
+                                                               { "int" = "123456" }
+                                                               { "#comment" = "many Gigabytes" }
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+                       {}
+                       { "logical_volumes"
+                               { "dict"
+                                       { "LogicalEek"
+                                               { "dict"
+                                                       { "id"
+                                                               { "str" = "uuid-uuid-uuid-uuid" }
+                                                       }
+                                                       { "status"
+                                                               { "list"
+                                                                       { "1"
+                                                                               { "str" = "READ" }
+                                                                       }
+                                                                       { "2"
+                                                                               { "str" = "WRITE" }
+                                                                       }
+                                                                       { "3"
+                                                                               { "str" = "VISIBLE" }
+                                                                       }
+                                                               }
+                                                       }
+                                                       { "segment_count"
+                                                               { "int" = "1" }
+                                                       }
+                                                       {}
+                                                       { "segment1"
+                                                               { "dict"
+                                                                       { "start_extent"
+                                                                               { "int" = "0" }
+                                                                       }
+                                                                       { "extent_count"
+                                                                               { "int" = "123456" }
+                                                                               { "#comment" = "beaucoup Gigabytes" }
+                                                                       }
+                                                                       {}
+                                                                       { "type"
+                                                                               { "str" = "striped" }
+                                                                       }
+                                                                       { "stripe_count"
+                                                                               { "int" = "1" }
+                                                                               { "#comment" = "linear" }
+                                                                       }
+                                                                       {}
+                                                                       { "stripes"
+                                                                               { "list"
+                                                                                       { "1"
+                                                                                               { "str" = "pv0" }
+                                                                                       }
+                                                                                       { "2"
+                                                                                               { "int" = "0" }
+                                                                                       }
+                                                                               }
+                                                                       }
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+
+(* Parse description from RHEL 6 *)
+let descr="\"Created *before* executing '/sbin/vgs --noheadings -o name --config 'log{command_names=0 prefix=\\\"  \\\"}''\""
+test LVM.str get descr =
+  { "str" = "Created *before* executing '/sbin/vgs --noheadings -o name --config 'log{command_names=0 prefix=\\\"  \\\"}''" }
diff --git a/lenses/tests/test_mcollective.aug b/lenses/tests/test_mcollective.aug
new file mode 100644 (file)
index 0000000..e71a85d
--- /dev/null
@@ -0,0 +1,53 @@
+(*
+Module: Test_MCollective
+  Provides unit tests and examples for the <MCollective> lens.
+*)
+
+module Test_MCollective =
+
+let conf = "topicprefix = /topic/
+main_collective = mcollective
+collectives = mcollective
+libdir = /usr/libexec/mcollective
+logger_type = console
+loglevel = warn
+
+# Plugins
+securityprovider = psk
+plugin.psk = unset
+
+connector = stomp
+plugin.stomp.host = localhost
+plugin.stomp.port = 61613
+plugin.stomp.user = mcollective
+plugin.stomp.password = secret
+
+# Facts
+factsource = yaml # bla
+plugin.yaml=/etc/mcollective/facts.yaml
+"
+
+test MCollective.lns get conf =
+  { "topicprefix" = "/topic/" }
+  { "main_collective" = "mcollective" }
+  { "collectives" = "mcollective" }
+  { "libdir" = "/usr/libexec/mcollective" }
+  { "logger_type" = "console" }
+  { "loglevel" = "warn" }
+  { }
+  { "#comment" = "Plugins" }
+  { "securityprovider" = "psk" }
+  { "plugin.psk" = "unset" }
+  { }
+  { "connector" = "stomp" }
+  { "plugin.stomp.host" = "localhost" }
+  { "plugin.stomp.port" = "61613" }
+  { "plugin.stomp.user" = "mcollective" }
+  { "plugin.stomp.password" = "secret" }
+  { }
+  { "#comment" = "Facts" }
+  { "factsource" = "yaml"
+    { "#comment" = "bla" }
+  }
+  { "plugin.yaml" = "/etc/mcollective/facts.yaml" }
+
diff --git a/lenses/tests/test_memcached.aug b/lenses/tests/test_memcached.aug
new file mode 100644 (file)
index 0000000..2a287c2
--- /dev/null
@@ -0,0 +1,43 @@
+(*
+Module: Test_Memcached
+  Provides unit tests and examples for the <Memcached> lens.
+*)
+
+module Test_Memcached =
+
+let conf = "# memcached default config file
+
+# Run memcached as a daemon. This command is implied, and is not needed for the
+# daemon to run. See the README.Debian that comes with this package for more
+# information.
+-d
+-l 127.0.0.1
+
+# Log memcached's output to /var/log/memcached
+logfile /var/log/memcached.log
+
+# Default connection port is 11211
+-p 11211    
+-m    64    #    Start with a cap of 64 megs of memory.
+-M
+"
+
+test Memcached.lns get conf =
+  { "#comment" = "memcached default config file" }
+  { }
+  { "#comment" = "Run memcached as a daemon. This command is implied, and is not needed for the" }
+  { "#comment" = "daemon to run. See the README.Debian that comes with this package for more" }
+  { "#comment" = "information." }
+  { "d" }
+  { "l" = "127.0.0.1" }
+  { }
+  { "#comment" = "Log memcached's output to /var/log/memcached" }
+  { "logfile"  = "/var/log/memcached.log" }
+  { }
+  { "#comment" = "Default connection port is 11211" }
+  { "p" = "11211" }
+  { "m" = "64"
+    { "#comment" = "Start with a cap of 64 megs of memory." }
+  }
+  { "M" }
+
index 39ac9e2..f1ddbe9 100644 (file)
@@ -7,6 +7,8 @@ module Test_mke2fs =
 
 [defaults]
        base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr
+       default_mntopts = acl,user_xattr
+       enable_periodic_fsck = 0
        blocksize = 4096
        inode_size = 256
         ; here goes inode_ratio
@@ -18,6 +20,7 @@ module Test_mke2fs =
                 # this is ext4dev conf
 
                features = has_journal,^extent
+               auto_64-bit_support = 1
                inode_size = 256
                options = test_fs=1
        }
@@ -43,6 +46,10 @@ module Test_mke2fs =
              { "resize_inode" }
              { "dir_index" }
              { "ext_attr" } }
+        { "default_mntopts"
+             { "acl" }
+             { "user_xattr" } }
+        { "enable_periodic_fsck" = "0" }
         { "blocksize" = "4096" }
         { "inode_size" = "256" }
         { "#comment" = "here goes inode_ratio" }
@@ -57,6 +64,7 @@ module Test_mke2fs =
                 { "has_journal" }
                 { "extent"
                    { "disable" } } }
+             { "auto_64-bit_support" = "1" }
              { "inode_size" = "256" }
              { "options"
                 { "test_fs" = "1" } } }
index 65a7f15..30a7bce 100644 (file)
@@ -26,7 +26,13 @@ install export_nodep-$BITNESS echo Installing export_nodep
 # Remove commands
 remove bar echo Removing bar
 remove foo echo Removing foo
-remove export_nodep-$BITNESS echo Removing export_nodep\n"
+remove export_nodep-$BITNESS echo Removing export_nodep
+
+# Softdep
+softdep uhci-hcd post: foo
+softdep uhci-hcd pre: ehci-hcd foo
+softdep uhci-hcd pre: ehci-hcd foo post: foo
+"
 
 test Modprobe.lns get conf =
   { "#comment" = "Various aliases" }
@@ -88,6 +94,20 @@ test Modprobe.lns get conf =
   { "remove" = "export_nodep-$BITNESS"
     { "command" = "echo Removing export_nodep" }
   }
+  {  }
+  { "#comment" = "Softdep" }
+  { "softdep" = "uhci-hcd"
+    { "post" = "foo" }
+  }
+  { "softdep" = "uhci-hcd"
+    { "pre" = "ehci-hcd" }
+    { "pre" = "foo" }
+  }
+  { "softdep" = "uhci-hcd"
+    { "pre" = "ehci-hcd" }
+    { "pre" = "foo" }
+    { "post" = "foo" }
+  }
 
 
 (* eol-comments *)
@@ -104,3 +124,24 @@ test Modprobe.entry get options_space_quote =
     { "attr1" = "\"val\"" }
     { "attr2" = "\"val2 val3\"" }
   }
+
+(* Allow spaces around the '=', BZ 826752 *)
+test Modprobe.entry get "options ipv6 disable = 1\n" =
+  { "options" = "ipv6"
+    { "disable" = "1" } }
+
+(* Support multiline split commands, Ubuntu bug #1054306 *)
+test Modprobe.lns get "# /etc/modprobe.d/iwlwifi.conf
+# iwlwifi will dyamically load either iwldvm or iwlmvm depending on the
+# microcode file installed on the system. When removing iwlwifi, first
+# remove the iwl?vm module and then iwlwifi.
+remove iwlwifi \
+(/sbin/lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs /sbin/rmmod) \
+&& /sbin/modprobe -r mac80211\n" =
+  { "#comment" = "/etc/modprobe.d/iwlwifi.conf" }
+  { "#comment" = "iwlwifi will dyamically load either iwldvm or iwlmvm depending on the" }
+  { "#comment" = "microcode file installed on the system. When removing iwlwifi, first" }
+  { "#comment" = "remove the iwl?vm module and then iwlwifi." }
+  { "remove" = "iwlwifi"
+    { "command" = "(/sbin/lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs /sbin/rmmod) \\\n&& /sbin/modprobe -r mac80211" }
+  }
diff --git a/lenses/tests/test_mongodbserver.aug b/lenses/tests/test_mongodbserver.aug
new file mode 100644 (file)
index 0000000..8363d7b
--- /dev/null
@@ -0,0 +1,31 @@
+(*
+Module: Test_MongoDBServer
+  Provides unit tests and examples for the <MongoDBServer> lens.
+*)
+
+module Test_MongoDBServer =
+
+(* Variable: conf *)
+let conf = "port = 27017
+fork = true
+pidfilepath = /var/run/mongodb/mongodb.pid
+logpath = /var/log/mongodb/mongodb.log
+dbpath =/var/lib/mongodb
+journal = true
+nohttpinterface = true
+"
+
+(* Test: MongoDBServer.lns *)
+test MongoDBServer.lns get conf =
+  { "port" = "27017" }
+  { "fork" = "true" }
+  { "pidfilepath" = "/var/run/mongodb/mongodb.pid" }
+  { "logpath" = "/var/log/mongodb/mongodb.log" }
+  { "dbpath" = "/var/lib/mongodb" }
+  { "journal" = "true" }
+  { "nohttpinterface" = "true" }
+
+(* Test: MongoDBServer.lns
+   Values have to be without quotes *)
+test MongoDBServer.lns get "port = 27017\n" =
+  { "port" = "27017" }
index 0fbfca9..6dcfdce 100644 (file)
@@ -78,12 +78,14 @@ devices {
                hardware_handler        \"0\"
                failback                15
                rr_weight               priorities
+               rr_min_io_rq            75
                no_path_retry           queue
        }
        device {
                vendor                  \"COMPAQ  \"
                product                 \"MSA1000         \"
                path_grouping_policy    multibus
+               polling_interval        9
        }
 }\n"
 
@@ -158,8 +160,10 @@ test Multipath.lns get conf =
       { "hardware_handler" = "0" }
       { "failback" = "15" }
       { "rr_weight" = "priorities" }
+      { "rr_min_io_rq" = "75" }
       { "no_path_retry" = "queue" } }
     { "device"
       { "vendor" = "COMPAQ  " }
       { "product" = "MSA1000         " }
-      { "path_grouping_policy" = "multibus" } } }
+      { "path_grouping_policy" = "multibus" }
+      { "polling_interval" = "9" } } }
index 39c75c4..9356204 100644 (file)
@@ -139,13 +139,13 @@ key_buffer                = 16M
 
 
    test MySQL.lns get conf =   { "#comment" = "The MySQL database server configuration file." }
-  { "#comment" }
+  {}
   { "#comment" = "You can copy this to one of:" }
-  { "#comment" }
+  {}
   { "#comment" = "One can use all long options that the program supports." }
   { "#comment" = "Run program with --help to get a list of available options and with" }
   { "#comment" = "--print-defaults to see which it would actually understand and use." }
-  { "#comment" }
+  {}
   { "#comment" = "For explanations see" }
   { "#comment" = "http://dev.mysql.com/doc/mysql/en/server-system-variables.html" }
   {  }
@@ -167,9 +167,9 @@ key_buffer          = 16M
     {  }
   }
   { "target" = "mysqld"
-    { "#comment" }
+    {}
     { "#comment" = "* Basic Settings" }
-    { "#comment" }
+    {}
     { "user" = "mysql" }
     { "pid-file" = "/var/run/mysqld/mysqld.pid" }
     { "socket" = "/var/run/mysqld/mysqld.sock" }
@@ -179,13 +179,13 @@ key_buffer                = 16M
     { "tmpdir" = "/tmp" }
     { "language" = "/usr/share/mysql/english" }
     { "skip-external-locking" = "" }
-    { "#comment" }
+    {}
     { "#comment" = "Instead of skip-networking the default is now to listen only on" }
     { "#comment" = "localhost which is more compatible and is not less secure." }
     { "bind-address" = "127.0.0.1" }
-    { "#comment" }
+    {}
     { "#comment" = "* Fine Tuning" }
-    { "#comment" }
+    {}
     { "key_buffer" = "16M" }
     { "max_allowed_packet" = "16M" }
     { "thread_stack" = "128K" }
@@ -193,25 +193,25 @@ key_buffer                = 16M
     { "#comment" = "max_connections        = 100" }
     { "#comment" = "table_cache            = 64" }
     { "#comment" = "thread_concurrency     = 10" }
-    { "#comment" }
+    {}
     { "#comment" = "* Query Cache Configuration" }
-    { "#comment" }
+    {}
     { "query_cache_limit" = "1M" }
     { "query_cache_size" = "16M" }
-    { "#comment" }
+    {}
     { "#comment" = "* Logging and Replication" }
-    { "#comment" }
+    {}
     { "#comment" = "Both location gets rotated by the cronjob." }
     { "#comment" = "Be aware that this log type is a performance killer." }
     { "#comment" = "log                = /var/log/mysql/mysql.log" }
-    { "#comment" }
+    {}
     { "#comment" = "Error logging goes to syslog. This is a Debian improvement :)" }
-    { "#comment" }
+    {}
     { "#comment" = "Here you can see queries with especially long duration" }
     { "#comment" = "log_slow_queries   = /var/log/mysql/mysql-slow.log" }
     { "#comment" = "long_query_time = 2" }
     { "#comment" = "log-queries-not-using-indexes" }
-    { "#comment" }
+    {}
     { "#comment" = "The following can be used as easy to replay backup logs or for replication." }
     { "#comment" = "server-id          = 1" }
     { "#comment" = "log_bin            = /var/log/mysql/mysql-bin.log" }
@@ -220,25 +220,25 @@ key_buffer                = 16M
     { "#comment" = "max_binlog_size    = 100M" }
     { "#comment" = "binlog_do_db               = include_database_name" }
     { "#comment" = "binlog_ignore_db   = include_database_name" }
-    { "#comment" }
+    {}
     { "#comment" = "* BerkeleyDB" }
-    { "#comment" }
+    {}
     { "#comment" = "Using BerkeleyDB is now discouraged as its support will cease in 5.1.12." }
     { "skip-bdb" = "" }
-    { "#comment" }
+    {}
     { "#comment" = "* InnoDB" }
-    { "#comment" }
+    {}
     { "#comment" = "InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/." }
     { "#comment" = "Read the manual for more InnoDB related options. There are many!" }
     { "#comment" = "You might want to disable InnoDB to shrink the mysqld process by circa 100MB." }
     { "#comment" = "skip-innodb" }
-    { "#comment" }
+    {}
     { "#comment" = "* Security Features" }
-    { "#comment" }
+    {}
     { "#comment" = "Read the manual, too, if you want chroot!" }
     { "#comment" = "chroot = /var/lib/mysql/" }
-    { "#comment" }
-    { "#comment" }
+    {}
+    {}
     { "#comment" = "ssl-ca=/etc/mysql/cacert.pem" }
     { "#comment" = "ssl-cert=/etc/mysql/server-cert.pem" }
     { "#comment" = "ssl-key=/etc/mysql/server-key.pem" }
@@ -259,21 +259,21 @@ key_buffer                = 16M
   { "target" = "isamchk"
     { "key_buffer" = "16M" }
     {  }
-    { "#comment" }
+    {}
     { "#comment" = "* NDB Cluster" }
-    { "#comment" }
+    {}
     { "#comment" = "See /usr/share/doc/mysql-server-*/README.Debian for more information." }
-    { "#comment" }
+    {}
     { "#comment" = "The following configuration is read by the NDB Data Nodes (ndbd processes)" }
     { "#comment" = "not from the NDB Management Nodes (ndb_mgmd processes)." }
-    { "#comment" }
+    {}
     { "#comment" = "[MYSQL_CLUSTER]" }
     { "#comment" = "ndb-connectstring=127.0.0.1" }
     {  }
     {  }
-    { "#comment" }
+    {}
     { "#comment" = "* IMPORTANT: Additional settings that can override those from this file!" }
-    { "#comment" }
+    {}
   }
   { "!includedir" = "/etc/mysql/conf.d/" }
   { "!include" = "/etc/mysql/other_conf.d/someconf.cnf" }
index 44df2af..5552341 100644 (file)
@@ -1,3 +1,8 @@
+(*
+Module: Test_NagiosCfg
+  Provides unit tests and examples for the <NagiosCfg> lens.
+*)
+
 module Test_NagiosCfg =
     let conf="
 # LOG FILE
@@ -70,3 +75,15 @@ broker_module=/usr/sbin/ndomod.o config_file=/etc/nagios3/ndomod.cfg
         { "broker_module"   = "/usr/sbin/ndomod.o"
            { "config_file" = "/etc/nagios3/ndomod.cfg" } }
 
+
+(* Spaces are fine in values *)
+let space_in = "nagios_check_command=/usr/lib/nagios/plugins/check_nagios /var/cache/nagios3/status.dat 5 '/usr/sbin/nagios3'\n"
+
+test NagiosCfg.lns get space_in =
+  { "nagios_check_command" = "/usr/lib/nagios/plugins/check_nagios /var/cache/nagios3/status.dat 5 '/usr/sbin/nagios3'" }
+
+test NagiosCfg.lns get "$USER1$=/usr/local/libexec/nagios\n" =
+  { "$USER1$" = "/usr/local/libexec/nagios" }
+
+test NagiosCfg.lns get "$USER3$=somepassword\n" =
+  { "$USER3$" = "somepassword" }
index 6f72b24..20b02d8 100644 (file)
@@ -19,6 +19,14 @@ define service {
     check_command           nopassivecheckreceived
     contact_groups          admins
 }
+
+; This is a semicolon comment
+
+define service{
+    service_description     gen2
+    use                     generic_template_passive
+    host_name               plonk
+    }
 "
 
     test NagiosObjects.lns get conf =
@@ -42,4 +50,12 @@ define service {
             { "check_command"           = "nopassivecheckreceived" }
             { "contact_groups"          = "admins" }
         }
+        {}
+        { "#comment" = "This is a semicolon comment" }
+        {}
+        { "service"
+            { "service_description"     = "gen2" }
+            { "use"                     = "generic_template_passive" }
+            { "host_name"               = "plonk" }
+        }
 
diff --git a/lenses/tests/test_netmasks.aug b/lenses/tests/test_netmasks.aug
new file mode 100644 (file)
index 0000000..57a9edc
--- /dev/null
@@ -0,0 +1,26 @@
+(* Test for netmasks lens *)
+module Test_netmasks =
+
+  let conf = "# The netmasks file associates Internet Protocol (IP) address
+# masks with IP network numbers.
+#
+
+192.168.1.0    255.255.255.0
+10.0.0.0 255.0.0.0
+"
+
+  test Netmasks.lns get conf =
+    { "#comment" = "The netmasks file associates Internet Protocol (IP) address" }
+    { "#comment" = "masks with IP network numbers." }
+    { }
+    { }
+    { "1"
+        { "network" = "192.168.1.0" }
+        { "netmask" = "255.255.255.0" } }
+    { "2"
+        { "network" = "10.0.0.0" }
+        { "netmask" = "255.0.0.0" } }
+
+(* Local Variables: *)
+(* mode: caml       *)
+(* End:             *)
diff --git a/lenses/tests/test_networkmanager.aug b/lenses/tests/test_networkmanager.aug
new file mode 100644 (file)
index 0000000..475ef3f
--- /dev/null
@@ -0,0 +1,68 @@
+(*
+Module: Test_NetworkManager
+  Provides unit tests and examples for the <NetworkManager> lens.
+*)
+
+module Test_NetworkManager =
+
+(* Variable: conf *)
+let conf = "[connection]
+id=wifoobar
+uuid=16fa8830-cf15-4523-8c1f-c6c635246855
+permissions=user:foo:;
+type=802-11-wireless
+
+[802-11-wireless]
+ssid=wifoobar
+mode=infrastructure
+mac-address=11:00:99:33:33:AA
+security=802-11-wireless-security
+
+[802-11-wireless-security]
+key-mgmt=none
+wep-key0=123abc123abc
+
+[ipv4]
+method=auto
+
+[ipv6]
+method=auto
+
+[vpn]
+NAT Traversal Mode=natt
+DPD idle timeout (our side)=0\n"
+
+(* Test: NetworkManager.lns *)
+test NetworkManager.lns get conf =
+  { "connection"
+    { "id" = "wifoobar" }
+    { "uuid" = "16fa8830-cf15-4523-8c1f-c6c635246855" }
+    { "permissions" = "user:foo:;" }
+    { "type" = "802-11-wireless" }
+    {  }
+  }
+  { "802-11-wireless"
+    { "ssid" = "wifoobar" }
+    { "mode" = "infrastructure" }
+    { "mac-address" = "11:00:99:33:33:AA" }
+    { "security" = "802-11-wireless-security" }
+    {  }
+  }
+  { "802-11-wireless-security"
+    { "key-mgmt" = "none" }
+    { "wep-key0" = "123abc123abc" }
+    {  }
+  }
+  { "ipv4"
+    { "method" = "auto" }
+    {  }
+  }
+  { "ipv6"
+    { "method" = "auto" }
+    {  }
+  }
+  { "vpn"
+    { "NAT Traversal Mode" = "natt" }
+    { "DPD idle timeout (our side)" = "0" }
+  }
+
index 4c1b37d..d5caf10 100644 (file)
@@ -4,6 +4,10 @@ let conf = "# Sample networks
 default         0.0.0.0         # default route    - mandatory
 loopnet         127.0.0.0    loopnet_alias  loopnet_alias2   # loopback network - mandatory
 mynet           128.253.154   # Modify for your own network address
+
+loopback        127
+arpanet         10      arpa    # Historical
+localnet        192.168.25.192
 "
 
 test Networks.lns get conf =
@@ -27,3 +31,20 @@ test Networks.lns get conf =
     { "number" = "128.253.154" }
     { "#comment" = "Modify for your own network address" }
   }
+  {}
+  { "4"
+    { "name" = "loopback" }
+    { "number" = "127" }
+  }
+  { "5"
+    { "name" = "arpanet" }
+    { "number" = "10" }
+    { "aliases"
+      { "1" = "arpa" }
+    }
+    { "#comment" = "Historical" }
+  }
+  { "6"
+    { "name" = "localnet" }
+    { "number" = "192.168.25.192" }
+  }
diff --git a/lenses/tests/test_nginx.aug b/lenses/tests/test_nginx.aug
new file mode 100644 (file)
index 0000000..f336c3f
--- /dev/null
@@ -0,0 +1,92 @@
+(*
+Module: Test_Nginx
+  Provides unit tests and examples for the <Nginx> lens.
+*)
+module Test_nginx = 
+
+    let conf ="user nginx nginx;
+worker_processes 1;
+error_log /var/log/nginx/error_log info;
+
+events {
+        worker_connections 1024;
+        use epoll;
+}
+
+# comment1
+# comment2
+
+http {
+       # comment3
+        include /etc/nginx/mime.types;
+        default_type application/octet-stream;
+        log_format main
+                '$remote_addr - $remote_user [$time_local] '
+                '\"$request\" $status $bytes_sent '
+                '\"$http_referer\" \"$http_user_agent\" '
+                '\"$gzip_ratio\"';
+        client_header_timeout 10m;
+        client_body_timeout 10m;
+        send_timeout 10m;
+        connection_pool_size 256;
+        client_header_buffer_size 2k;
+        large_client_header_buffers 4 8k;
+        request_pool_size 4k;
+        gzip on;
+       gzip_min_length 1000;
+        gzip_buffers 4 8k;
+        gzip_types text/plain application/json;
+        output_buffers 1 32k;
+        postpone_output 1460;
+        sendfile on;
+        tcp_nopush on;
+        tcp_nodelay on;
+        keepalive_timeout 75 20;
+        ignore_invalid_headers on;
+        index index.html index.php;
+        include vhosts/*.conf;
+}
+"
+
+    test Nginx.lns get conf =
+       { "user"  = "nginx nginx" }
+       { "worker_processes"      = "1" }
+       { "error_log" = "/var/log/nginx/error_log info" }
+       {}
+       { "events"
+          { "worker_connections"  = "1024" }
+          { "use"      = "epoll" } }
+       {}
+       { "#comment" = "comment1" }
+       { "#comment" = "comment2" }
+       {}
+       { "http"
+                 { "#comment" = "comment3" }
+          { "include"  = "/etc/nginx/mime.types" }
+          { "default_type"  = "application/octet-stream" }
+          { "log_format"      = "main
+                '$remote_addr - $remote_user [$time_local] '
+                '\"$request\" $status $bytes_sent '
+                '\"$http_referer\" \"$http_user_agent\" '
+                '\"$gzip_ratio\"'" }
+          { "client_header_timeout"  = "10m" }
+          { "client_body_timeout"  = "10m" }
+          { "send_timeout"      = "10m" } 
+          { "connection_pool_size"      = "256" } 
+          { "client_header_buffer_size"      = "2k" } 
+          { "large_client_header_buffers"      = "4 8k" } 
+          { "request_pool_size"      = "4k" } 
+          { "gzip"      = "on" } 
+          { "gzip_min_length"      = "1000" } 
+          { "gzip_buffers"      = "4 8k" } 
+          { "gzip_types"      = "text/plain application/json" } 
+          { "output_buffers"      = "1 32k" } 
+          { "postpone_output"      = "1460" } 
+          { "sendfile"      = "on" } 
+          { "tcp_nopush"      = "on" } 
+          { "tcp_nodelay"      = "on" } 
+          { "keepalive_timeout"      = "75 20" } 
+          { "ignore_invalid_headers"      = "on" } 
+          { "index"      = "index.html index.php" } 
+          { "include"      = "vhosts/*.conf" } }
+      
index 518d28c..c806eba 100644 (file)
@@ -151,3 +151,8 @@ test Ntp.tinker get "tinker panic 0 huffpuff 3.14\n" =
   { "tinker"
     { "panic" = "0" }
     { "huffpuff" = "3.14" } }
+
+(* Bug #297: tos directive *)
+test Ntp.tos get "tos maxdist 16\n" =
+  { "tos"
+    { "maxdist" = "16" } }
\ No newline at end of file
diff --git a/lenses/tests/test_ntpd.aug b/lenses/tests/test_ntpd.aug
new file mode 100644 (file)
index 0000000..1d0e41c
--- /dev/null
@@ -0,0 +1,80 @@
+(*
+Module: Test_Ntpd
+  Provides unit tests for the <Ntpd> lens.
+*)
+
+module Test_ntpd =
+
+test Ntpd.listen get "listen on *\n" =
+  { "listen on"
+    { "address" = "*" } }
+
+test Ntpd.listen get "listen on 127.0.0.1\n" =
+  { "listen on"
+    { "address" = "127.0.0.1" } }
+
+test Ntpd.listen get "listen on ::1\n" =
+  { "listen on"
+    { "address" = "::1" } }
+
+test Ntpd.listen get "listen on ::1 rtable 4\n" =
+  { "listen on"
+    { "address" = "::1" }
+    { "rtable" = "4" } }
+
+test Ntpd.server get "server ntp.example.org\n" =
+  { "server"
+    { "address" = "ntp.example.org" } }
+
+test Ntpd.server get "server ntp.example.org rtable 42\n" =
+  { "server"
+    { "address" = "ntp.example.org" }
+    { "rtable" = "42" } }
+
+test Ntpd.server get "server ntp.example.org weight 1 rtable 42\n" =
+  { "server"
+    { "address" = "ntp.example.org" }
+    { "weight" = "1" }
+    { "rtable" = "42" } }
+
+test Ntpd.server get "server ntp.example.org weight 10\n" =
+  { "server"
+    { "address" = "ntp.example.org" }
+    { "weight" = "10" } }
+
+
+test Ntpd.sensor get "sensor *\n" =
+  { "sensor"
+    { "device" = "*" } }
+
+test Ntpd.sensor get "sensor nmea0\n" =
+  { "sensor"
+    { "device" = "nmea0" } }
+
+test Ntpd.sensor get "sensor nmea0 correction 42\n" =
+  { "sensor"
+    { "device" = "nmea0" }
+    { "correction" = "42" } }
+
+test Ntpd.sensor get "sensor nmea0 correction -42\n" =
+  { "sensor"
+    { "device" = "nmea0" }
+    { "correction" = "-42" } }
+
+test Ntpd.sensor get "sensor nmea0 correction 42 weight 2\n" =
+  { "sensor"
+    { "device" = "nmea0" }
+    { "correction" = "42" }
+    { "weight" = "2" } }
+
+test Ntpd.sensor get "sensor nmea0 correction 42 refid Puffy\n" =
+  { "sensor"
+    { "device" = "nmea0" }
+    { "correction" = "42" }
+    { "refid" = "Puffy" } }
+
+test Ntpd.sensor get "sensor nmea0 correction 42 stratum 2\n" =
+  { "sensor"
+    { "device" = "nmea0" }
+    { "correction" = "42" }
+    { "stratum" = "2" } }
index 5f886f9..b20edce 100644 (file)
@@ -24,8 +24,8 @@ FileUsage  = 1
 test Odbc.lns get conf =
     {  }
     { "#comment" = "Example driver definitinions" }
-    { "#comment" }
-    { "#comment" }
+    {}
+    {}
     {  }
     { "#comment" = "Included in the unixODBC package" }
 
diff --git a/lenses/tests/test_openshift_config.aug b/lenses/tests/test_openshift_config.aug
new file mode 100644 (file)
index 0000000..451e32f
--- /dev/null
@@ -0,0 +1,101 @@
+(*
+Module: Test_OpenShift_Config
+  Provides unit tests and examples for the <OpenShift_Config> lens.
+*)
+
+module Test_OpenShift_Config =
+
+(* Variable: conf *)
+let conf = "CLOUD_DOMAIN=\"example.com\"
+VALID_GEAR_SIZES=\"small,medium\"
+DEFAULT_MAX_GEARS=\"100\"
+DEFAULT_GEAR_CAPABILITIES=\"small\"
+DEFAULT_GEAR_SIZE=\"small\"
+MONGO_HOST_PORT=\"localhost:27017\"
+MONGO_USER=\"openshift\"
+MONGO_PASSWORD=\"mooo\"
+MONGO_DB=\"openshift_broker_dev\"
+MONGO_SSL=\"false\"
+ENABLE_USAGE_TRACKING_DATASTORE=\"false\"
+ENABLE_USAGE_TRACKING_AUDIT_LOG=\"false\"
+USAGE_TRACKING_AUDIT_LOG_FILE=\"/var/log/openshift/broker/usage.log\"
+ENABLE_ANALYTICS=\"false\"
+ENABLE_USER_ACTION_LOG=\"true\"
+USER_ACTION_LOG_FILE=\"/var/log/openshift/broker/user_action.log\"
+AUTH_PRIVKEYFILE=\"/etc/openshift/server_priv.pem\"
+AUTH_PRIVKEYPASS=\"\"
+AUTH_PUBKEYFILE=\"/etc/openshift/server_pub.pem\"
+AUTH_RSYNC_KEY_FILE=\"/etc/openshift/rsync_id_rsa\"
+AUTH_SCOPE_TIMEOUTS=\"session=1.days|7.days, *=1.months|6.months\"
+ENABLE_MAINTENANCE_MODE=\"false\"
+MAINTENANCE_NOTIFICATION_FILE=\"/etc/openshift/outage_notification.txt\"
+DOWNLOAD_CARTRIDGES_ENABLED=\"false\" 
+"
+
+(* Variable: new_conf *) 
+let new_conf = "CLOUD_DOMAIN=\"rhcloud.com\"
+VALID_GEAR_SIZES=\"small,medium\"
+DEFAULT_MAX_GEARS=\"100\"
+DEFAULT_GEAR_CAPABILITIES=\"small\"
+DEFAULT_GEAR_SIZE=\"small\"
+MONGO_HOST_PORT=\"localhost:27017\"
+MONGO_USER=\"openshift\"
+MONGO_PASSWORD=\"mooo\"
+MONGO_DB=\"openshift_broker_dev\"
+MONGO_SSL=\"false\"
+ENABLE_USAGE_TRACKING_DATASTORE=\"false\"
+ENABLE_USAGE_TRACKING_AUDIT_LOG=\"false\"
+USAGE_TRACKING_AUDIT_LOG_FILE=\"/var/log/openshift/broker/usage.log\"
+ENABLE_ANALYTICS=\"false\"
+ENABLE_USER_ACTION_LOG=\"true\"
+USER_ACTION_LOG_FILE=\"/var/log/openshift/broker/user_action.log\"
+AUTH_PRIVKEYFILE=\"/etc/openshift/server_priv.pem\"
+AUTH_PRIVKEYPASS=\"\"
+AUTH_PUBKEYFILE=\"/etc/openshift/server_pub.pem\"
+AUTH_RSYNC_KEY_FILE=\"/etc/openshift/rsync_id_rsa\"
+AUTH_SCOPE_TIMEOUTS=\"session=1.days|7.days, *=1.months|6.months\"
+ENABLE_MAINTENANCE_MODE=\"false\"
+MAINTENANCE_NOTIFICATION_FILE=\"/etc/openshift/outage_notification.txt\"
+DOWNLOAD_CARTRIDGES_ENABLED=\"false\" 
+"
+
+(* Test: OpenShift_Config.lns *)
+test OpenShift_Config.lns get conf =
+  { "CLOUD_DOMAIN" = "example.com" }
+  { "VALID_GEAR_SIZES" = "small,medium" }
+  { "DEFAULT_MAX_GEARS" = "100" }
+  { "DEFAULT_GEAR_CAPABILITIES" = "small" }
+  { "DEFAULT_GEAR_SIZE" = "small" }
+  { "MONGO_HOST_PORT" = "localhost:27017" }
+  { "MONGO_USER" = "openshift" }
+  { "MONGO_PASSWORD" = "mooo" }
+  { "MONGO_DB" = "openshift_broker_dev" }
+  { "MONGO_SSL" = "false" }
+  { "ENABLE_USAGE_TRACKING_DATASTORE" = "false" }
+  { "ENABLE_USAGE_TRACKING_AUDIT_LOG" = "false" }
+  { "USAGE_TRACKING_AUDIT_LOG_FILE" = "/var/log/openshift/broker/usage.log" }
+  { "ENABLE_ANALYTICS" = "false" }
+  { "ENABLE_USER_ACTION_LOG" = "true" }
+  { "USER_ACTION_LOG_FILE" = "/var/log/openshift/broker/user_action.log" }
+  { "AUTH_PRIVKEYFILE" = "/etc/openshift/server_priv.pem" }
+  { "AUTH_PRIVKEYPASS" }
+  { "AUTH_PUBKEYFILE" = "/etc/openshift/server_pub.pem" }
+  { "AUTH_RSYNC_KEY_FILE" = "/etc/openshift/rsync_id_rsa" }
+  { "AUTH_SCOPE_TIMEOUTS" = "session=1.days|7.days, *=1.months|6.months" }
+  { "ENABLE_MAINTENANCE_MODE" = "false" }
+  { "MAINTENANCE_NOTIFICATION_FILE" = "/etc/openshift/outage_notification.txt" }
+  { "DOWNLOAD_CARTRIDGES_ENABLED" = "false" }
+
+(* Test: OpenShift_Config.lns
+ * Second get test against OpenShift configs
+*) 
+test OpenShift_Config.lns get "MONGO_SSL=\"false\"\n" =
+  { "MONGO_SSL" = "false" }
+
+(* Test: OpenShift_Config.lns
+ * Put test changing CLOUD_DOMAIN to rhcloud.com
+*) 
+test OpenShift_Config.lns put conf after set "CLOUD_DOMAIN" "rhcloud.com"
+  = new_conf
+
+(* vim: set ts=4  expandtab  sw=4: *)
diff --git a/lenses/tests/test_openshift_http.aug b/lenses/tests/test_openshift_http.aug
new file mode 100644 (file)
index 0000000..bc0fc53
--- /dev/null
@@ -0,0 +1,71 @@
+(*
+Module: Test_OpenShift_Http
+  Provides unit tests and examples for the <OpenShift_Http> lens.
+*)
+
+module Test_OpenShift_Http =
+
+(* Variable: conf *)
+let conf = "Listen 127.0.0.1:8080
+User apache
+Group apache
+include /etc/httpd/conf.d/ruby193-passenger.conf
+PassengerUser apache
+PassengerMaxPoolSize 80
+PassengerMinInstances 2
+PassengerPreStart http://127.0.0.1:8080/
+PassengerUseGlobalQueue off
+RackBaseURI /broker
+PassengerRuby /var/www/openshift/broker/script/broker_ruby
+<Directory /var/www/openshift/broker/httpd/root/broker>
+    Options -MultiViews
+</Directory>
+"
+
+(* Variable: new_conf *) 
+let new_conf = "Listen 127.0.0.1:8080
+User nobody
+Group apache
+include /etc/httpd/conf.d/ruby193-passenger.conf
+PassengerUser apache
+PassengerMaxPoolSize 80
+PassengerMinInstances 2
+PassengerPreStart http://127.0.0.1:8080/
+PassengerUseGlobalQueue off
+RackBaseURI /broker
+PassengerRuby /var/www/openshift/broker/script/broker_ruby
+<Directory /var/www/openshift/broker/httpd/root/broker>
+    Options -MultiViews
+</Directory>
+"
+
+let lns = OpenShift_Http.lns 
+
+(* Test: OpenShift_Http.lns  
+ * Get test against tree structure
+*)
+test lns get conf = 
+  { "directive" = "Listen"      {"arg" = "127.0.0.1:8080" }  }
+  { "directive" = "User"        { "arg" = "apache" } }
+  { "directive" = "Group"       { "arg" = "apache" } }
+  { "directive" = "include"     { "arg" = "/etc/httpd/conf.d/ruby193-passenger.conf" } }
+  { "directive" = "PassengerUser" { "arg" = "apache" } }
+  { "directive" = "PassengerMaxPoolSize" { "arg" = "80" } }
+  { "directive" = "PassengerMinInstances" { "arg" = "2" } }
+  { "directive" = "PassengerPreStart" { "arg" = "http://127.0.0.1:8080/" } }
+  { "directive" = "PassengerUseGlobalQueue" { "arg" = "off" } }
+  { "directive" = "RackBaseURI" { "arg" = "/broker" } }
+  { "directive" = "PassengerRuby" { "arg" = "/var/www/openshift/broker/script/broker_ruby" } }
+  { "Directory" 
+    { "arg" = "/var/www/openshift/broker/httpd/root/broker" } 
+    { "directive" = "Options" 
+        { "arg" = "-MultiViews" }
+    }
+  }
+
+(* Test: OpenShift_Http.lns  
+ * Put test changing user to nobody
+*)
+test lns put conf after set "/directive[2]/arg" "nobody" = new_conf
+
+(* vim: set ts=4  expandtab  sw=4: *)
diff --git a/lenses/tests/test_openshift_quickstarts.aug b/lenses/tests/test_openshift_quickstarts.aug
new file mode 100644 (file)
index 0000000..7969dfc
--- /dev/null
@@ -0,0 +1,317 @@
+(*
+Module: Test_OpenShift_Quickstarts
+  Provides unit tests and examples for the <OpenShift_Quickstarts> lens.
+*)
+
+module Test_OpenShift_Quickstarts =
+
+(* Variable: conf *)
+let conf = "[
+  {\"quickstart\": {
+    \"id\": \"1\",
+    \"name\":\"CakePHP\",
+    \"website\":\"http://cakephp.org/\",
+    \"initial_git_url\":\"git://github.com/openshift/cakephp-example.git\",
+    \"cartridges\":[\"php-5.4\",\"mysql-5.1\"],
+    \"summary\":\"CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.\",
+    \"tags\":[\"php\",\"cakephp\",\"framework\"],
+    \"admin_tags\":[]
+  }},
+  {\"quickstart\": {
+    \"id\": \"2\",
+    \"name\":\"Django\",
+    \"website\":\"https://www.djangoproject.com/\",
+    \"initial_git_url\":\"git://github.com/openshift/django-example.git\",
+    \"cartridges\":[\"python-2.7\"],
+    \"summary\":\"A high-level Python web framework that encourages rapid development and clean, pragmatic design. Administrator user name and password are written to $OPENSHIFT_DATA_DIR/CREDENTIALS.\",
+    \"tags\":[\"python\",\"django\",\"framework\"],
+    \"admin_tags\":[]
+  }},
+  {\"quickstart\":{
+    \"id\": \"4\",
+    \"name\":\"Drupal\",
+    \"website\":\"http://drupal.org/\",
+    \"initial_git_url\":\"git://github.com/openshift/drupal-example.git\",
+    \"cartridges\":[\"php-5.4\",\"mysql-5.1\"],
+    \"summary\":\"An open source content management platform written in PHP powering millions of websites and applications. It is built, used, and supported by an active and diverse community of people around the world. Administrator user name and password are written to $OPENSHIFT_DATA_DIR/CREDENTIALS.\",
+    \"tags\":[\"php\",\"drupal\",\"wiki\",\"framework\",\"instant_app\"],
+    \"admin_tags\":[]
+  }},
+ {\"quickstart\":{
+    \"id\": \"6\",
+    \"name\":\"Ruby on Rails\",
+    \"website\":\"http://rubyonrails.org/\",
+    \"initial_git_url\":\"git://github.com/openshift/rails-example.git\",
+    \"cartridges\":[\"ruby-1.9\",\"mysql-5.1\"],
+    \"summary\":\"An open source web framework for Ruby that is optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration.\",
+    \"tags\":[\"ruby\",\"rails\",\"framework\"],
+    \"admin_tags\":[]
+  }},
+ {\"quickstart\":{
+    \"id\": \"8\",
+    \"name\":\"WordPress\",
+    \"website\":\"http://wordpress.org\",
+    \"initial_git_url\":\"git://github.com/openshift/wordpress-example.git\",
+    \"cartridges\":[\"php-5.4\",\"mysql-5.1\"],
+    \"summary\":\"A semantic personal publishing platform written in PHP with a MySQL back end, focusing on aesthetics, web standards, and usability. Administrator user name and password are written to $OPENSHIFT_DATA_DIR/CREDENTIALS.\",
+    \"tags\":[\"php\",\"wordpress\",\"blog\",\"framework\",\"instant_app\"],
+    \"admin_tags\":[]
+  }}
+]"
+
+(* Variable: new_conf *) 
+let new_conf = "[
+  {\"quickstart\": {
+    \"id\": \"1\",
+    \"name\":\"CakePHP\",
+    \"website\":\"http://cakephp.org/\",
+    \"initial_git_url\":\"git://github.com/openshift/cakephp-example.git\",
+    \"cartridges\":[\"php-5.4\",\"mysql-5.1\"],
+    \"summary\":\"CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.\",
+    \"tags\":[\"php\",\"cakephp\",\"framework\"],
+    \"admin_tags\":[]
+  }},
+  {\"quickstart\": {
+    \"id\": \"2\",
+    \"name\":\"Django\",
+    \"website\":\"https://www.djangoproject.com/\",
+    \"initial_git_url\":\"git://github.com/openshift/django-example.git\",
+    \"cartridges\":[\"python-2.7\"],
+    \"summary\":\"A high-level Python web framework that encourages rapid development and clean, pragmatic design. Administrator user name and password are written to $OPENSHIFT_DATA_DIR/CREDENTIALS.\",
+    \"tags\":[\"python\",\"django\",\"framework\"],
+    \"admin_tags\":[]
+  }},
+  {\"quickstart\":{
+    \"id\": \"4\",
+    \"name\":\"Drupal\",
+    \"website\":\"http://drupal.org/\",
+    \"initial_git_url\":\"git://github.com/openshift/drupal-example.git\",
+    \"cartridges\":[\"php-5.4\",\"mysql-5.1\"],
+    \"summary\":\"An open source content management platform written in PHP powering millions of websites and applications. It is built, used, and supported by an active and diverse community of people around the world. Administrator user name and password are written to $OPENSHIFT_DATA_DIR/CREDENTIALS.\",
+    \"tags\":[\"php\",\"drupal\",\"wiki\",\"framework\",\"instant_app\"],
+    \"admin_tags\":[]
+  }},
+ {\"quickstart\":{
+    \"id\": \"6\",
+    \"name\":\"Ruby on Rails\",
+    \"website\":\"http://rubyonrails.org/\",
+    \"initial_git_url\":\"git://github.com/openshift/rails-example.git\",
+    \"cartridges\":[\"ruby-1.9\",\"mysql-5.1\"],
+    \"summary\":\"An open source web framework for Ruby that is optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration.\",
+    \"tags\":[\"ruby\",\"rails\",\"framework\"],
+    \"admin_tags\":[]
+  }},
+ {\"quickstart\":{
+    \"id\": \"8\",
+    \"name\":\"WordPress\",
+    \"website\":\"https://wordpress.org\",
+    \"initial_git_url\":\"git://github.com/openshift/wordpress-example.git\",
+    \"cartridges\":[\"php-5.4\",\"mysql-5.1\"],
+    \"summary\":\"A semantic personal publishing platform written in PHP with a MySQL back end, focusing on aesthetics, web standards, and usability. Administrator user name and password are written to $OPENSHIFT_DATA_DIR/CREDENTIALS.\",
+    \"tags\":[\"php\",\"wordpress\",\"blog\",\"framework\",\"instant_app\"],
+    \"admin_tags\":[]
+  }}
+]"
+
+(* Test: OpenShift_Quickstarts.lns *)
+test OpenShift_Quickstarts.lns get conf =
+  { "array"
+    { "dict"
+      { "entry" = "quickstart"
+        { "dict"
+          { "entry" = "id"
+            { "string" = "1" }
+          }
+          { "entry" = "name"
+            { "string" = "CakePHP" }
+          }
+          { "entry" = "website"
+            { "string" = "http://cakephp.org/" }
+          }
+          { "entry" = "initial_git_url"
+            { "string" = "git://github.com/openshift/cakephp-example.git" }
+          }
+          { "entry" = "cartridges"
+            { "array"
+              { "string" = "php-5.4" }
+              { "string" = "mysql-5.1" }
+            }
+          }
+          { "entry" = "summary"
+            { "string" = "CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC." }
+          }
+          { "entry" = "tags"
+            { "array"
+              { "string" = "php" }
+              { "string" = "cakephp" }
+              { "string" = "framework" }
+            }
+          }
+          { "entry" = "admin_tags"
+            { "array" }
+          }
+        }
+      }
+    }
+    { "dict"
+      { "entry" = "quickstart"
+        { "dict"
+          { "entry" = "id"
+            { "string" = "2" }
+          }
+          { "entry" = "name"
+            { "string" = "Django" }
+          }
+          { "entry" = "website"
+            { "string" = "https://www.djangoproject.com/" }
+          }
+          { "entry" = "initial_git_url"
+            { "string" = "git://github.com/openshift/django-example.git" }
+          }
+          { "entry" = "cartridges"
+            { "array"
+              { "string" = "python-2.7" }
+            }
+          }
+          { "entry" = "summary"
+            { "string" = "A high-level Python web framework that encourages rapid development and clean, pragmatic design. Administrator user name and password are written to $OPENSHIFT_DATA_DIR/CREDENTIALS." }
+          }
+          { "entry" = "tags"
+            { "array"
+              { "string" = "python" }
+              { "string" = "django" }
+              { "string" = "framework" }
+            }
+          }
+          { "entry" = "admin_tags"
+            { "array" }
+          }
+        }
+      }
+    }
+    { "dict"
+      { "entry" = "quickstart"
+        { "dict"
+          { "entry" = "id"
+            { "string" = "4" }
+          }
+          { "entry" = "name"
+            { "string" = "Drupal" }
+          }
+          { "entry" = "website"
+            { "string" = "http://drupal.org/" }
+          }
+          { "entry" = "initial_git_url"
+            { "string" = "git://github.com/openshift/drupal-example.git" }
+          }
+          { "entry" = "cartridges"
+            { "array"
+              { "string" = "php-5.4" }
+              { "string" = "mysql-5.1" }
+            }
+          }
+          { "entry" = "summary"
+            { "string" = "An open source content management platform written in PHP powering millions of websites and applications. It is built, used, and supported by an active and diverse community of people around the world. Administrator user name and password are written to $OPENSHIFT_DATA_DIR/CREDENTIALS." }
+          }
+          { "entry" = "tags"
+            { "array"
+              { "string" = "php" }
+              { "string" = "drupal" }
+              { "string" = "wiki" }
+              { "string" = "framework" }
+              { "string" = "instant_app" }
+            }
+          }
+          { "entry" = "admin_tags"
+            { "array" }
+          }
+        }
+      }
+    }
+    { "dict"
+      { "entry" = "quickstart"
+        { "dict"
+          { "entry" = "id"
+            { "string" = "6" }
+          }
+          { "entry" = "name"
+            { "string" = "Ruby on Rails" }
+          }
+          { "entry" = "website"
+            { "string" = "http://rubyonrails.org/" }
+          }
+          { "entry" = "initial_git_url"
+            { "string" = "git://github.com/openshift/rails-example.git" }
+          }
+          { "entry" = "cartridges"
+            { "array"
+              { "string" = "ruby-1.9" }
+              { "string" = "mysql-5.1" }
+            }
+          }
+          { "entry" = "summary"
+            { "string" = "An open source web framework for Ruby that is optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration." }
+          }
+          { "entry" = "tags"
+            { "array"
+              { "string" = "ruby" }
+              { "string" = "rails" }
+              { "string" = "framework" }
+            }
+          }
+          { "entry" = "admin_tags"
+            { "array" }
+          }
+        }
+      }
+    }
+    { "dict"
+      { "entry" = "quickstart"
+        { "dict"
+          { "entry" = "id"
+            { "string" = "8" }
+          }
+          { "entry" = "name"
+            { "string" = "WordPress" }
+          }
+          { "entry" = "website"
+            { "string" = "http://wordpress.org" }
+          }
+          { "entry" = "initial_git_url"
+            { "string" = "git://github.com/openshift/wordpress-example.git" }
+          }
+          { "entry" = "cartridges"
+            { "array"
+              { "string" = "php-5.4" }
+              { "string" = "mysql-5.1" }
+            }
+          }
+          { "entry" = "summary"
+            { "string" = "A semantic personal publishing platform written in PHP with a MySQL back end, focusing on aesthetics, web standards, and usability. Administrator user name and password are written to $OPENSHIFT_DATA_DIR/CREDENTIALS." }
+          }
+          { "entry" = "tags"
+            { "array"
+              { "string" = "php" }
+              { "string" = "wordpress" }
+              { "string" = "blog" }
+              { "string" = "framework" }
+              { "string" = "instant_app" }
+            }
+          }
+          { "entry" = "admin_tags"
+            { "array" }
+          }
+        }
+      }
+    }
+}
+
+
+(* FIXME: not yet supported:
+ * The manner in which the JSON utility lens currently works does not maintain
+ * whitepsace as per the Augeas specification in the put direction.
+
+test OpenShift_Quickstarts.lns put conf after set "/array/dict[5]/entry/dict/entry[3]/string" "https://wordpress.org"
+  = new_conf *)
+
+(* vim: set ts=4  expandtab  sw=4: *)
index b2f9499..71170a9 100644 (file)
@@ -2,6 +2,7 @@
 module Test_OpenVPN =
 
 let server_conf = "
+daemon
 local 10.0.5.20
 port 1194
 # TCP or UDP server?
@@ -20,7 +21,9 @@ dh dh1024.pem
 server 10.8.0.0 255.255.255.0
 ifconfig-pool-persist ipp.txt
 
+client-config-dir /etc/openvpn/ccd
 server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100
+route 10.9.0.0 255.255.255.0
 push \"route 192.168.10.0 255.255.255.0\"
 learn-address ./script
 push \"redirect-gateway\"
@@ -44,10 +47,14 @@ log         openvpn.log
 log-append  openvpn.log
 verb 3
 mute 20
+management 10.0.5.20 1193 /etc/openvpn/mpass
+script-security 3 system
+mssfix 1300
 "
 
 test OpenVPN.lns get server_conf =
   {}
+  { "daemon" }
   { "local"    = "10.0.5.20" }
   { "port"     = "1194" }
   { "#comment" = "TCP or UDP server?" }
@@ -69,11 +76,15 @@ test OpenVPN.lns get server_conf =
       { "netmask" = "255.255.255.0" } }
   { "ifconfig-pool-persist" = "ipp.txt" }
   {}
+  { "client-config-dir" = "/etc/openvpn/ccd" }
   { "server-bridge"
       { "address" = "10.8.0.4" }
       { "netmask" = "255.255.255.0" }
       { "start"   = "10.8.0.50" }
       { "end"     = "10.8.0.100" } }
+  { "route"
+      { "address" = "10.9.0.0" }
+      { "netmask" = "255.255.255.0" } }
   { "push" = "route 192.168.10.0 255.255.255.0" }
   { "learn-address" = "./script" }
   { "push" = "redirect-gateway" }
@@ -103,6 +114,12 @@ test OpenVPN.lns get server_conf =
   { "log-append"  = "openvpn.log" }
   { "verb"        = "3" }
   { "mute"        = "20" }
+  { "management"
+      { "server"  = "10.0.5.20" }
+      { "port"   = "1193" }
+      { "pwfile"  = "/etc/openvpn/mpass" } }
+  { "script-security" = "3 system" }
+  { "mssfix" = "1300" }
 
 
 
@@ -119,6 +136,7 @@ http-proxy mytest2
 http-proxy
 mute-replay-warnings
 ns-cert-type server
+mssfix 1350
 "
 
 test OpenVPN.lns get client_conf =
@@ -141,5 +159,6 @@ test OpenVPN.lns get client_conf =
   { "http-proxy" }
   { "mute-replay-warnings" }
   { "ns-cert-type" = "server" }
+  { "mssfix" = "1350" }
 
 
diff --git a/lenses/tests/test_pagekite.aug b/lenses/tests/test_pagekite.aug
new file mode 100644 (file)
index 0000000..1520fbd
--- /dev/null
@@ -0,0 +1,105 @@
+module Test_Pagekite =
+
+let conf1 = "# Use the pagekite.net service defaults.
+defaults
+"
+test Pagekite.lns get conf1 =
+  { "#comment" = "Use the pagekite.net service defaults." }
+  { "defaults" }
+
+
+let conf2 ="
+frontends = pagekite.freedombox.me
+ports=80,81
+"
+test Pagekite.lns get conf2 =
+  { }
+  { "frontends" = "pagekite.freedombox.me" }
+  { "ports"
+    { "1" = "80" }
+    { "2" = "81" } }
+
+
+let conf3 = "frontend=pagekite.freedombox.me
+host=192.168.0.3
+"
+test Pagekite.lns get conf3 =
+  { "frontend" = "pagekite.freedombox.me" }
+  { "host" = "192.168.0.3" }
+
+
+let conf4 = "isfrontend
+ports=80,443
+protos=http,https
+domain=http,https:*.your.domain:MakeUpAPasswordHere
+"
+test Pagekite.lns get conf4 =
+  { "isfrontend" }
+  { "ports"
+    { "1" = "80" }
+    { "2" = "443" } }
+  { "protos"
+    { "1" = "http" }
+    { "2" = "https" } }
+  { "domain" = "http,https:*.your.domain:MakeUpAPasswordHere" }
+
+let conf_account = "kitename = my.freedombox.me
+kitesecret = 0420
+# Delete this line!
+abort_not_configured
+"
+test Pagekite.lns get conf_account =
+  { "kitename" = "my.freedombox.me" }
+  { "kitesecret" = "0420" }
+  { "#comment" = "Delete this line!" }
+  { "abort_not_configured" }
+                                                                                                                                                                                        
+
+let conf_service = "
+service_on = raw/22:@kitename : localhost:22 : @kitesecret
+service_on=http:192.168.0.1:127.0.0.1:80:
+service_on=https:yourhostname,fqdn:127.0.0.1:443:
+"
+test Pagekite.lns get conf_service =
+  {  }
+  { "service_on"
+    { "1"
+      { "source" = "raw/22:@kitename" }
+      { "destination" = "localhost:22" }
+      { "secret" = "@kitesecret" }
+    }
+  }
+  { "service_on"
+    { "2"
+      { "source" = "http:192.168.0.1" }
+      { "destination" = "127.0.0.1:80" }
+    }
+  }
+  { "service_on"
+    { "3"
+      { "source" = "https:yourhostname,fqdn" }
+      { "destination" = "127.0.0.1:443" }
+    }
+  }
+
+
+let conf_encryption = "
+frontend=frontend.your.domain:443
+fe_certname=frontend.your/domain
+ca_certs=/etc/pagekite.d/site-cert.pem
+tls_endpoint=frontend.your.domain:/path/to/frontend.pem
+"
+test Pagekite.lns get conf_encryption =
+  {  }
+  { "frontend" = "frontend.your.domain:443" }
+  { "fe_certname" = "frontend.your/domain" }
+  { "ca_certs" = "/etc/pagekite.d/site-cert.pem" }
+  { "tls_endpoint" = "frontend.your.domain:/path/to/frontend.pem" }
+
+
+let conf_service_cfg = "insecure
+service_cfg = KITENAME.pagekite.me/80 : insecure : True
+"
+test Pagekite.lns get conf_service_cfg =
+  { "insecure" }
+  { "service_cfg" = "KITENAME.pagekite.me/80 : insecure : True" }
index e0abfcc..9dade7a 100644 (file)
@@ -1,13 +1,13 @@
 module Test_pam =
 
   let example = "#%PAM-1.0
-auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
+AUTH [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
 session    optional     pam_keyinit.so force revoke
 "
 
   test Pam.lns get example =
     { "#comment" = "%PAM-1.0" }
-    { "1" { "type" = "auth" }
+    { "1" { "type" = "AUTH" }
           { "control" = "[user_unknown=ignore success=ok ignore=ignore default=bad]" }
           { "module" = "pam_securetty.so" } }
     { "2" { "type" = "session" }
@@ -19,7 +19,7 @@ session    optional     pam_keyinit.so force revoke
   test Pam.lns put example after
     set "/1/control" "requisite"
   = "#%PAM-1.0
-auth requisite pam_securetty.so
+AUTH requisite pam_securetty.so
 session    optional     pam_keyinit.so force revoke
 "
 
@@ -41,6 +41,14 @@ session    optional     pam_keyinit.so force revoke
       { "module" = "pam_gnome_keyring.so" }
     }
 
+  test Pam.lns get "session    optional    pam_motd.so [motd=/etc/bad example]\n" =
+    { "1"
+      { "type" = "session" }
+      { "control" = "optional" }
+      { "module" = "pam_motd.so" }
+      { "argument" = "[motd=/etc/bad example]" }
+    }
+
 (* Local Variables: *)
 (* mode: caml       *)
 (* End:             *)
diff --git a/lenses/tests/test_pamconf.aug b/lenses/tests/test_pamconf.aug
new file mode 100644 (file)
index 0000000..6a23194
--- /dev/null
@@ -0,0 +1,35 @@
+module Test_pamconf =
+
+  let example = "# Authentication management
+#
+# login service (explicit because of pam_dial_auth)
+#
+login   auth requisite      pam_authtok_get.so.1
+login   auth required       pam_dhkeys.so.1 arg
+
+other   session required    pam_unix_session.so.1
+"
+
+  test PamConf.lns get example =
+    { "#comment" = "Authentication management" }
+    { }
+    { "#comment" = "login service (explicit because of pam_dial_auth)" }
+    { }
+    { "1" { "service" = "login" }
+          { "type" = "auth" }
+          { "control" = "requisite" }
+          { "module" = "pam_authtok_get.so.1" } }
+    { "2" { "service" = "login" }
+          { "type" = "auth" }
+          { "control" = "required" }
+          { "module" = "pam_dhkeys.so.1" }
+          { "argument" = "arg" } }
+    { }
+    { "3" { "service" = "other" }
+          { "type" = "session" }
+          { "control" = "required" }
+          { "module" = "pam_unix_session.so.1" } }
+
+(* Local Variables: *)
+(* mode: caml       *)
+(* End:             *)
index fe28b89..51081f8 100644 (file)
@@ -3,6 +3,7 @@ module Test_Passwd =
 let conf = "root:x:0:0:root:/root:/bin/bash
 libuuid:x:100:101::/var/lib/libuuid:/bin/sh
 free:x:1000:1000:Free Ekanayaka,,,:/home/free:/bin/bash
+root:*:0:0:Charlie &:/root:/bin/csh
 "
 
 test Passwd.lns get conf =
@@ -27,6 +28,13 @@ test Passwd.lns get conf =
      { "name" = "Free Ekanayaka,,," }
      { "home" = "/home/free" }
      { "shell" = "/bin/bash" } }
+   { "root"
+     { "password" = "*" }
+     { "uid" = "0" }
+     { "gid" = "0" }
+     { "name" = "Charlie &" }
+     { "home" = "/root" }
+     { "shell" = "/bin/csh" } }
 
 (* Popular on Solaris *)
 test Passwd.lns get "+@some-nis-group::::::\n" =
@@ -43,3 +51,9 @@ test Passwd.lns get "+::::::/sbin/nologin\n" =
     { "name" }
     { "home" }
     { "shell" = "/sbin/nologin" } }
+
+(* NIS entries with overrides, ticket #339 *)
+test Passwd.lns get "+@bob:::::/home/bob:/bin/bash\n" =
+ { "@nis" = "bob"
+   { "home" = "/home/bob" }
+   { "shell" = "/bin/bash" } }
index 4e1aa5e..b9f6786 100644 (file)
@@ -6,6 +6,10 @@ module Test_pg_hba =
 local   all         all                               ident sameuser
 # IPv4 local connections:
 host    all         all         127.0.0.1/32          md5
+# Remote connections by hostname:
+host    all         all         foo.example.com       md5
+# Remote connections by suffix of hostname/fqdn:
+host    all         all         .example.com          md5
 # IPv6 local connections:
 host    all         all         ::1/128               md5
 "
@@ -28,11 +32,27 @@ host    all         all         ::1/128               md5
             { "address" = "127.0.0.1/32" }
             { "method" = "md5" }
         }
-        { "#comment" = "IPv6 local connections:" }
+        { "#comment" = "Remote connections by hostname:" }
         { "3"
             { "type" = "host" }
             { "database" = "all" }
             { "user"  = "all" }
+            { "address" = "foo.example.com" }
+            { "method" = "md5" }
+        }
+        { "#comment" = "Remote connections by suffix of hostname/fqdn:" }
+        { "4"
+            { "type" = "host" }
+            { "database" = "all" }
+            { "user"  = "all" }
+            { "address" = ".example.com" }
+            { "method" = "md5" }
+        }
+        { "#comment" = "IPv6 local connections:" }
+        { "5"
+            { "type" = "host" }
+            { "database" = "all" }
+            { "user"  = "all" }
             { "address" = "::1/128" }
             { "method" = "md5" }
         }
@@ -91,6 +111,26 @@ host    all         all         ::1/128               md5
             { "address" = "192.168.1.1 255.255.0.0" }
             { "method" = "trust" }
         }
+    
+    (* Test with fqdn as address *)
+    test Pg_Hba.lns get "host all all foo.example.com md5\n" = 
+        { "1"
+            { "type" = "host" }
+            { "database" = "all" }
+            { "user" = "all" }
+            { "address" = "foo.example.com" }
+            { "method" = "md5" }
+        }
+
+    (* Test with fqdn suffix as address *)
+    test Pg_Hba.lns get "host all all .example.com md5\n" = 
+        { "1"
+            { "type" = "host" }
+            { "database" = "all" }
+            { "user" = "all" }
+            { "address" = ".example.com" }
+            { "method" = "md5" }
+        }
 
     (* Local types may not have and address *)
     test Pg_Hba.lns get "local all all 127.0.0.1/32 trust\n" = *
@@ -102,6 +142,36 @@ host    all         all         ::1/128               md5
        column separator ("method" is missing here) *)
     test Pg_Hba.lns get "host all all 192.168.1.1 255.255.0.0\n" = *
 
+    (* Ticket #313: support authentication method options *)
+    test Pg_Hba.lns get "host all all .dev.example.com gss include_realm=0 krb_realm=EXAMPLE.COM map=somemap
+host all all .dev.example.com ldap ldapserver=auth.example.com ldaptls=1 ldapprefix=\"uid=\" ldapsuffix=\",ou=people,dc=example,dc=com\"\n" =
+        { "1"
+            { "type" = "host" }
+            { "database" = "all" }
+            { "user" = "all" }
+            { "address" = ".dev.example.com" }
+            { "method" = "gss"
+              { "option" = "include_realm"
+                { "value" = "0" } }
+              { "option" = "krb_realm"
+                { "value" = "EXAMPLE.COM" } }
+              { "option" = "map"
+                { "value" = "somemap" } } } }
+        { "2"
+            { "type" = "host" }
+            { "database" = "all" }
+            { "user" = "all" }
+            { "address" = ".dev.example.com" }
+            { "method" = "ldap"
+              { "option" = "ldapserver"
+                { "value" = "auth.example.com" } }
+              { "option" = "ldaptls"
+                { "value" = "1" } }
+              { "option" = "ldapprefix"
+                { "value" = "uid=" } }
+              { "option" = "ldapsuffix"
+                { "value" = ",ou=people,dc=example,dc=com" } } } }
+
     (* Unsupported yet *)
     (* test Pg_Hba.lns get "host \"db with spaces\" \"user with spaces\" 127.0.0.1/32 trust\n" =? *)
     (* test Pg_Hba.lns get "host \"db,with,commas\" \"user,with,commas\" 127.0.0.1/32 trust\n" =? *)
index 06ad9c7..618f3ff 100644 (file)
@@ -1,6 +1,6 @@
 module Test_php =
 
-   let conf = "
+let conf = "
 safe_mode = Off
 [PHP]
 ; Enable the PHP scripting language engine under Apache.
@@ -16,35 +16,46 @@ sqlite.assoc_case = 0
 "
 
 
-   test PHP.lns get conf =
-      { ".anon"
-         {}
-         { "safe_mode" = "Off" } }
-      { "PHP"
-         { "#comment" = "Enable the PHP scripting language engine under Apache." }
-        { "engine"  = "On" }
-        {}
-        { "#comment" = "Enable compatibility mode with Zend Engine 1 (PHP 4.x)" }
-        { "zend.ze1_compatibility_mode" = "Off" }
-        { "unserialize_callback_func" }
-        { "date.default_latitude" = "31.7667" }
-        {} }
-      { "sqlite"
-         { "sqlite.assoc_case" = "0" } }
+test PHP.lns get conf =
+  { ".anon"
+     {}
+     { "safe_mode" = "Off" } }
+  { "PHP"
+     { "#comment" = "Enable the PHP scripting language engine under Apache." }
+     { "engine"  = "On" }
+     {}
+     { "#comment" = "Enable compatibility mode with Zend Engine 1 (PHP 4.x)" }
+     { "zend.ze1_compatibility_mode" = "Off" }
+     { "unserialize_callback_func" }
+     { "date.default_latitude" = "31.7667" }
+     {} }
+  { "sqlite"
+     { "sqlite.assoc_case" = "0" } }
 
-    test PHP.lns put conf after rm "noop" = conf
+test PHP.lns put conf after rm "noop" = conf
 
 
-    test PHP.lns get ";\n" = { ".anon" { "#comment" } }
+test PHP.lns get ";\n" = { ".anon" {} }
 
-    (* Section titles can have spaces *)
-    test PHP.lns get "[mail function]\n" =  { "mail function" }
+(* Section titles can have spaces *)
+test PHP.lns get "[mail function]\n" =  { "mail function" }
 
-    (* Keys can be lower and upper case *)
-    test PHP.lns get "[fake]
+(* Keys can be lower and upper case *)
+test PHP.lns get "[fake]
 SMTP = localhost
 mixed_KEY = 25
-" =
-     { "fake"
-         { "SMTP" = "localhost" }
-         { "mixed_KEY" = "25" } }
+" = 
+ { "fake"
+     { "SMTP" = "localhost" }
+     { "mixed_KEY" = "25" } }
+
+(* Ticket #243 *)
+test PHP.lns get "session.save_path = \"3;/var/lib/php5\"\n" =
+   { ".anon"
+      { "session.save_path" = "3;/var/lib/php5" } }
+
+(* GH issue #35
+   php-fpm syntax *)
+test PHP.lns get "php_admin_flag[log_errors] = on\n" =
+   { ".anon"
+     { "php_admin_flag[log_errors]" = "on" } }
index 08c18b4..e5590cf 100644 (file)
@@ -21,8 +21,13 @@ $theme[0][\"PATH\"] = SM_PATH . 'themes/default_theme.php';
 $theme[0]['XPATH'] = '/some//x/path' ;
 define ('MYVAR', ROOT . 'some value'); # end-of line comment
 include_once( ROOT . \"/path/to/conf\"  );
+include( ROOT . \"/path/to/conf\"       );
 @include SM_PATH . 'config/config_local.php';
- ?>
+class config {
+  var $tmppath = \"/tmp\";
+  var $offline = 1;
+}
+?>
 "
 
 test Phpvars.lns get conf =
@@ -44,12 +49,24 @@ test Phpvars.lns get conf =
   { "$config_version" = "'1.4.0'" }
   { "$theme" = "array()" }
   {  }
-  { "$theme[0]['NAME']" = "'Default'"
+  { "$theme" = "'Default'"
+    { "@arraykey" = "[0]['NAME']" }
     { "#comment" = "end-of line comment"  } }
-  { "$theme[0][\"PATH\"]" = "SM_PATH . 'themes/default_theme.php'" }
-  { "$theme[0]['XPATH']" = "'/some//x/path'" }
+  { "$theme" = "SM_PATH . 'themes/default_theme.php'"
+    { "@arraykey" = "[0][\"PATH\"]" }
+  }
+  { "$theme" = "'/some//x/path'"
+    { "@arraykey" = "[0]['XPATH']" }
+  }
   { "define" = "MYVAR"
     { "value" = "ROOT . 'some value'" }
     { "#comment" = "end-of line comment" } }
   { "include_once" = "ROOT . \"/path/to/conf\"" }
+  { "include" = "ROOT . \"/path/to/conf\"" }
   { "@include" = "SM_PATH . 'config/config_local.php'" }
+  { "config"
+    { }
+    {"$tmppath" = "\"/tmp\""}
+    {"$offline" = "1"}
+  }
+  { }
index a4d6fe6..ef1f806 100644 (file)
@@ -5,7 +5,9 @@ myorigin = /etc/mailname
 
 smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
 mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
-relayhost = \n"
+relayhost = 
+import_environment = 
+                 MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ LANG=C \n  KRB5CCNAME=FILE:${queue_directory}/kerberos/krb5_ccache\n"
 
 test Postfix_Main.lns get conf =
    { "#comment"  = "main.cf" }
@@ -14,6 +16,7 @@ test Postfix_Main.lns get conf =
    { "smtpd_banner" = "$myhostname ESMTP $mail_name (Ubuntu)" }
    { "mynetworks" = "127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128" }
    { "relayhost"  }
+   { "import_environment" = "MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ LANG=C \n  KRB5CCNAME=FILE:${queue_directory}/kerberos/krb5_ccache" }
 
 test Postfix_main.lns get "debugger_command =
 \t PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
index d87a26a..3a52792 100644 (file)
@@ -108,3 +108,20 @@ test Postfix_Master.lns get conf6 =
     { "command" = "pipe
        flags=R user=sympa argv=/home/sympa/bin/familyqueue ${user}@domain.net pfs" }
   }
+
+(* Ticket #345 *)
+let conf7 = "# master.cf
+submission inet n       -       n       -       -       smtpd
+  -o mynetworks=127.0.0.1/8,[::1]
+"
+
+test Postfix_Master.lns get conf7 =
+   { "#comment" = "master.cf" }
+   { "submission"
+     { "type" = "inet" }
+     { "private" = "n" }
+     { "unprivileged" = "-" }
+     { "chroot" = "n" }
+     { "wakeup" = "-" }
+     { "limit" = "-" }
+     { "command" = "smtpd\n  -o mynetworks=127.0.0.1/8,[::1]" } }
diff --git a/lenses/tests/test_postfix_transport.aug b/lenses/tests/test_postfix_transport.aug
new file mode 100644 (file)
index 0000000..e9664aa
--- /dev/null
@@ -0,0 +1,54 @@
+(*
+Module: Test_Postfix_Transport
+  Provides unit tests and examples for the <Postfix_Transport> lens.
+*)
+
+module Test_Postfix_Transport =
+
+(* View: conf *)
+let conf = "# a comment
+the.backed-up.domain.tld       relay:[their.mail.host.tld]
+.my.domain   :
+*            smtp:outbound-relay.my.domain
+example.com      uucp:example
+example.com      slow:
+example.com      :[gateway.example.com]
+user.foo@example.com  
+    smtp:bar.example:2025
+.example.com     error:mail for *.example.com is not deliverable
+"
+
+(* Test: Postfix_Transport.lns *)
+test Postfix_Transport.lns get conf =
+  { "#comment" = "a comment" }
+  { "pattern" = "the.backed-up.domain.tld"
+    { "transport" = "relay" }
+    { "nexthop" = "[their.mail.host.tld]" } }
+  { "pattern" = ".my.domain"
+    { "transport" }
+    { "nexthop" } }
+  { "pattern" = "*"
+    { "transport" = "smtp" }
+    { "nexthop" = "outbound-relay.my.domain" } }
+  { "pattern" = "example.com"
+    { "transport" = "uucp" }
+    { "nexthop" = "example" } }
+  { "pattern" = "example.com"
+    { "transport" = "slow" }
+    { "nexthop" } }
+  { "pattern" = "example.com"
+    { "transport" }
+    { "nexthop" = "[gateway.example.com]" } }
+  { "pattern" = "user.foo@example.com"
+    { "transport" = "smtp" }
+    { "nexthop" = "bar.example:2025" } }
+  { "pattern" = ".example.com"
+    { "transport" = "error" }
+    { "nexthop" = "mail for *.example.com is not deliverable" } }
+
+(* Test: Postfix_Transport.lns
+     Bug #303 *)
+test Postfix_Transport.lns get "user@example.com [12.34.56.78]:587\n" =
+  { "pattern" = "user@example.com"
+    { "host" = "[12.34.56.78]" }
+    { "port" = "587" } }
diff --git a/lenses/tests/test_postfix_virtual.aug b/lenses/tests/test_postfix_virtual.aug
new file mode 100644 (file)
index 0000000..d326830
--- /dev/null
@@ -0,0 +1,46 @@
+(*
+Module: Test_Postfix_Virtual
+  Provides unit tests and examples for the <Postfix_Virtual> lens.
+*)
+
+module Test_Postfix_Virtual =
+
+(* View: conf *)
+let conf = "# a comment
+virtual-alias.domain     anything
+postmaster@virtual-alias.domain  postmaster
+user1@virtual-alias.domain       address1
+user2@virtual-alias.domain   
+    address2,
+    address3
+root    robert.oot@domain.com
+@example.net  root,postmaster
+postmaster  mtaadmin+root=mta1
+"
+
+(* Test: Postfix_Virtual.lns *)
+test Postfix_Virtual.lns get conf =
+  { "#comment" = "a comment" }
+  { "pattern" = "virtual-alias.domain"
+    { "destination" = "anything" }
+  }
+  { "pattern" = "postmaster@virtual-alias.domain"
+    { "destination" = "postmaster" }
+  }
+  { "pattern" = "user1@virtual-alias.domain"
+    { "destination" = "address1" }
+  }
+  { "pattern" = "user2@virtual-alias.domain"
+    { "destination" = "address2" }
+    { "destination" = "address3" }
+  }
+  { "pattern" = "root"
+    { "destination" = "robert.oot@domain.com" }
+  }
+  { "pattern" = "@example.net"
+    { "destination" = "root" }
+    { "destination" = "postmaster" }
+  }
+  { "pattern" = "postmaster"
+    { "destination" = "mtaadmin+root=mta1" }
+  }
diff --git a/lenses/tests/test_postgresql.aug b/lenses/tests/test_postgresql.aug
new file mode 100644 (file)
index 0000000..94f485d
--- /dev/null
@@ -0,0 +1,245 @@
+(*
+Module: Test_Postgresql
+  Provides unit tests and examples for the <Postgresql> lens.
+*)
+
+module Test_Postgresql =
+
+(* "=" separator is optional *)
+let missing_equal = "fsync on\n"
+test Postgresql.lns get missing_equal =
+  { "fsync" = "on" }
+test Postgresql.lns put missing_equal after
+  set "fsync" "off" = "fsync off\n"
+
+(* extra whitespace is valid anywhere *)
+let extra_whitespace = "   fsync  =    on   # trailing comment   \n"
+test Postgresql.lns get extra_whitespace =
+  { "fsync" = "on"
+    { "#comment" = "trailing comment" }
+  }
+test Postgresql.lns put extra_whitespace after
+  set "fsync" "off" = "   fsync  =    off   # trailing comment   \n"
+
+(* no whitespace at all is also valid *)
+let no_whitespace = "fsync=on\n"
+test Postgresql.lns get no_whitespace =
+  { "fsync" = "on" }
+test Postgresql.lns put no_whitespace after
+  set "fsync" "off" = "fsync=off\n"
+
+(* Some settings specify a memory or time value. [...] Valid memory units are
+   kB (kilobytes), MB (megabytes), and GB (gigabytes); valid time units are
+   ms (milliseconds), s (seconds), min (minutes), h (hours), and d (days). *)
+let numeric_suffix_quotes = "shared_buffers = 24MB
+archive_timeout = 2min
+deadlock_timeout = '1s'
+"
+test Postgresql.lns get numeric_suffix_quotes =
+  { "shared_buffers" = "24MB" }
+  { "archive_timeout" = "2min" }
+  { "deadlock_timeout" = "1s" }
+test Postgresql.lns put numeric_suffix_quotes after
+  set "deadlock_timeout" "2s";
+  set "max_stack_depth" "2MB";
+  set "shared_buffers" "48MB" = "shared_buffers = 48MB
+archive_timeout = 2min
+deadlock_timeout = '2s'
+max_stack_depth = '2MB'
+"
+
+(* floats and ints can be single quoted or not *)
+let float_quotes = "seq_page_cost = 2.0
+random_page_cost = '4.0'
+vacuum_freeze_min_age = 50000000
+vacuum_freeze_table_age = '150000000'
+wal_buffers = -1
+"
+test Postgresql.lns get float_quotes =
+  { "seq_page_cost" = "2.0" }
+  { "random_page_cost" = "4.0" }
+  { "vacuum_freeze_min_age" = "50000000" }
+  { "vacuum_freeze_table_age" = "150000000" }
+  { "wal_buffers" = "-1" }
+test Postgresql.lns put float_quotes after
+  set "seq_page_cost" "5.0";
+  set "vacuum_cost_limit" "200";
+  set "bgwriter_lru_multiplier" "2.0";
+  set "log_temp_files" "-1";
+  set "wal_buffers" "1" = "seq_page_cost = 5.0
+random_page_cost = '4.0'
+vacuum_freeze_min_age = 50000000
+vacuum_freeze_table_age = '150000000'
+wal_buffers = 1
+vacuum_cost_limit = '200'
+bgwriter_lru_multiplier = '2.0'
+log_temp_files = '-1'
+"
+
+(* Boolean values can be written as on, off, true, false, yes, no, 1, 0 (all
+   case-insensitive) or any unambiguous prefix of these. *)
+let bool_quotes = "log_connections = yes
+transform_null_equals = OFF
+sql_inheritance = 'on'
+synchronize_seqscans = 1
+standard_conforming_strings = fal
+"
+test Postgresql.lns get bool_quotes =
+  { "log_connections" = "yes" }
+  { "transform_null_equals" = "OFF" }
+  { "sql_inheritance" = "on" }
+  { "synchronize_seqscans" = "1" }
+  { "standard_conforming_strings" = "fal" }
+test Postgresql.lns put bool_quotes after
+  set "sql_inheritance" "off";
+  set "log_lock_waits" "off" = "log_connections = yes
+transform_null_equals = OFF
+sql_inheritance = 'off'
+synchronize_seqscans = 1
+standard_conforming_strings = fal
+log_lock_waits = 'off'
+"
+
+(* Strings must be single-quoted, except if they have no special character *)
+let string_quotes = "listen_addresses = 'localhost'
+stats_temp_directory = pg_stat_tmp
+lc_messages = 'en_US.UTF-8'
+log_filename = log
+archive_command = 'tar \'quoted option\''
+search_path = '\"$user\",public'
+"
+test Postgresql.lns get string_quotes =
+  { "listen_addresses" = "localhost" }
+  { "stats_temp_directory" = "pg_stat_tmp" }
+  { "lc_messages" = "en_US.UTF-8" }
+  { "log_filename" = "log" }
+  { "archive_command" = "tar \'quoted option\'" }
+  { "search_path" = "\"$user\",public" }
+test Postgresql.lns put string_quotes after
+  set "stats_temp_directory" "foo_bar";
+  set "log_filename" "postgresql-%Y-%m-%d_%H%M%S.log";
+  set "log_statement" "none" = "listen_addresses = 'localhost'
+stats_temp_directory = foo_bar
+lc_messages = 'en_US.UTF-8'
+log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
+archive_command = 'tar \'quoted option\''
+search_path = '\"$user\",public'
+log_statement = 'none'
+"
+
+(* external files can be included more than once *)
+let include_keyword = "Include 'foo.conf'
+# can appear several times
+Include 'bar.conf'
+"
+test Postgresql.lns get include_keyword =
+  { "Include" = "foo.conf" }
+  { "#comment" = "can appear several times" }
+  { "Include" = "bar.conf" }
+
+(* Variable: conf
+   A full configuration file *)
+   let conf = "data_directory = '/var/lib/postgresql/8.4/main'         # use data in another directory
+hba_file = '/etc/postgresql/8.4/main/pg_hba.conf'      # host-based authentication file
+ident_file = '/etc/postgresql/8.4/main/pg_ident.conf'  # ident configuration file
+
+# If external_pid_file is not explicitly set, no extra PID file is written.
+external_pid_file = '/var/run/postgresql/8.4-main.pid'         # write an extra PID file
+listen_addresses = 'localhost'         # what IP address(es) to listen on;
+port = 5432                            # (change requires restart)
+max_connections = 100                  # (change requires restart)
+superuser_reserved_connections = 3     # (change requires restart)
+unix_socket_directory = '/var/run/postgresql'          # (change requires restart)
+unix_socket_group = ''                 # (change requires restart)
+unix_socket_permissions = 0777         # begin with 0 to use octal notation
+                                       # (change requires restart)
+bonjour_name = ''                      # defaults to the computer name
+
+authentication_timeout = 1min          # 1s-600s
+ssl = true                             # (change requires restart)
+ssl_ciphers = 'ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH'      # allowed SSL ciphers
+ssl_renegotiation_limit = 512MB        # amount of data between renegotiations
+password_encryption = on
+db_user_namespace = off
+
+search_path = '\"$user\",public'               # schema names
+default_tablespace = ''                # a tablespace name, '' uses the default
+temp_tablespaces = ''                  # a list of tablespace names, '' uses
+
+datestyle = 'iso, mdy'
+intervalstyle = 'postgres'
+timezone = unknown                     # actually, defaults to TZ environment
+"
+
+(* Test: Postgresql.lns *)
+test Postgresql.lns get conf =
+  { "data_directory" = "/var/lib/postgresql/8.4/main"
+    { "#comment" = "use data in another directory" }
+  }
+  { "hba_file" = "/etc/postgresql/8.4/main/pg_hba.conf"
+    { "#comment" = "host-based authentication file" }
+  }
+  { "ident_file" = "/etc/postgresql/8.4/main/pg_ident.conf"
+    { "#comment" = "ident configuration file" }
+  }
+  {  }
+  { "#comment" = "If external_pid_file is not explicitly set, no extra PID file is written." }
+  { "external_pid_file" = "/var/run/postgresql/8.4-main.pid"
+    { "#comment" = "write an extra PID file" }
+  }
+  { "listen_addresses" = "localhost"
+    { "#comment" = "what IP address(es) to listen on;" }
+  }
+  { "port" = "5432"
+    { "#comment" = "(change requires restart)" }
+  }
+  { "max_connections" = "100"
+    { "#comment" = "(change requires restart)" }
+  }
+  { "superuser_reserved_connections" = "3"
+    { "#comment" = "(change requires restart)" }
+  }
+  { "unix_socket_directory" = "/var/run/postgresql"
+    { "#comment" = "(change requires restart)" }
+  }
+  { "unix_socket_group" = ""
+    { "#comment" = "(change requires restart)" }
+  }
+  { "unix_socket_permissions" = "0777"
+    { "#comment" = "begin with 0 to use octal notation" }
+  }
+  { "#comment" = "(change requires restart)" }
+  { "bonjour_name" = ""
+    { "#comment" = "defaults to the computer name" }
+  }
+  {  }
+  { "authentication_timeout" = "1min"
+    { "#comment" = "1s-600s" }
+  }
+  { "ssl" = "true"
+    { "#comment" = "(change requires restart)" }
+  }
+  { "ssl_ciphers" = "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH"
+    { "#comment" = "allowed SSL ciphers" }
+  }
+  { "ssl_renegotiation_limit" = "512MB"
+    { "#comment" = "amount of data between renegotiations" }
+  }
+  { "password_encryption" = "on" }
+  { "db_user_namespace" = "off" }
+  {  }
+  { "search_path" = "\"$user\",public"
+    { "#comment" = "schema names" }
+  }
+  { "default_tablespace" = ""
+    { "#comment" = "a tablespace name, '' uses the default" }
+  }
+  { "temp_tablespaces" = ""
+    { "#comment" = "a list of tablespace names, '' uses" }
+  }
+  {  }
+  { "datestyle" = "iso, mdy" }
+  { "intervalstyle" = "postgres" }
+  { "timezone" = "unknown"
+    { "#comment" = "actually, defaults to TZ environment" }
+  }
index 594dda6..24c1fc6 100644 (file)
@@ -6,8 +6,47 @@ module Test_properties =
 tomcat.port = 8080
 tomcat.application.name=testapp
     tomcat.application.description=my test application
+property.with_underscore=works
+empty.property=
+empty.property.withtrailingspaces=   \n! more comments
+key: value
+key2:value2
+key3 :value3
+key4:=value4
+
+long.description=this is a description that happens to span \
+       more than one line with a combination of tabs and \
+        spaces \  \nor not
+
+# comment break
+
+short.break = a\
+ b
+
+=empty_key
+ =empty_key
+
+cheeses
+
+spaces only
+multi  spaces
+  indented spaces
+
+\= =A
+space and = equals
+space with \
+   multiline
+
+escaped\:colon=value
+escaped\=equals=value
+escaped\ space=value
 "
 
+(* Other tests that aren't supported yet
+overflow.description=\
+  just wanted to indent it
+*)
+
 let lns = Properties.lns
 
 test lns get conf =
@@ -18,7 +57,48 @@ test lns get conf =
     { "tomcat.port" = "8080" }
     { "tomcat.application.name" = "testapp" }
     { "tomcat.application.description" = "my test application" }
-
+    { "property.with_underscore" = "works" }
+    { "empty.property" }
+    { "empty.property.withtrailingspaces" }
+    { "!comment" = "more comments" }
+    { "key" = "value" }
+    { "key2" = "value2" }
+    { "key3" = "value3" }
+    { "key4" = "=value4" }
+    {}
+    { "long.description" = " < multi > "
+        { = "this is a description that happens to span " }
+        { = "more than one line with a combination of tabs and " }
+        { = "spaces " }
+        { = "or not" }
+    }
+    {}
+    { "#comment" = "comment break" }
+    {}
+    { "short.break" = " < multi > "
+        { = "a" }
+        { = "b" }
+    }
+    {}
+    { = "empty_key" }
+    { = "empty_key" }
+    {}
+    { "cheeses" }
+    {}
+    { "spaces" = "only" }
+    { "multi" = "spaces" }
+    { "indented" = "spaces" }
+    {}
+    { "\\=" = "A" }
+    { "space" = "and = equals" }
+    { "space" = " < multi > "
+        { = "with " }
+        { = "multiline" }
+    }
+    {}
+    { "escaped\:colon" = "value" }
+    { "escaped\=equals" = "value" }
+    { "escaped\ space" = "value" }
 test lns put conf after
     set "tomcat.port" "99";
     set "tomcat.application.host" "foo.network.com"
@@ -29,5 +109,52 @@ test lns put conf after
 tomcat.port = 99
 tomcat.application.name=testapp
     tomcat.application.description=my test application
+property.with_underscore=works
+empty.property=
+empty.property.withtrailingspaces=   \n! more comments
+key: value
+key2:value2
+key3 :value3
+key4:=value4
+
+long.description=this is a description that happens to span \
+       more than one line with a combination of tabs and \
+        spaces \  \nor not
+
+# comment break
+
+short.break = a\
+ b
+
+=empty_key
+ =empty_key
+
+cheeses
+
+spaces only
+multi  spaces
+  indented spaces
+
+\= =A
+space and = equals
+space with \
+   multiline
+
+escaped\:colon=value
+escaped\=equals=value
+escaped\ space=value
 tomcat.application.host=foo.network.com
 "
+
+(* GH issue #19: value on new line *)
+test lns get "k=\
+b\
+c\n" =
+    { "k" = " < multi > "
+      { } { = "b" } { = "c" } }
+
+test lns get "tomcat.util.scan.DefaultJarScanner.jarsToSkip=\
+bootstrap.jar,commons-daemon.jar,tomcat-juli.jar\n" =
+    { "tomcat.util.scan.DefaultJarScanner.jarsToSkip" = " < multi > "
+      { } { = "bootstrap.jar,commons-daemon.jar,tomcat-juli.jar" } }
+
diff --git a/lenses/tests/test_protocols.aug b/lenses/tests/test_protocols.aug
new file mode 100644 (file)
index 0000000..e9343a4
--- /dev/null
@@ -0,0 +1,53 @@
+(*
+Module: Test_Protocols
+  Provides unit tests and examples for the <Protocols> lens.
+*)
+
+module Test_Protocols =
+
+(* Variable: conf *)
+let conf = "# Internet (IP) protocols
+
+ip     0       IP              # internet protocol, pseudo protocol number
+#hopopt        0       HOPOPT          # IPv6 Hop-by-Hop Option [RFC1883]
+icmp   1       ICMP            # internet control message protocol
+igmp   2       IGMP            # Internet Group Management
+tp++    39  TP++        # TP++ Transport Protocol
+a/n 107 A/N     # Active Networks
+"
+
+(* Test: Protocols.lns *)
+test Protocols.lns get conf =
+  { "#comment" = "Internet (IP) protocols" }
+  {  }
+  { "1"
+    { "protocol" = "ip" }
+    { "number" = "0" }
+    { "alias" = "IP" }
+    { "#comment" = "internet protocol, pseudo protocol number" }
+  }
+  { "#comment" = "hopopt       0       HOPOPT          # IPv6 Hop-by-Hop Option [RFC1883]" }
+  { "2"
+    { "protocol" = "icmp" }
+    { "number" = "1" }
+    { "alias" = "ICMP" }
+    { "#comment" = "internet control message protocol" }
+  }
+  { "3"
+    { "protocol" = "igmp" }
+    { "number" = "2" }
+    { "alias" = "IGMP" }
+    { "#comment" = "Internet Group Management" }
+  }
+  { "4"
+    { "protocol" = "tp++" }
+    { "number" = "39" }
+    { "alias" = "TP++" }
+    { "#comment" = "TP++ Transport Protocol" }
+  }
+  { "5"
+    { "protocol" = "a/n" }
+    { "number" = "107" }
+    { "alias" = "A/N" }
+    { "#comment" = "Active Networks" }
+  }
diff --git a/lenses/tests/test_puppet_auth.aug b/lenses/tests/test_puppet_auth.aug
new file mode 100644 (file)
index 0000000..3adeedc
--- /dev/null
@@ -0,0 +1,43 @@
+(*
+Module: Test_Puppet_Auth
+  Provides unit tests and examples for the <Puppet_Auth> lens.
+*)
+
+module Test_Puppet_Auth =
+
+(* Variable: full *)
+let full = "path ~ ^/file_(metadata|content)/user_files/
+# Set environments
+environment production, development
+environment foo
+method  find, search
+auth    yes
+method save
+        allow /^(.+\.)?example.com$/
+  allow_ip 192.168.100.0/24 # Added in Puppet 3.0.0
+# This overrides the previous auth
+  authenticated any
+"
+
+(* Test: Puppet_Auth.lns *)
+test Puppet_Auth.lns get full =
+  { "path" = "^/file_(metadata|content)/user_files/" { "operator" = "~" }
+    { "#comment" = "Set environments" }
+    { "environment"
+      { "1" = "production" }
+      { "2" = "development" } }
+    { "environment"
+      { "3" = "foo" } }
+    { "method"
+      { "1" = "find" }
+      { "2" = "search" } }
+    { "auth" = "yes" }
+    { "method"
+      { "3" = "save" } }
+    { "allow"
+      { "1" = "/^(.+\.)?example.com$/" } }
+    { "allow_ip"
+      { "1" = "192.168.100.0/24" }
+      { "#comment" = "Added in Puppet 3.0.0" } }
+    { "#comment" = "This overrides the previous auth" }
+    { "auth" = "any" } }
diff --git a/lenses/tests/test_pythonpaste.aug b/lenses/tests/test_pythonpaste.aug
new file mode 100644 (file)
index 0000000..40cb7a5
--- /dev/null
@@ -0,0 +1,41 @@
+module Test_pythonpaste =
+
+   let conf = "
+#blah blah
+[main]
+pipeline = hello
+
+[composite:main]
+use = egg:Paste#urlmap
+/v2.0 = public_api
+/: public_version_api
+"
+
+   test PythonPaste.lns get conf =
+      { }
+      { "#comment" = "blah blah" }
+      { "main"
+         { "pipeline" = "hello" }
+         { }
+      }
+      { "composite:main"
+         { "use" = "egg:Paste#urlmap" }
+         { "1" = "/v2.0 = public_api" }
+         { "2" = "/: public_version_api" }
+      }
+
+
+    test PythonPaste.lns put conf after
+       set "main/pipeline" "goodbye";
+       set "composite:main/3" "/v3: a_new_api_version"
+    = "
+#blah blah
+[main]
+pipeline = goodbye
+
+[composite:main]
+use = egg:Paste#urlmap
+/v2.0 = public_api
+/: public_version_api
+/v3: a_new_api_version
+"
diff --git a/lenses/tests/test_qpid.aug b/lenses/tests/test_qpid.aug
new file mode 100644 (file)
index 0000000..4dc513d
--- /dev/null
@@ -0,0 +1,48 @@
+(*
+Module: Test_Qpid
+  Provides unit tests and examples for the <Qpid> lens.
+*)
+
+module Test_Qpid =
+
+(* Variable: qpidd *)
+let qpidd = "# Configuration file for qpidd. Entries are of the form: 
+#   name=value 
+
+# (Note: no spaces on either side of '='). Using default settings:
+# \"qpidd --help\" or \"man qpidd\" for more details.
+cluster-mechanism=ANONYMOUS
+auth=no
+max-connections=22000
+syslog-name=qpidd1
+"
+
+(* Test: Qpid.lns *)
+test Qpid.lns get qpidd =
+   { "#comment" = "Configuration file for qpidd. Entries are of the form:" }
+   { "#comment" = "name=value" }
+   { }
+   { "#comment" = "(Note: no spaces on either side of '='). Using default settings:" }
+   { "#comment" = "\"qpidd --help\" or \"man qpidd\" for more details." }
+   { "cluster-mechanism" = "ANONYMOUS" }
+   { "auth" = "no" }
+   { "max-connections" = "22000" }
+   { "syslog-name" = "qpidd1" }
+
+(* Variable: qpidc *)
+let qpidc = "# Configuration file for the qpid c++ client library. Entries are of
+# the form:
+#   name=value
+
+ssl-cert-db=/root/certs/server_db
+ssl-port=5674 
+"
+
+(* Test: Qpid.lns *)
+test Qpid.lns get qpidc =
+   { "#comment" = "Configuration file for the qpid c++ client library. Entries are of" }
+   { "#comment" = "the form:" }
+   { "#comment" = "name=value" }
+   { }
+   { "ssl-cert-db" = "/root/certs/server_db" }
+   { "ssl-port" = "5674" }
diff --git a/lenses/tests/test_quote.aug b/lenses/tests/test_quote.aug
new file mode 100644 (file)
index 0000000..411cdee
--- /dev/null
@@ -0,0 +1,369 @@
+(*
+Module: Test_Quote
+  Provides unit tests and examples for the <Quote> lens.
+*)
+
+module Test_Quote =
+
+(* View: double *)
+let double = [ label "double" . Quote.double ]
+
+(* Test: double *)
+test double get "\" this is a test\"" =
+  { "double" = " this is a test" }
+
+(* View: double_opt *)
+let double_opt = [ label "double_opt" . Quote.double_opt ]
+
+(* Test: double_opt *)
+test double_opt get "\"this is a test\"" =
+  { "double_opt" = "this is a test" }
+
+(* Test: double_opt *)
+test double_opt get "this is a test" =
+  { "double_opt" = "this is a test" }
+
+(* Test: double_opt
+   Value cannot start with a space *)
+test double_opt get " this is a test" = *
+
+(* View: single *)
+let single = [ label "single" . Quote.single ]
+
+(* Test: single *)
+test single get "' this is a test'" =
+  { "single" = " this is a test" }
+
+(* View: single_opt *)
+let single_opt = [ label "single_opt" . Quote.single_opt ]
+
+(* Test: single_opt *)
+test single_opt get "'this is a test'" =
+  { "single_opt" = "this is a test" }
+
+(* Test: single_opt *)
+test single_opt get "this is a test" =
+  { "single_opt" = "this is a test" }
+
+(* Test: single_opt
+   Value cannot start with a space *)
+test single_opt get " this is a test" = *
+
+(* View: any *)
+let any = [ label "any" . Quote.any ]
+
+(* Test: any *)
+test any get "\" this is a test\"" =
+  { "any" = " this is a test" }
+
+(* Test: any *)
+test any get "' this is a test'" =
+  { "any" = " this is a test" }
+
+(* View: any_opt *)
+let any_opt = [ label "any_opt" . Quote.any_opt ]
+
+(* Test: any_opt *)
+test any_opt get "\"this is a test\"" =
+  { "any_opt" = "this is a test" }
+
+(* Test: any_opt *)
+test any_opt get "'this is a test'" =
+  { "any_opt" = "this is a test" }
+
+(* Test: any_opt *)
+test any_opt get "this is a test" =
+  { "any_opt" = "this is a test" }
+
+(* Test: any_opt
+   Value cannot start with a space *)
+test any_opt get " this is a test" = *
+
+(* View: double_opt_allow_spc *)
+let double_opt_allow_spc =
+  let body = store /[^\n"]+/ in
+  [ label "double" . Quote.do_dquote_opt body ]
+
+(* Test: double_opt_allow_spc *)
+test double_opt_allow_spc get " test with spaces " =
+  { "double" = " test with spaces " }
+
+(* Group: quote_spaces *)
+
+(* View: quote_spaces *)
+let quote_spaces =
+  Quote.quote_spaces (label "spc")
+
+(* Test: quote_spaces
+     Unquoted value *)
+test quote_spaces get "this" =
+  { "spc" = "this" }
+
+(* Test: quote_spaces
+     double quoted value *)
+test quote_spaces get "\"this\"" =
+  { "spc" = "this" }
+
+(* Test: quote_spaces
+     single quoted value *)
+test quote_spaces get "'this'" =
+  { "spc" = "this" }
+
+(* Test: quote_spaces
+     unquoted value with spaces *)
+test quote_spaces get "this that those" = *
+
+(* Test: quote_spaces
+     double quoted value with spaces *)
+test quote_spaces get "\"this that those\"" =
+  { "spc" = "this that those" }
+
+(* Test: quote_spaces
+     single quoted value with spaces *)
+test quote_spaces get "'this that those'" =
+  { "spc" = "this that those" }
+
+(* Test: quote_spaces
+     remove spaces from double-quoted value *)
+test quote_spaces put "\"this that those\""
+  after set "spc" "thisthat" =
+  "\"thisthat\""
+
+(* Test: quote_spaces
+     remove spaces from single-quoted value *)
+test quote_spaces put "'this that those'"
+  after set "spc" "thisthat" =
+  "'thisthat'"
+
+(* Test: quote_spaces
+     add spaces to unquoted value *)
+test quote_spaces put "this"
+  after set "spc" "this that those" =
+  "\"this that those\""
+
+(* Test: quote_spaces
+     add spaces to double-quoted value *)
+test quote_spaces put "\"this\""
+  after set "spc" "this that those" =
+  "\"this that those\""
+
+(* Test: quote_spaces
+     add spaces to single-quoted value *)
+test quote_spaces put "'this'"
+  after set "spc" "this that those" =
+  "'this that those'"
+
+(* Group: dquote_spaces *)
+
+(* View: dquote_spaces *)
+let dquote_spaces =
+  Quote.dquote_spaces (label "spc")
+
+(* Test: dquote_spaces
+     Unquoted value *)
+test dquote_spaces get "this" =
+  { "spc" = "this" }
+
+(* Test: dquote_spaces
+     double quoted value *)
+test dquote_spaces get "\"this\"" =
+  { "spc" = "this" }
+
+(* Test: dquote_spaces
+     single quoted value *)
+test dquote_spaces get "'this'" =
+  { "spc" = "'this'" }
+
+(* Test: dquote_spaces
+     unquoted value with spaces *)
+test dquote_spaces get "this that those" = *
+
+(* Test: dquote_spaces
+     double quoted value with spaces *)
+test dquote_spaces get "\"this that those\"" =
+  { "spc" = "this that those" }
+
+(* Test: dquote_spaces
+     single quoted value with spaces *)
+test dquote_spaces get "'this that those'" = *
+
+(* Test: dquote_spaces
+     remove spaces from double-quoted value *)
+test dquote_spaces put "\"this that those\""
+  after set "spc" "thisthat" =
+  "\"thisthat\""
+
+(* Test: dquote_spaces
+     add spaces to unquoted value *)
+test dquote_spaces put "this"
+  after set "spc" "this that those" =
+  "\"this that those\""
+
+(* Test: dquote_spaces
+     add spaces to double-quoted value *)
+test dquote_spaces put "\"this\""
+  after set "spc" "this that those" =
+  "\"this that those\""
+
+(* Test: dquote_spaces
+     add spaces to single-quoted value *)
+test dquote_spaces put "'this'"
+  after set "spc" "this that those" =
+  "\"this that those\""
+
+(* Group: squote_spaces *)
+
+(* View: squote_spaces *)
+let squote_spaces =
+  Quote.squote_spaces (label "spc")
+
+(* Test: squote_spaces
+     Unquoted value *)
+test squote_spaces get "this" =
+  { "spc" = "this" }
+
+(* Test: squote_spaces
+     double quoted value *)
+test squote_spaces get "\"this\"" =
+  { "spc" = "\"this\"" }
+
+(* Test: squote_spaces
+     single quoted value *)
+test squote_spaces get "'this'" =
+  { "spc" = "this" }
+
+(* Test: squote_spaces
+     unquoted value with spaces *)
+test squote_spaces get "this that those" = *
+
+(* Test: squote_spaces
+     double quoted value with spaces *)
+test squote_spaces get "\"this that those\"" = *
+
+(* Test: squote_spaces
+     single quoted value with spaces *)
+test squote_spaces get "'this that those'" =
+  { "spc" = "this that those" }
+
+(* Test: squote_spaces
+     remove spaces from single-quoted value *)
+test squote_spaces put "'this that those'"
+  after set "spc" "thisthat" =
+  "'thisthat'"
+
+(* Test: squote_spaces
+     add spaces to unquoted value *)
+test squote_spaces put "this"
+  after set "spc" "this that those" =
+  "'this that those'"
+
+(* Test: squote_spaces
+     add spaces to double-quoted value *)
+test squote_spaces put "\"this\""
+  after set "spc" "this that those" =
+  "'this that those'"
+
+(* Test: squote_spaces
+     add spaces to single-quoted value *)
+test squote_spaces put "'this'"
+  after set "spc" "this that those" =
+  "'this that those'"
+
+(* Group: nil cases *)
+
+(* View: dquote_opt_nil *)
+let dquote_opt_nil =
+     let body = store Quote.double_opt_re
+  in [ label "dquote_opt_nil" . Quote.do_dquote_opt_nil body ]?
+
+(* Test: dquote_opt_nil *)
+test dquote_opt_nil get "this" =
+  { "dquote_opt_nil" = "this" }
+
+(* Test: dquote_opt_nil *)
+test dquote_opt_nil get "'this'" =
+  { "dquote_opt_nil" = "'this'" }
+
+(* Test: dquote_opt_nil *)
+test dquote_opt_nil get "\"this\"" =
+  { "dquote_opt_nil" = "this" }
+
+(* Test: dquote_opt_nil *)
+test dquote_opt_nil put ""
+  after set "dquote_opt_nil" "this" =
+  "this"
+
+(* Test: dquote_opt_nil *)
+test dquote_opt_nil put "\"this\""
+  after set "dquote_opt_nil" "this" =
+  "\"this\""
+
+(* Test: dquote_opt_nil *)
+test dquote_opt_nil put "'this'"
+  after set "dquote_opt_nil" "this" =
+  "this"
+
+(* View: squote_opt_nil *)
+let squote_opt_nil =
+     let body = store Quote.single_opt_re
+  in [ label "squote_opt_nil" . Quote.do_squote_opt_nil body ]?
+
+(* Test: squote_opt_nil *)
+test squote_opt_nil get "this" =
+  { "squote_opt_nil" = "this" }
+
+(* Test: squote_opt_nil *)
+test squote_opt_nil get "'this'" =
+  { "squote_opt_nil" = "this" }
+
+(* Test: squote_opt_nil *)
+test squote_opt_nil get "\"this\"" =
+  { "squote_opt_nil" = "\"this\"" }
+
+(* Test: squote_opt_nil *)
+test squote_opt_nil put ""
+  after set "squote_opt_nil" "this" =
+  "this"
+
+(* Test: squote_opt_nil *)
+test squote_opt_nil put "\"this\""
+  after set "squote_opt_nil" "this" =
+  "this"
+
+(* Test: squote_opt_nil *)
+test squote_opt_nil put "\"this\""
+  after set "squote_opt_nil" "this" =
+  "this"
+
+(* View: quote_opt_nil *)
+let quote_opt_nil =
+     let body = store Quote.any_opt_re
+  in [ label "quote_opt_nil" . Quote.do_quote_opt_nil body ]?
+
+(* Test: quote_opt_nil *)
+test quote_opt_nil get "this" =
+  { "quote_opt_nil" = "this" }
+
+(* Test: quote_opt_nil *)
+test quote_opt_nil get "'this'" =
+  { "quote_opt_nil" = "this" }
+
+(* Test: quote_opt_nil *)
+test quote_opt_nil get "\"this\"" =
+  { "quote_opt_nil" = "this" }
+
+(* Test: quote_opt_nil *)
+test quote_opt_nil put ""
+  after set "quote_opt_nil" "this" =
+  "this"
+
+(* Test: quote_opt_nil *)
+test quote_opt_nil put "\"this\""
+  after set "quote_opt_nil" "this" =
+  "\"this\""
+
+(* Test: quote_opt_nil *)
+test quote_opt_nil put "'this'"
+  after set "quote_opt_nil" "this" =
+  "'this'"
+
diff --git a/lenses/tests/test_rabbitmq.aug b/lenses/tests/test_rabbitmq.aug
new file mode 100644 (file)
index 0000000..430e846
--- /dev/null
@@ -0,0 +1,92 @@
+(*
+Module: Test_Rabbitmq
+  Provides unit tests and examples for the <Rabbitmq> lens.
+*)
+module Test_Rabbitmq =
+
+(* Test: Rabbitmq.listeners *)
+test Rabbitmq.listeners get "{ssl_listeners, [5671, {\"127.0.0.1\", 5672}]}" =
+  { "ssl_listeners"
+    { "value" = "5671" }
+    { "tuple"
+      { "value" = "127.0.0.1" }
+      { "value" = "5672" } } }
+
+(* Test: Rabbitmq.ssl_options *)
+test Rabbitmq.ssl_options get "{ssl_options, [
+  {cacertfile,\"/path/to/testca/cacert.pem\"},
+  {certfile,\"/path/to/server/cert.pem\"},
+  {keyfile,\"/path/to/server/key.pem\"},
+  {verify,verify_peer},
+  {fail_if_no_peer_cert,false}]}" =
+  { "ssl_options"
+    { "cacertfile" = "/path/to/testca/cacert.pem" }
+    { "certfile" = "/path/to/server/cert.pem" }
+    { "keyfile" = "/path/to/server/key.pem" }
+    { "verify" = "verify_peer" }
+    { "fail_if_no_peer_cert" = "false" } }
+
+(* Test: Rabbitmq.disk_free_limit *)
+test Rabbitmq.disk_free_limit get "{disk_free_limit, 1000000000}" =
+  { "disk_free_limit" = "1000000000" }
+
+(* Test: Rabbitmq.disk_free_limit *)
+test Rabbitmq.disk_free_limit get "{disk_free_limit, {mem_relative, 1.0}}" =
+  { "disk_free_limit"
+    { "tuple"
+      { "value" = "mem_relative" }
+      { "value" = "1.0" } } }
+
+(* Test: Rabbitmq.log_levels *)
+test Rabbitmq.log_levels get "{log_levels, [{connection, info}]}" =
+  { "log_levels"
+    { "tuple"
+      { "value" = "connection" }
+      { "value" = "info" } } }
+
+(* Test: Rabbitmq.cluster_nodes *)
+test Rabbitmq.cluster_nodes get "{cluster_nodes, {['rabbit@rabbit1', 'rabbit@rabbit2', 'rabbit@rabbit3'], disc}}" =
+  { "cluster_nodes"
+    { "tuple"
+      { "value"
+        { "value" = "rabbit@rabbit1" }
+        { "value" = "rabbit@rabbit2" }
+        { "value" = "rabbit@rabbit3" } }
+      { "value" = "disc" } } }
+
+(* Test: Rabbitmq.cluster_nodes
+     Apparently, tuples are not mandatory *)
+test Rabbitmq.cluster_nodes get "{cluster_nodes, ['rabbit@rabbit1', 'rabbit@rabbit2', 'rabbit@rabbit3']}" =
+  { "cluster_nodes"
+     { "value" = "rabbit@rabbit1" }
+     { "value" = "rabbit@rabbit2" }
+     { "value" = "rabbit@rabbit3" } }
+
+(* Test: Rabbitmq.lns
+     Top-level test *)
+test Rabbitmq.lns get "
+% A standard configuration
+[
+  {rabbit, [
+     {ssl_listeners, [5671]},
+     {ssl_options, [{cacertfile,\"/path/to/testca/cacert.pem\"},
+                    {certfile,\"/path/to/server/cert.pem\"},
+                    {keyfile,\"/path/to/server/key.pem\"},
+                    {verify,verify_peer},
+                    {fail_if_no_peer_cert,false}]}
+   ]}
+].
+% EOF\n" =
+  { }
+  { "#comment" = "A standard configuration" }
+  { "rabbit"
+    { "ssl_listeners"
+      { "value" = "5671" } }
+    { "ssl_options"
+      { "cacertfile" = "/path/to/testca/cacert.pem" }
+      { "certfile" = "/path/to/server/cert.pem" }
+      { "keyfile" = "/path/to/server/key.pem" }
+      { "verify" = "verify_peer" }
+      { "fail_if_no_peer_cert" = "false" } } }
+  { "#comment" = "EOF" }
+
diff --git a/lenses/tests/test_redis.aug b/lenses/tests/test_redis.aug
new file mode 100644 (file)
index 0000000..ff0e4ed
--- /dev/null
@@ -0,0 +1,181 @@
+(*
+Module: Test_Redis
+  Provides unit tests and examples for the <Redis> lens.
+*)
+
+module Test_Redis =
+
+let standard_entry = "dir /var/lib/redis\n"
+test Redis.lns get standard_entry = { "dir" = "/var/lib/redis" }
+
+let double_quoted_entry = "dir \"/var/lib/redis\"\n"
+test Redis.lns get double_quoted_entry = { "dir" = "/var/lib/redis" }
+
+let single_quoted_entry = "dir '/var/lib/redis'\n"
+test Redis.lns get single_quoted_entry = { "dir" = "/var/lib/redis" }
+
+let extra_whitespace_entry = "   dir    /var/lib/redis     \n"
+test Redis.lns get extra_whitespace_entry = { "dir" = "/var/lib/redis" }
+
+let save_entry = "save 60 10000\n"
+test Redis.lns get save_entry =
+{ "save"
+  { "seconds" = "60" }
+  { "keys" = "10000" }
+}
+
+let save_entry_quotes = "save '60' \"10000\"\n"
+test Redis.lns get save_entry_quotes =
+{ "save"
+  { "seconds" = "60" }
+  { "keys" = "10000" }
+}
+
+let slaveof_entry = "slaveof 192.168.0.10 6379\n"
+test Redis.lns get slaveof_entry =
+{ "slaveof"
+  { "ip" = "192.168.0.10" }
+  { "port" = "6379" }
+}
+
+let rename_command_entry = "rename-command CONFIG CONFIG2\n"
+test Redis.lns get rename_command_entry =
+{ "rename-command"
+  { "from" = "CONFIG" }
+  { "to" = "CONFIG2" }
+}
+
+let client_output_buffer_limit_entry_1 = "client-output-buffer-limit normal 0 0 0\n"
+test Redis.lns get client_output_buffer_limit_entry_1 =
+{ "client-output-buffer-limit"
+  { "class" = "normal" }
+  { "hard_limit" = "0" }
+  { "soft_limit" = "0" }
+  { "soft_seconds" = "0" }
+}
+
+let client_output_buffer_limit_entry_2 = "client-output-buffer-limit slave 256mb 64mb 60\n"
+test Redis.lns get client_output_buffer_limit_entry_2 =
+{ "client-output-buffer-limit"
+  { "class" = "slave" }
+  { "hard_limit" = "256mb" }
+  { "soft_limit" = "64mb" }
+  { "soft_seconds" = "60" }
+}
+
+let include_entry = "include /foo/redis.conf\ninclude /bar/redis.conf\n"
+test Redis.lns get include_entry =
+{ "include" = "/foo/redis.conf" }
+{ "include" = "/bar/redis.conf" }
+
+let standard_comment = "# a comment\n"
+test Redis.lns get standard_comment = { "#comment" = "a comment" }
+
+let extra_whitespace_comment = "   #     another comment        \n"
+test Redis.lns get extra_whitespace_comment = { "#comment" = "another comment" }
+
+let redis_conf = "# Redis configuration file example
+
+# Note on units: when memory size is needed, it is possible to specifiy
+# it in the usual form of 1k 5GB 4M and so forth:
+#
+# 1k => 1000 bytes
+# 1kb => 1024 bytes
+# 1m => 1000000 bytes
+# 1mb => 1024*1024 bytes
+# 1g => 1000000000 bytes
+# 1gb => 1024*1024*1024 bytes
+#
+# units are case insensitive so 1GB 1Gb 1gB are all the same.
+
+# By default Redis does not run as a daemon. Use 'yes' if you need it.
+# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
+daemonize yes
+
+# When running daemonized, Redis writes a pid file in /var/run/redis.pid by
+# default. You can specify a custom pid file location here.
+pidfile /var/run/redis/redis-server.pid
+
+# Accept connections on the specified port, default is 6379.
+# If port 0 is specified Redis will not listen on a TCP socket.
+port 6379
+
+# If you want you can bind a single interface, if the bind option is not
+# specified all the interfaces will listen for incoming connections.
+#
+bind 127.0.0.1
+
+#   Note: you can disable saving at all commenting all the \"save\" lines.
+
+save 900 1
+save 300 10
+save 60 10000
+
+# Include one or more other config files here.  This is useful if you
+# have a standard template that goes to all redis server but also need
+# to customize a few per-server settings.  Include files can include
+# other files, so use this wisely.
+#
+include /path/to/local.conf
+include /path/to/other.conf
+"
+
+test Redis.lns get redis_conf =
+  { "#comment" = "Redis configuration file example" }
+  { }
+  { "#comment" = "Note on units: when memory size is needed, it is possible to specifiy" }
+  { "#comment" = "it in the usual form of 1k 5GB 4M and so forth:" }
+  { }
+  { "#comment" = "1k => 1000 bytes" }
+  { "#comment" = "1kb => 1024 bytes" }
+  { "#comment" = "1m => 1000000 bytes" }
+  { "#comment" = "1mb => 1024*1024 bytes" }
+  { "#comment" = "1g => 1000000000 bytes" }
+  { "#comment" = "1gb => 1024*1024*1024 bytes" }
+  { }
+  { "#comment" = "units are case insensitive so 1GB 1Gb 1gB are all the same." }
+  { }
+  { "#comment" = "By default Redis does not run as a daemon. Use 'yes' if you need it." }
+  { "#comment" = "Note that Redis will write a pid file in /var/run/redis.pid when daemonized." }
+  { "daemonize" = "yes" }
+  { }
+  { "#comment" = "When running daemonized, Redis writes a pid file in /var/run/redis.pid by" }
+  { "#comment" = "default. You can specify a custom pid file location here." }
+  { "pidfile" = "/var/run/redis/redis-server.pid" }
+  { }
+  { "#comment" = "Accept connections on the specified port, default is 6379." }
+  { "#comment" = "If port 0 is specified Redis will not listen on a TCP socket." }
+  { "port" = "6379" }
+  { }
+  { "#comment" = "If you want you can bind a single interface, if the bind option is not" }
+  { "#comment" = "specified all the interfaces will listen for incoming connections." }
+  { }
+  { "bind" = "127.0.0.1" }
+  { }
+  { "#comment" = "Note: you can disable saving at all commenting all the \"save\" lines." }
+  { }
+  { "save"
+    { "seconds" = "900" }
+    { "keys" = "1" }
+  }
+  { "save"
+    { "seconds" = "300" }
+    { "keys" = "10" }
+  }
+  { "save"
+    { "seconds" = "60" }
+    { "keys" = "10000" }
+  }
+  { }
+  { "#comment" = "Include one or more other config files here.  This is useful if you" }
+  { "#comment" = "have a standard template that goes to all redis server but also need" }
+  { "#comment" = "to customize a few per-server settings.  Include files can include" }
+  { "#comment" = "other files, so use this wisely." }
+  { }
+  { "include" = "/path/to/local.conf" }
+  { "include" = "/path/to/other.conf" }
+
+(* Test: Redis.lns
+     Empty value (GH issue #115) *)
+test Redis.lns get "notify-keyspace-events \"\"\n" =
+  { "notify-keyspace-events" = "" }
index b5c988c..7eed96b 100644 (file)
@@ -11,7 +11,10 @@ search mynet.com anotherorg.net
 sortlist 130.155.160.0/255.255.240.0 130.155.0.0
 
 options ndots:3 debug timeout:2
-options no-ip6-dotint  # and EOL comments
+options no-ip6-dotint single-request-reopen # and EOL comments
+
+lookup file bind
+family inet6 inet4
 "
 
 test Resolv.lns get conf =
@@ -39,7 +42,15 @@ test Resolv.lns get conf =
    { "options"
         { "ip6-dotint"
              { "negate" } }
+       { "single-request-reopen" }
         { "#comment" = "and EOL comments" } }
+   {}
+   { "lookup"
+        { "file" }
+        { "bind" } }
+   { "family"
+        { "inet6" }
+        { "inet4" } }
 
 test Resolv.ip6_dotint
    put "ip6-dotint"
diff --git a/lenses/tests/test_rmt.aug b/lenses/tests/test_rmt.aug
new file mode 100644 (file)
index 0000000..4bb7d68
--- /dev/null
@@ -0,0 +1,38 @@
+module Test_rmt =
+
+let conf = "#ident @(#)rmt.dfl 1.2 05/08/09 Copyr 2000 J. Schilling
+#
+# This file is /etc/default/rmt
+
+DEBUG=/tmp/RMT
+USER=*
+
+ACCESS=rtape   sparky  /dev/rmt/*
+ACCESS=*       *       /dev/rmt/*
+
+# Historically, Red Hat rmt was not so ^^ restrictive.
+ACCESS=*       *       *
+"
+
+test Rmt.lns get conf =
+  { "#comment" = "ident @(#)rmt.dfl    1.2 05/08/09 Copyr 2000 J. Schilling" }
+  { }
+  { "#comment" = "This file is /etc/default/rmt" }
+  { }
+  { "DEBUG" = "/tmp/RMT" }
+  { "USER" = "*" }
+  { }
+  { "ACCESS"
+    { "name" = "rtape" }
+    { "host" = "sparky" }
+    { "path" = "/dev/rmt/*" } }
+  { "ACCESS"
+    { "name" = "*" }
+    { "host" = "*" }
+    { "path" = "/dev/rmt/*" } }
+  { }
+  { "#comment" = "Historically, Red Hat rmt was not so ^^ restrictive." }
+  { "ACCESS"
+    { "name" = "*" }
+    { "host" = "*" }
+    { "path" = "*" } }
diff --git a/lenses/tests/test_rsyslog.aug b/lenses/tests/test_rsyslog.aug
new file mode 100644 (file)
index 0000000..e696139
--- /dev/null
@@ -0,0 +1,142 @@
+(*
+Module: Test_Rsyslog
+  Provides unit tests and examples for the <Rsyslog> lens.
+*)
+
+module Test_Rsyslog =
+
+(* Variable: conf *)
+let conf = "# rsyslog v5 configuration file
+
+$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
+$ModLoad imklog   # provides kernel logging support (previously done by rklogd)
+$UDPServerRun 514
+$InputTCPServerRun 514
+$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
+$ActionFileEnableSync on
+$IncludeConfig /etc/rsyslog.d/*.conf
+
+*.info;mail.none;authpriv.none;cron.none                /var/log/messages
+authpriv.*                                              /var/log/secure
+*.emerg                                                 *
+*.*    @2.7.4.1
+*.*    @@2.7.4.1
+*.emerg :omusrmsg:*
+*.emerg :omusrmsg:foo,bar
+"
+
+(* Test: Rsyslog.lns *)
+test Rsyslog.lns get conf =
+  { "#comment" = "rsyslog v5 configuration file" }
+  {  }
+  { "$ModLoad" = "imuxsock"
+    { "#comment" = "provides support for local system logging (e.g. via logger command)" }
+  }
+  { "$ModLoad" = "imklog"
+    { "#comment" = "provides kernel logging support (previously done by rklogd)" }
+  }
+  { "$UDPServerRun" = "514" }
+  { "$InputTCPServerRun" = "514" }
+  { "$ActionFileDefaultTemplate" = "RSYSLOG_TraditionalFileFormat" }
+  { "$ActionFileEnableSync" = "on" }
+  { "$IncludeConfig" = "/etc/rsyslog.d/*.conf" }
+  {  }
+  { "entry"
+    { "selector"
+      { "facility" = "*" }
+      { "level" = "info" }
+    }
+    { "selector"
+      { "facility" = "mail" }
+      { "level" = "none" }
+    }
+    { "selector"
+      { "facility" = "authpriv" }
+      { "level" = "none" }
+    }
+    { "selector"
+      { "facility" = "cron" }
+      { "level" = "none" }
+    }
+    { "action"
+      { "file" = "/var/log/messages" }
+    }
+  }
+  { "entry"
+    { "selector"
+      { "facility" = "authpriv" }
+      { "level" = "*" }
+    }
+    { "action"
+      { "file" = "/var/log/secure" }
+    }
+  }
+  { "entry"
+    { "selector"
+      { "facility" = "*" }
+      { "level" = "emerg" }
+    }
+    { "action"
+      { "user" = "*" }
+    }
+  }
+  { "entry"
+    { "selector"
+      { "facility" = "*" }
+      { "level" = "*" }
+    }
+    { "action"
+      { "protocol" = "@" }
+      { "hostname" = "2.7.4.1" }
+    }
+  }
+  { "entry"
+    { "selector"
+      { "facility" = "*" }
+      { "level" = "*" }
+    }
+    { "action"
+      { "protocol" = "@@" }
+      { "hostname" = "2.7.4.1" }
+    }
+  }
+  { "entry"
+    { "selector"
+      { "facility" = "*" }
+      { "level" = "emerg" }
+    }
+    { "action"
+      { "omusrmsg" = "*" }
+    }
+  }
+  { "entry"
+    { "selector"
+      { "facility" = "*" }
+      { "level" = "emerg" }
+    }
+    { "action"
+      { "omusrmsg" = "foo" }
+      { "omusrmsg" = "bar" } }
+  }
+
+(* Parse complex $template lines, RHBZ#1083016 *)
+test Rsyslog.lns get "$template SpiceTmpl,\"%TIMESTAMP%.%TIMESTAMP:::date-subseconds% %syslogtag% %syslogseverity-text%:%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\\n\"\n" =
+  { "$template" = "SpiceTmpl,\"%TIMESTAMP%.%TIMESTAMP:::date-subseconds% %syslogtag% %syslogseverity-text%:%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\\n\"" }
+
+(* Parse property-based filters, RHBZ#1083016 *)
+test Rsyslog.lns get ":programname, startswith, \"spice-vdagent\" /var/log/spice-vdagent.log;SpiceTmpl\n" =
+  { "filter"
+    { "property" = "programname" }
+    { "operation" = "startswith" }
+    { "value" = "spice-vdagent" }
+    { "action"
+      { "file" = "/var/log/spice-vdagent.log" }
+      { "template" = "SpiceTmpl" } } }
+
+test Rsyslog.lns get ":msg, !contains, \"error\" /var/log/noterror.log\n" =
+  { "filter"
+    { "property" = "msg" }
+    { "operation" = "!contains" }
+    { "value" = "error" }
+    { "action"
+      { "file" = "/var/log/noterror.log" } } }
index bf194be..de4ccab 100644 (file)
@@ -13,3 +13,47 @@ let sto_ip = [ label "IP" . store Rx.ip ]
 test sto_ip get "192.168.0.1"              = { "IP" = "192.168.0.1"              }
 test sto_ip get "255.255.255.254"          = { "IP" = "255.255.255.254"          }
 test sto_ip get "fe80::215:f2ff:fea4:b8d9" = { "IP" = "fe80::215:f2ff:fea4:b8d9" }
+
+(* iso_8601 *)
+let iso_8601 = [ label "date" . store Rx.iso_8601 ]
+
+test iso_8601 get "2009-12T12:34" = { "date" = "2009-12T12:34" }
+test iso_8601 get "2009" = { "date" = "2009" }
+test iso_8601 get "2009-05-19" = { "date" = "2009-05-19" }
+test iso_8601 get "2009-05-19" = { "date" = "2009-05-19" }
+test iso_8601 get "20090519" = { "date" = "20090519" }
+test iso_8601 get "2009123" = { "date" = "2009123" }
+test iso_8601 get "2009-05" = { "date" = "2009-05" }
+test iso_8601 get "2009-123" = { "date" = "2009-123" }
+test iso_8601 get "2009-222" = { "date" = "2009-222" }
+test iso_8601 get "2009-001" = { "date" = "2009-001" }
+test iso_8601 get "2009-W01-1" = { "date" = "2009-W01-1" }
+test iso_8601 get "2009-W51-1" = { "date" = "2009-W51-1" }
+test iso_8601 get "2009-W511" = { "date" = "2009-W511" }
+test iso_8601 get "2009-W33" = { "date" = "2009-W33" }
+test iso_8601 get "2009W511" = { "date" = "2009W511" }
+test iso_8601 get "2009-05-19" = { "date" = "2009-05-19" }
+test iso_8601 get "2009-05-19 00:00" = { "date" = "2009-05-19 00:00" }
+test iso_8601 get "2009-05-19 14" = { "date" = "2009-05-19 14" }
+test iso_8601 get "2009-05-19 14:31" = { "date" = "2009-05-19 14:31" }
+test iso_8601 get "2009-05-19 14:39:22" = { "date" = "2009-05-19 14:39:22" }
+test iso_8601 get "2009-05-19T14:39Z" = { "date" = "2009-05-19T14:39Z" }
+test iso_8601 get "2009-W21-2" = { "date" = "2009-W21-2" }
+test iso_8601 get "2009-W21-2T01:22" = { "date" = "2009-W21-2T01:22" }
+test iso_8601 get "2009-139" = { "date" = "2009-139" }
+test iso_8601 get "2009-05-19 14:39:22-06:00" = { "date" = "2009-05-19 14:39:22-06:00" }
+test iso_8601 get "2009-05-19 14:39:22+0600" = { "date" = "2009-05-19 14:39:22+0600" }
+test iso_8601 get "2009-05-19 14:39:22-01" = { "date" = "2009-05-19 14:39:22-01" }
+test iso_8601 get "20090621T0545Z" = { "date" = "20090621T0545Z" }
+test iso_8601 get "2007-04-06T00:00" = { "date" = "2007-04-06T00:00" }
+test iso_8601 get "2007-04-05T24:00" = { "date" = "2007-04-05T24:00" }
+test iso_8601 get "2010-02-18T16:23:48.5" = { "date" = "2010-02-18T16:23:48.5" }
+test iso_8601 get "2010-02-18T16:23:48,444" = { "date" = "2010-02-18T16:23:48,444" }
+test iso_8601 get "2010-02-18T16:23:48,3-06:00" = { "date" = "2010-02-18T16:23:48,3-06:00" }
+test iso_8601 get "2010-02-18T16:23.4" = { "date" = "2010-02-18T16:23.4" }
+test iso_8601 get "2010-02-18T16:23,25" = { "date" = "2010-02-18T16:23,25" }
+test iso_8601 get "2010-02-18T16:23.33+0600" = { "date" = "2010-02-18T16:23.33+0600" }
+test iso_8601 get "2010-02-18T16.23334444" = { "date" = "2010-02-18T16.23334444" }
+test iso_8601 get "2010-02-18T16,2283" = { "date" = "2010-02-18T16,2283" }
+test iso_8601 get "2009-05-19 143922.500" = { "date" = "2009-05-19 143922.500" }
+test iso_8601 get "2009-05-19 1439,55" = { "date" = "2009-05-19 1439,55" }
index f79b80a..fc96a1c 100644 (file)
@@ -42,15 +42,15 @@ module Test_samba =
 "
 
    test Samba.lns get conf =
-      { "#comment" }
+      {}
       { "#comment" = "Sample configuration file for the Samba suite for Debian GNU/Linux." }
-      { "#comment" }
-      { "#comment" }
+      {}
+      {}
       { "#comment" = "This is the main Samba configuration file. You should read the" }
       { "#comment" = "smb.conf(5) manual page in order to understand the options listed" }
       { "#comment" = "here. Samba has a huge number of configurable options most of which" }
       { "#comment" = "are not shown in this example" }
-      { "#comment" }
+      {}
       {}
       { "#comment" = "======================= Global Settings =======================" }
       {}
@@ -85,3 +85,19 @@ module Test_samba =
     test Samba.lns get "[test]\ncrazy:entry = foo\n" =
          { "target" = "test"
             {"crazy:entry" = "foo"}}
+
+    (* Test complex idmap commands with asterisk in key name, ticket #354 *)
+    test Samba.lns get "[test]
+  idmap backend = tdb
+  idmap uid = 1000000-1999999
+  idmap gid = 1000000-1999999
+
+  idmap config CORP : backend  = ad
+  idmap config * : range = 1000-999999\n" =
+      { "target" = "test"
+        { "idmap backend" = "tdb" }
+        { "idmap uid" = "1000000-1999999" }
+        { "idmap gid" = "1000000-1999999" }
+        {  }
+        { "idmap config CORP : backend" = "ad" }
+        { "idmap config * : range" = "1000-999999" } }
index a765e00..28725fe 100644 (file)
@@ -72,3 +72,17 @@ z39.50               210/tcp         z3950 wais      # NISO Z39.50 database \n"
   test Services.lns put "tcpmux          1/tcp # some comment\n"
     after rm "/service-name/#comment" = "tcpmux          1/tcp\n"
 
+  (* On AIX, port ranges are valid *)
+  test Services.lns get "x11                      6000-6063/tcp  # X Window System\n" =
+    { "service-name" = "x11"
+      { "start" = "6000" }
+      { "end" = "6063" }
+      { "protocol" = "tcp" }
+      { "#comment" = "X Window System" } }
+
+  (* Colons permitted in service names, RHBZ#1121263 *)
+  test Services.lns get "SWRPC.ACCESS.BSS:BS_rmq  48102/tcp  # SWIFTAlliance_SWRPC ACCESS\n" =
+    { "service-name" = "SWRPC.ACCESS.BSS:BS_rmq"
+      { "port" = "48102" }
+      { "protocol" = "tcp" }
+      { "#comment" = "SWIFTAlliance_SWRPC ACCESS" } }
diff --git a/lenses/tests/test_shadow.aug b/lenses/tests/test_shadow.aug
new file mode 100644 (file)
index 0000000..44b5a94
--- /dev/null
@@ -0,0 +1,45 @@
+module Test_Shadow =
+
+let conf = "root:x:0:0:999999:7:::
+libuuid:*:0:0:0::::
+expired:$6$INVALID:0:0:0:::100:
+locked:!$6$INVALID:0:0:0::::
+"
+
+test Shadow.lns get conf =
+  { "root"
+    { "password" = "x" }
+    { "lastchange_date" = "0" }
+    { "minage_days" = "0" }
+    { "maxage_days" = "999999" }
+    { "warn_days" = "7" }
+    { "inactive_days" = "" }
+    { "expire_date" = "" }
+    { "flag" = "" } }
+  { "libuuid"
+    { "password" = "*" }
+    { "lastchange_date" = "0" }
+    { "minage_days" = "0" }
+    { "maxage_days" = "0" }
+    { "warn_days" = "" }
+    { "inactive_days" = "" }
+    { "expire_date" = "" }
+    { "flag" = "" } }
+  { "expired"
+    { "password" = "$6$INVALID" }
+    { "lastchange_date" = "0" }
+    { "minage_days" = "0" }
+    { "maxage_days" = "0" }
+    { "warn_days" = "" }
+    { "inactive_days" = "" }
+    { "expire_date" = "100" }
+    { "flag" = "" } }
+  { "locked"
+    { "password" = "!$6$INVALID" }
+    { "lastchange_date" = "0" }
+    { "minage_days" = "0" }
+    { "maxage_days" = "0" }
+    { "warn_days" = "" }
+    { "inactive_days" = "" }
+    { "expire_date" = "" }
+    { "flag" = "" } }
index 5dceca3..ff81c4a 100644 (file)
@@ -6,6 +6,7 @@ module Test_shells =
 
 /bin/bash
 /bin/tcsh
+/opt/csw/bin/bash   # CSWbash
 "
 
    test Shells.lns get conf =
@@ -13,3 +14,5 @@ module Test_shells =
       {}
       { "1" = "/bin/bash" }
       { "2" = "/bin/tcsh" }
+      { "3" = "/opt/csw/bin/bash"
+        { "#comment" = "CSWbash" } }
index 19affe2..42fc2bd 100644 (file)
@@ -1,6 +1,8 @@
 (* Test for shell lens *)
 module Test_shellvars =
 
+  let lns = Shellvars.lns
+
   let eth_static = "# Intel Corporation PRO/100 VE Network Connection
 DEVICE=eth0
 BOOTPROTO=static
@@ -16,7 +18,7 @@ unset ONBOOT    #   We do not want this var
 
   let key_brack = "SOME_KEY[1]=\nDEVICE=eth0\n"
 
-  test Shellvars.lns get eth_static =
+  test lns get eth_static =
     { "#comment" = "Intel Corporation PRO/100 VE Network Connection" }
     { "DEVICE" = "eth0" }
     { "BOOTPROTO" = "static" }
@@ -28,10 +30,11 @@ unset ONBOOT    #   We do not want this var
     { "#comment" = "DHCP_HOSTNAME=host.example.com" }
     { "NETMASK" = "255.255.255.0" }
     { "NETWORK" = "172.31.0.0" }
-    { "@unset"   = "ONBOOT"
+    { "@unset"
+        { "1" = "ONBOOT" }
         { "#comment" = "We do not want this var" } }
 
-  test Shellvars.lns put eth_static after
+  test lns put eth_static after
       set "BOOTPROTO" "dhcp" ;
       rm "IPADDR" ;
       rm "BROADCAST" ;
@@ -44,110 +47,135 @@ HWADDR=ab:cd:ef:12:34:56
 #DHCP_HOSTNAME=host.example.com
 unset ONBOOT    #   We do not want this var
 "
-  test Shellvars.lns get empty_val =
+  test lns get empty_val =
     { "EMPTY" = "" } { "DEVICE" = "eth0" }
 
-  test Shellvars.lns get key_brack =
+  test lns get key_brack =
     { "SOME_KEY[1]" = "" } { "DEVICE" = "eth0" }
 
-  test Shellvars.lns get "smartd_opts=\"-q never\"\n" =
+  test lns get "smartd_opts=\"-q never\"\n" =
     { "smartd_opts" = "\"-q never\"" }
 
-  test Shellvars.lns get "var=val  \n" = { "var" = "val" }
+  test lns get "var=val  \n" = { "var" = "val" }
 
-  test Shellvars.lns get ". /etc/java/java.conf\n" =
+  test lns get ". /etc/java/java.conf\n" =
     { ".source" = "/etc/java/java.conf" }
 
   (* Quoted strings and other oddities *)
-  test Shellvars.lns get "var=\"foo 'bar'\"\n" =
+  test lns get "var=\"foo 'bar'\"\n" =
     { "var" = "\"foo 'bar'\"" }
 
-  test Shellvars.lns get "var='Some \"funny\" value'\n" =
+  test lns get "var='Some \"funny\" value'\n" =
     { "var" = "'Some \"funny\" value'" }
 
-  test Shellvars.lns get "var=\"\\\"\"\n" =
+  test lns get "var=\"\\\"\"\n" =
     { "var" = "\"\\\"\"" }
 
-  test Shellvars.lns get "var=\\\"\n" =
+  test lns get "var=\\\"\n" =
     { "var" = "\\\"" }
 
-  test Shellvars.lns get "var=ab#c\n" =
+  test lns get "var=ab#c\n" =
+    { "var" = "ab#c" }
+
+  test lns get "var=ab #c\n" =
     { "var" = "ab"
-        { "#comment" = "c" } }
+      { "#comment" = "c" } }
+
+  test lns get "var=ab; #c\n" =
+    { "var" = "ab" }
+    { "#comment" = "c" }
+
+  test lns put "var=ab; #c\n" after
+    set "/#comment" "d" =
+    "var=ab; #d\n"
 
-  test Shellvars.lns get "var='ab#c'\n" =
+  test lns get "var=ab;\n" =
+    { "var" = "ab" }
+
+  test lns get "var='ab#c'\n" =
     { "var" = "'ab#c'" }
 
-  test Shellvars.lns get "var=\"ab#c\"\n" =
+  test lns get "var=\"ab#c\"\n" =
     { "var" = "\"ab#c\"" }
 
-  (* For some reason, `` conflicts with comment_eol *)
-  test Shellvars.lns get "var=`ab#c`\n" =
-    { "var" = "`ab"
-       { "#comment" = "c`" } }
+  test lns get "ESSID='Joe'\"'\"'s net'\n" =
+    { "ESSID" = "'Joe'\"'\"'s net'" }
+
+  test lns get "var=`ab#c`\n" =
+    { "var" = "`ab#c`" }
 
-  test Shellvars.lns get "var=`grep nameserver /etc/resolv.conf | head -1`\n" =
+  test lns get "var=`grep nameserver /etc/resolv.conf | head -1`\n" =
     { "var" = "`grep nameserver /etc/resolv.conf | head -1`" }
 
-  test Shellvars.lns put "var=ab #c\n"
+  test lns put "var=ab #c\n"
     after rm "/var/#comment" = "var=ab\n"
 
-  test Shellvars.lns put "var=ab\n"
+  test lns put "var=ab\n"
     after set "/var/#comment" "this is a var" =
        "var=ab # this is a var\n"
 
   (* Handling of arrays *)
-  test Shellvars.lns get "var=(val1 \"val\\\"2\\\"\" val3)\n" =
+  test lns get "var=(val1 \"val\\\"2\\\"\" val3)\n" =
     { "var"
         { "1" = "val1" }
         { "2" = "\"val\\\"2\\\"\"" }
         { "3" = "val3" } }
 
-  test Shellvars.lns get "var=()\n" = { "var" = "()" }
+  test lns get "var=()\n" = { "var" = "()" }
 
-  test Shellvars.lns put "var=()\n" after
+  test lns put "var=()\n" after
       set "var" "value"
   = "var=value\n"
 
-  test Shellvars.lns put "var=(v1 v2)\n" after
+  test lns put "var=(v1 v2)\n" after
       rm "var/*" ;
       set "var" "value"
   = "var=value\n"
 
-  test Shellvars.lns put "var=(v1 v2)\n" after
+  test lns put "var=(v1 v2)\n" after
     set "var/3" "v3"
   = "var=(v1 v2 v3)\n"
 
-  test Shellvars.lns get "var=(v1 v2   \n    \t v3)\n" =
+  test lns get "var=(v1 v2   \n    \t v3)\n" =
   { "var"
     { "1" = "v1" }
     { "2" = "v2" }
     { "3" = "v3" } }
 
   (* Allow spaces after/before opening/closing parens for array *)
-  test Shellvars.lns get "config_eth1=( \"10.128.0.48/24\" )\n" =
+  test lns get "config_eth1=( \"10.128.0.48/24\" )\n" =
   { "config_eth1"  { "1" = "\"10.128.0.48/24\"" } }
 
   (* Bug 109: allow a bare export *)
-  test Shellvars.lns get "export FOO\n" =
-  { "@export" = "FOO" }
+  test lns get "export FOO\n" =
+  { "@export"
+    { "1" = "FOO" } }
 
   (* Bug 73: allow ulimit builtin *)
-  test Shellvars.lns get "ulimit -c unlimited\n" =
+  test lns get "ulimit -c unlimited\n" =
   { "@builtin" = "ulimit" { "args" = "-c unlimited" } }
 
+  (* Allow shift builtin *)
+  test Shellvars.lns get "shift\nshift 2\n" =
+  { "@builtin" = "shift" }
+  { "@builtin" = "shift" { "args" = "2" } }
+
+  (* Allow exit builtin *)
+  test Shellvars.lns get "exit\nexit 2\n" =
+  { "@builtin" = "exit" }
+  { "@builtin" = "exit" { "args" = "2" } }
 
   (* Test semicolons *)
-  test Shellvars.lns get "VAR1=\"this;is;a;test\"\nVAR2=this;\n" =
+  test lns get "VAR1=\"this;is;a;test\"\nVAR2=this;\n" =
   { "VAR1" = "\"this;is;a;test\"" }
   { "VAR2" = "this" }
 
   (* Bug 230: parse conditions *)
-  test Shellvars.lns get "if [ -f /etc/default/keyboard ]; then\n. /etc/default/keyboard\nfi\n" =
+  test lns get "if [ -f /etc/default/keyboard ]; then\n. /etc/default/keyboard\nfi\n" =
   { "@if" = "[ -f /etc/default/keyboard ]" { ".source" = "/etc/default/keyboard" } }
 
   (* Recursive condition *)
-  test Shellvars.lns get "if [ -f /tmp/file1 ]; then
+  test lns get "if [ -f /tmp/file1 ]; then
   if [ -f /tmp/file2 ]
   then
     . /tmp/file2
@@ -171,14 +199,33 @@ fi\n" =
     }
   }
 
+  (* Multiple elif *)
+  test Shellvars.lns get "if [ -f /tmp/file1 ]; then
+  . /tmp/file1
+  elif [ -f /tmp/file2 ]; then
+  . /tmp/file2
+  elif [ -f /tmp/file3 ]; then
+  . /tmp/file3
+  fi\n" =
+  { "@if" = "[ -f /tmp/file1 ]"
+    { ".source" = "/tmp/file1" }
+    { "@elif" = "[ -f /tmp/file2 ]"
+      { ".source" = "/tmp/file2" }
+    }
+    { "@elif" = "[ -f /tmp/file3 ]"
+      { ".source" = "/tmp/file3" }
+    }
+  }
+
+
   (* Comment or eol *)
-  test Shellvars.lns get "VAR=value # eol-comment\n" =
+  test lns get "VAR=value # eol-comment\n" =
   { "VAR" = "value"
     { "#comment" = "eol-comment" }
   }
 
   (* One-liners *)
-  test Shellvars.lns get "if [ -f /tmp/file1 ]; then . /tmp/file1; else . /tmp/file2; fi\n" =
+  test lns get "if [ -f /tmp/file1 ]; then . /tmp/file1; else . /tmp/file2; fi\n" =
   { "@if" = "[ -f /tmp/file1 ]"
     { ".source" = "/tmp/file1" }
     { "@else"
@@ -187,7 +234,7 @@ fi\n" =
   }
 
   (* Loops *)
-  test Shellvars.lns get "for f in /tmp/file*; do
+  test lns get "for f in /tmp/file*; do
   while [ 1 ]; do . $f; done
 done\n" =
   { "@for" = "f in /tmp/file*"
@@ -197,7 +244,7 @@ done\n" =
   }
 
   (* Case *)
-  test Shellvars.lns get "case $f in
+  test lns get "case $f in
   /tmp/file1)
     . /tmp/file1
     ;;
@@ -214,15 +261,234 @@ esac\n" =
     { "@case_entry" = "/tmp/file2"
       { ".source" = "/tmp/file2" } }
     { "@case_entry" = "*"
-      { "@unset" = "f" } } }
+      { "@unset"
+        { "1" = "f" } } } }
 
   (* Select *)
-  test Shellvars.lns get "select i in a b c; do . /tmp/file$i
+  test lns get "select i in a b c; do . /tmp/file$i
    done\n" =
   { "@select" = "i in a b c"
     { ".source" = "/tmp/file$i" }
   }
 
+  (* Return *)
+  test lns get "return\nreturn 2\n" =
+  { "@return" }
+  { "@return" = "2" }
+
+  (* Functions *)
+  test Shellvars.lns get "foo() {
+  . /tmp/bar
+  }\n" =
+  { "@function" = "foo"
+    { ".source" = "/tmp/bar" }
+  }
+
+  test Shellvars.lns get "function foo () {
+  . /tmp/bar
+  }\n" =
+  { "@function" = "foo"
+    { ".source" = "/tmp/bar" }
+  }
+
+  (* Dollar assignment *)
+  test Shellvars.lns get "FOO=$(bar arg)\n" =
+  { "FOO" = "$(bar arg)" }
+
+  (* Empty lines before esac *)
+  test Shellvars.lns get "case $f in
+  a)
+    B=C
+    ;;
+
+  esac\n" =
+  { "@case" = "$f"
+    { "@case_entry" = "a"
+      { "B" = "C" } }
+    }
+
+
+  (* Empty lines before a case_entry *)
+  test Shellvars.lns get "case $f in
+
+  a)
+    B=C
+    ;;
+
+  b)
+    A=D
+    ;;
+  esac\n" =
+  { "@case" = "$f"
+    { "@case_entry" = "a"
+      { "B" = "C" } }
+    { "@case_entry" = "b"
+      { "A" = "D" } } }
+
+
+  (* Comments anywhere *)
+  test Shellvars.lns get "case ${INTERFACE} in
+# comment before
+eth0)
+# comment in
+OPTIONS=()
+;;
+
+# comment before 2
+*)
+# comment in 2
+unset f
+;;
+# comment after
+esac\n" =
+  { "@case" = "${INTERFACE}"
+    { "#comment" = "comment before" }
+    { "@case_entry" = "eth0"
+      { "#comment" = "comment in" }
+      { "OPTIONS" = "()" } }
+    { "#comment" = "comment before 2" }
+    { "@case_entry" = "*"
+      { "#comment" = "comment in 2" }
+      { "@unset"
+        { "1" = "f" } } }
+    { "#comment" = "comment after" } }
+
+  (* Empty case *)
+  test Shellvars.lns get "case $a in
+  *)
+  ;;
+  esac\n" =
+  { "@case" = "$a"
+    { "@case_entry" = "*" } }
+
+  (* case variables can be surrounded by double quotes *)
+  test Shellvars.lns get "case \"${options}\" in
+*debug*)
+  shift
+  ;;
+esac\n" =
+  { "@case" = "\"${options}\""
+    { "@case_entry" = "*debug*"
+      { "@builtin" = "shift" } } }
+
+  (* Double quoted values can have newlines *)
+  test Shellvars.lns get "FOO=\"123\n456\"\n" =
+  { "FOO" = "\"123\n456\"" }
+
+  (* Single quoted values can have newlines *)
+  test Shellvars.lns get "FOO='123\n456'\n" =
+  { "FOO" = "'123\n456'" }
+
+  (* bquoted values can have semi-colons *)
+  test Shellvars.lns get "FOO=`bar=date;$bar`\n" =
+  { "FOO" = "`bar=date;$bar`" }
+
+  (* dollar-assigned values can have semi-colons *)
+  test Shellvars.lns get "FOO=$(bar=date;$bar)\n" =
+  { "FOO" = "$(bar=date;$bar)" }
+
+  (* dollar-assigned value in bquot *)
+  test Shellvars.lns get "FOO=`echo $(date)`\n" =
+  { "FOO" = "`echo $(date)`" }
+
+  (* bquot value in dollar-assigned value *)
+  test Shellvars.lns get "FOO=$(echo `date`)\n" =
+  { "FOO" = "$(echo `date`)" }
+
+  (* dbquot *)
+  test Shellvars.lns get "FOO=``bar``\n" =
+  { "FOO" = "``bar``" }
+
+  (* unset can be used on wildcard variables *)
+  test Shellvars.lns get "unset ${!LC_*}\n" =
+  { "@unset"
+    { "1" = "${!LC_*}" } }
+
+  (* Empty comment before entries *)
+  test Shellvars.lns get "# \nfoo=bar\n" =
+  { }
+  { "foo" = "bar" }
+
+  (* Empty comment after entries *)
+  test Shellvars.lns get "foo=bar\n# \n\n" =
+  { "foo" = "bar" }
+
+  (* Whitespace between lines *)
+  test Shellvars.lns get "DEVICE=eth0\n\nBOOTPROTO=static\n" =
+    { "DEVICE" = "eth0" }
+    { "BOOTPROTO" = "static" }
+
+  (* Whitespace after line *)
+  test Shellvars.lns get "DEVICE=eth0\n\n" =
+    { "DEVICE" = "eth0" }
+
+  (* Fails adding variable assignment between comment and blank line *)
+  let ins_after_comment = "# foo
+
+"
+  test lns put ins_after_comment after
+      insa "foo" "#comment" ;
+      set "foo" "yes"
+  = "# foo\n\nfoo=yes\n"
+
+  (* Make sure to support empty comments *)
+  test lns get "# foo
+  # 
+  #
+  foo=bar
+  #\n" =
+    { "#comment" = "foo" }
+    { "foo" = "bar" }
+
+  (* Single quotes in arrays, ticket #357 *)
+  test lns get "DLAGENTS=('ftp::/usr/bin/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
+          'scp::/usr/bin/scp -C %u %o')\n" =
+    { "DLAGENTS"
+      { "1" = "'ftp::/usr/bin/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'" }
+      { "2" = "'scp::/usr/bin/scp -C %u %o'" } }
+
+  (* Accept continued lines in quoted values *)
+  test lns get "BLAH=\" \
+test \
+test2\"\n" =
+  { "BLAH" = "\" \\\ntest \\\ntest2\"" }
+
+  (* Export of multiple variables, RHBZ#1033795 *)
+  test lns get "export TestVar1 TestVar2\n" =
+    { "@export"
+      { "1" = "TestVar1" }
+      { "2" = "TestVar2" } }
+
+  (* Support ;; on same line as a case statement entry, RHBZ#1033799 *)
+  test lns get "case $ARG in
+        0) TestVar=\"test0\" ;;
+        1) TestVar=\"test1\" ;;
+esac\n" =
+    { "@case" = "$ARG"
+      { "@case_entry" = "0"
+        { "TestVar" = "\"test0\"" } }
+      { "@case_entry" = "1"
+        { "TestVar" = "\"test1\"" } } }
+
+(* Test: Shellvars.lns
+     Support `##` bashism in conditions (GH issue #118) *)
+test Shellvars.lns get "if [ \"${APACHE_CONFDIR##/etc/apache2-}\" != \"${APACHE_CONFDIR}\" ] ; then
+    SUFFIX=\"-${APACHE_CONFDIR##/etc/apache2-}\"
+else
+    SUFFIX=
+fi\n" =
+  { "@if" = "[ \"${APACHE_CONFDIR##/etc/apache2-}\" != \"${APACHE_CONFDIR}\" ]"
+    { "SUFFIX" = "\"-${APACHE_CONFDIR##/etc/apache2-}\"" }
+    { "@else"
+      { "SUFFIX" = "" }
+    }
+  }
+
+  (* Support $(( .. )) arithmetic expansion in variable assignment, RHBZ#1100550 *)
+  test lns get "export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))\n" =
+    { "MALLOC_PERTURB_" = "$(($RANDOM % 255 + 1))"
+      { "export" } }
+
 (* Local Variables: *)
 (* mode: caml       *)
 (* End:             *)
index 5bc09e0..8cd9dd4 100644 (file)
@@ -114,6 +114,20 @@ FAILSAVE_APPEND=\"console=ttyS0\"
     set "VAR/value[1]" "test"
     = "VAR=test\n"
 
+  (* Ticket #368 - backticks *)
+  test Shellvars_list.lns get "GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`\n" =
+    { "GRUB_DISTRIBUTOR"
+      { "quote" = "" }
+      { "value" = "`lsb_release -i -s 2> /dev/null || echo Debian`" } }
+
+  (* Test: Shellvars_list.lns
+       Ticket #342: end-of-line comments *)
+  test Shellvars_list.lns get "service_ping=\"ping/icmp\" #ping\n" =
+    { "service_ping"
+      { "quote" = "\"" }
+      { "value" = "ping/icmp" }
+      { "#comment" = "ping" } }
+
 (* Local Variables: *)
 (* mode: caml       *)
 (* End:             *)
diff --git a/lenses/tests/test_simplelines.aug b/lenses/tests/test_simplelines.aug
new file mode 100644 (file)
index 0000000..90bd9de
--- /dev/null
@@ -0,0 +1,42 @@
+(*
+Module: Test_Simplelines
+  Provides unit tests and examples for the <Simplelines> lens.
+*)
+
+module Test_Simplelines =
+
+(* Variable: conf *)
+let conf = "# This is a comment
+
+word
+a line
+  indented line
+with $péci@l cH@r2ct3rs
+"
+
+(* Test: Simplelines.lns *)
+test Simplelines.lns get conf =
+   { "#comment" = "This is a comment" }
+   { }
+   { "1" = "word" }
+   { "2" = "a line" }
+   { "3" = "indented line" }
+   { "4" = "with $péci@l cH@r2ct3rs" }
+
+(* Variable: cronallow *)
+  let cronallow = "# Test comment
+#
+user1
+another
+
+user2
+"
+
+(* Test: cron.allow file *)
+  test SimpleLines.lns get cronallow =
+    { "#comment" = "Test comment" }
+    { }
+    { "1" = "user1" }
+    { "2" = "another" }
+    { }
+    { "3" = "user2" }
diff --git a/lenses/tests/test_simplevars.aug b/lenses/tests/test_simplevars.aug
new file mode 100644 (file)
index 0000000..1d1ad00
--- /dev/null
@@ -0,0 +1,36 @@
+(*
+Module: Test_Simplevars
+  Provides unit tests and examples for the <Simplevars> lens.
+*)
+
+module Test_Simplevars =
+
+(* Variable: conf *)
+let conf = "# this is a comment
+
+mykey = myvalue # eol comment
+anotherkey = another value
+"
+
+(* Test: Simplevars.lns *)
+test Simplevars.lns get conf =
+   { "#comment" = "this is a comment" }
+   { }
+   { "mykey" = "myvalue"
+     { "#comment" = "eol comment" } }
+   { "anotherkey" = "another value" }
+
+(* Test: Simplevars.lns
+   Quotes are OK in variables that do not begin with a quote *)
+test Simplevars.lns get "UserParameter=custom.vfs.dev.read.ops[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$4}'\n" =
+     { "UserParameter" = "custom.vfs.dev.read.ops[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$4}'" }
+
+(* Test: Simplevars.lns
+    Support flags *)
+test Simplevars.lns get "dnsadminapp\n" =
+  { "dnsadminapp" }
+
+(* Test: Simplevars.lns
+     Support empty values *)
+test Simplevars.lns get "foo =\n" =
+  { "foo" = "" { } }
diff --git a/lenses/tests/test_sip_conf.aug b/lenses/tests/test_sip_conf.aug
new file mode 100644 (file)
index 0000000..bd1faf1
--- /dev/null
@@ -0,0 +1,113 @@
+module Test_sip_conf =
+
+let conf = "[general]
+context=default                 ; Default context for incoming calls
+udpbindaddr=0.0.0.0             ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
+; The address family of the bound UDP address is used to determine how Asterisk performs
+; DNS lookups. In cases a) and c) above, only A records are considered. In case b), only
+; AAAA records are considered. In case d), both A and AAAA records are considered. Note,
+
+
+[basic-options-title](!,superclass-template);a template for my preferred codecs !@#$%#@$%^^&%%^*&$%
+        #comment after the title
+        dtmfmode=rfc2833
+        context=from-office
+        type=friend
+
+
+[my-codecs](!)                    ; a template for my preferred codecs
+        disallow=all
+        allow=ilbc
+        allow=g729
+        allow=gsm
+        allow=g723
+        allow=ulaw
+
+[2133](natted-phone,my-codecs) ;;;;; some sort of comment
+       secret = peekaboo
+[2134](natted-phone,ulaw-phone)
+       secret = not_very_secret
+[2136](public-phone,ulaw-phone)
+       secret = not_very_secret_either
+"
+
+test Sip_Conf.lns get conf =
+  { "title" = "general"
+    { "context" = "default"
+      { "#comment" = "Default context for incoming calls" }
+    }
+    { "udpbindaddr" = "0.0.0.0"
+      { "#comment" = "IP address to bind UDP listen socket to (0.0.0.0 binds to all)" }
+    }
+    { "#comment" = "The address family of the bound UDP address is used to determine how Asterisk performs" }
+    { "#comment" = "DNS lookups. In cases a) and c) above, only A records are considered. In case b), only" }
+    { "#comment" = "AAAA records are considered. In case d), both A and AAAA records are considered. Note," }
+    {  }
+    {  }
+  }
+  { "title" = "basic-options-title"
+    { "@is_template" }
+    { "@use_template" = "superclass-template" }
+    { "#title_comment" = ";a template for my preferred codecs !@#$%#@$%^^&%%^*&$%" }
+    { "#comment" = "comment after the title" }
+    { "dtmfmode" = "rfc2833" }
+    { "context" = "from-office" }
+    { "type" = "friend" }
+    {  }
+    {  }
+  }
+  { "title" = "my-codecs"
+    { "@is_template" }
+    { "#title_comment" = "                    ; a template for my preferred codecs" }
+    { "disallow" = "all" }
+    { "allow" = "ilbc" }
+    { "allow" = "g729" }
+    { "allow" = "gsm" }
+    { "allow" = "g723" }
+    { "allow" = "ulaw" }
+    {  }
+  }
+  { "title" = "2133"
+    { "@use_template" = "natted-phone" }
+    { "@use_template" = "my-codecs" }
+    { "#title_comment" = " ;;;;; some sort of comment" }
+    { "secret" = "peekaboo" }
+  }
+  { "title" = "2134"
+    { "@use_template" = "natted-phone" }
+    { "@use_template" = "ulaw-phone" }
+    { "secret" = "not_very_secret" }
+  }
+  { "title" = "2136"
+    { "@use_template" = "public-phone" }
+    { "@use_template" = "ulaw-phone" }
+    { "secret" = "not_very_secret_either" }
+  }
+
+  (*********************************************
+  * Tests for update, create, delete
+  *
+  *********************************************)
+  
+  (*********************************************
+  * Test to confirm that we can update the
+  * default context
+  *
+  *********************************************)
+  test Sip_Conf.lns put "[general]\ncontext=default\n" after
+      set "title[.='general']/context" "updated"
+  = "[general]\ncontext=updated
+"
+
+  (*********************************************
+  * Test to confirm that we can create a
+  * new title with a context
+  *
+  *********************************************)
+  test Sip_Conf.lns put "[general]\ncontext=default\n" after
+      set "/title[.='newtitle']" "newtitle"; set "/title[.='newtitle']/context" "foobarbaz"
+  = "[general]\ncontext=default
+[newtitle]
+context=foobarbaz
+"
+
index e477342..a4bbb4e 100644 (file)
@@ -48,18 +48,47 @@ test Slapd.lns get conf =
   { "database" = "hdb"
      {}
      { "#comment" = "The base of your directory in database #1" }
-     { "suffix"   = "\"dc=nodomain\"" }
+     { "suffix"   = "dc=nodomain" }
      {}
      { "access to" = "attrs=userPassword,shadowLastChange"
-        { "by"
-           { "who" = "dn=\"cn=admin,dc=nodomain\"" }
-           { "what" = "write" } }
-        { "by"
-           { "who" = "anonymous" }
-           { "what" = "auth" } }
-        { "by"
-           { "who" = "self" }
-           { "what" = "write" } }
-        { "by"
-           { "who" = "*" }
-           { "what" = "none" } } } }
+        { "by" = "dn=\"cn=admin,dc=nodomain\""
+           { "access" = "write" } }
+        { "by" = "anonymous"
+           { "access" = "auth" } }
+        { "by" = "self"
+           { "access" = "write" } }
+        { "by" = "*"
+           { "access" = "none" } } } }
+
+(* Test: Slapd.lns
+     Full access test with who/access/control *)
+test Slapd.lns get "access to dn.subtree=\"dc=example,dc=com\"
+  by self write stop\n" =
+  { "access to" = "dn.subtree=\"dc=example,dc=com\""
+    { "by" = "self"
+      { "access" = "write" }
+      { "control" = "stop" } } }
+
+(* Test: Slapd.lns
+     access test with who *)
+test Slapd.lns get "access to dn.subtree=\"dc=example,dc=com\"
+  by self\n" =
+  { "access to" = "dn.subtree=\"dc=example,dc=com\""
+    { "by" = "self" } }
+
+(* Test: Slapd.lns
+     access test with who/access *)
+test Slapd.lns get "access to dn.subtree=\"dc=example,dc=com\"
+  by self write\n" =
+  { "access to" = "dn.subtree=\"dc=example,dc=com\""
+    { "by" = "self"
+      { "access" = "write" } } }
+
+(* Test: Slapd.lns
+     access test with who/control *)
+test Slapd.lns get "access to dn.subtree=\"dc=example,dc=com\"
+  by self stop\n" =
+  { "access to" = "dn.subtree=\"dc=example,dc=com\""
+    { "by" = "self"
+      { "control" = "stop" } } }
+
diff --git a/lenses/tests/test_smbusers.aug b/lenses/tests/test_smbusers.aug
new file mode 100644 (file)
index 0000000..a4c8371
--- /dev/null
@@ -0,0 +1,29 @@
+(*
+Module: Test_SmbUsers
+  Provides unit tests and examples for the <SmbUsers> lens.
+*)
+
+module Test_SmbUsers =
+
+(* Variable: conf *)
+let conf = "# this is a comment
+
+jarwin = JosephArwin
+manderso = MarkAnderson MarkusAndersonus
+users = @account
+nobody = *
+"
+
+(* Test: Simplevars.lns *)
+test SmbUsers.lns get conf =
+   { "#comment" = "this is a comment" }
+   { }
+   { "jarwin"
+     { "username" = "JosephArwin" } }
+   { "manderso"
+     { "username" = "MarkAnderson" }
+     { "username" = "MarkusAndersonus" } }
+   { "users"
+     { "username" = "@account" } }
+   { "nobody"
+     { "username" = "*" } }
diff --git a/lenses/tests/test_splunk.aug b/lenses/tests/test_splunk.aug
new file mode 100644 (file)
index 0000000..fc240d6
--- /dev/null
@@ -0,0 +1,158 @@
+(**
+ *
+ * This module is used to test the Splunk module for valid extractions.
+ * Written by Tim Brigham.
+ * This file is licensed under the LGPLv2+, like the rest of Augeas.
+ **)
+
+module Test_splunk =
+
+(** inputs.conf **)
+
+   let inputs = "[default]
+host = splunk-node-1.example.com
+enable_autocomplete_login = False
+
+[udp://514]
+connection_host = none
+source = test
+sourcetype = syslog
+
+"
+test Splunk.lns get inputs =
+  { "target" = "default"
+      { "host" = "splunk-node-1.example.com" }
+      { "enable_autocomplete_login" = "False" }
+  {}}
+  { "target" = "udp://514"
+      { "connection_host" = "none" }
+      { "source" = "test" }
+      { "sourcetype" = "syslog" }
+  {}}
+
+
+(** web.conf **)
+   let web = "[settings]
+enableSplunkWebSSL = 1
+enable_autocomplete_login = False
+"
+
+
+test Splunk.lns get web =
+  { "target" = "settings"
+      { "enableSplunkWebSSL" = "1" }
+      { "enable_autocomplete_login" = "False" }
+      }
+
+
+
+(** props.conf **)
+
+   let props = "[splunkd_stdout]
+PREFIX_SOURCETYPE = False
+SHOULD_LINEMERGE = False
+is_valid = False
+maxDist = 99
+
+"
+
+test Splunk.lns get props =
+  {
+    "target" = "splunkd_stdout"
+             { "PREFIX_SOURCETYPE" = "False" }
+             { "SHOULD_LINEMERGE" = "False" }
+             { "is_valid" = "False" }
+             { "maxDist" = "99" }
+             {}}
+
+(** tenants.conf **)
+   let tenants = "[tenant:default]
+whitelist.0 = *
+"
+
+test Splunk.lns get tenants =
+  { "target" = "tenant:default"
+     { "whitelist.0" = "*" }
+  }
+
+
+
+  let server = "[license]
+active_group = Free
+master_uri = https://myserver.mydomain.com:8089
+
+[general]
+serverName = splunk-node-1
+trustedIP = 127.0.0.1
+guid = XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXXXXXXXX
+
+[sslConfig]
+sslKeysfilePassword = $1$XX2X4XX6XXXXXXXXX
+
+"
+
+test Splunk.lns get server =
+    { "target" = "license"
+        { "active_group" = "Free" }
+        { "master_uri" = "https://myserver.mydomain.com:8089" }
+        {}}
+    { "target" = "general"
+      { "serverName" = "splunk-node-1" }
+      { "trustedIP" = "127.0.0.1" }
+      { "guid" = "XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXXXXXXXX" }
+      {}}
+    { "target" = "sslConfig"
+      { "sslKeysfilePassword" = "$1$XX2X4XX6XXXXXXXXX" }
+      {}}
+
+
+(* test anonymous attributes *)
+let anon = "
+# master
+serverName = splunk-node-1
+
+# slave
+serverName = splunk-node-2
+
+[general]
+serverName = splunk-node-3
+
+"
+
+test Splunk.lns get anon =
+  { ".anon"
+    {  }
+    { "#comment" = "master" }
+    { "serverName" = "splunk-node-1" }
+    {  }
+    { "#comment" = "slave" }
+    { "serverName" = "splunk-node-2" }
+    {  }
+  }
+  { "target" = "general"
+    { "serverName" = "splunk-node-3" }
+    {  }
+  }
+
+
+(* test empty value entry *)
+
+let override = "
+[general]
+# normal entry
+foo = bar
+# override entry
+foo =
+"
+
+test Splunk.lns get override =
+  { ".anon"
+    {  }
+  }
+  { "target" = "general"
+    { "#comment" = "normal entry" }
+    { "foo" = "bar" }
+    { "#comment" = "override entry" }
+    { "foo" }
+  }
+
index 827076f..eb78743 100644 (file)
@@ -1,3 +1,4 @@
+(* Module: Test_ssh *)
 module Test_ssh =
 
     let conf =
@@ -61,3 +62,9 @@ MACs hmac-md5,hmac-sha1,umac-64@openssh.com
            { "3" = "umac-64@openssh.com" }
        }
     }
+
+(* Test: Ssh.lns
+     Proxycommand is case-insensitive *)
+
+test Ssh.lns get "Proxycommand ssh -q test nc -q0 %h 22\n" =
+  { "Proxycommand" = "ssh -q test nc -q0 %h 22" }
index afc74ab..5954e16 100644 (file)
@@ -1,3 +1,4 @@
+(* Module: Test_sshd *)
 module Test_sshd =
 
   let accept_env = "Protocol 2
@@ -37,6 +38,10 @@ HostKey /etc/ssh/ssh_host_dsa_key\n" =
     { "Subsystem"
        { "sftp" = "/usr/lib/openssh/sftp-server" } }
 
+  test Sshd.lns get "Subsystem sftp-test /usr/lib/openssh/sftp-server\n" =
+    { "Subsystem"
+       { "sftp-test" = "/usr/lib/openssh/sftp-server" } }
+
 
 
   let match_blocks = "X11Forwarding yes
@@ -70,6 +75,61 @@ Match User sarko Group pres.*
 Match User bush Group pres.* Host white.house.*
 Banner /etc/welcome.txt\n"
 
+(* Test: Sshd.lns
+   Indent when adding to a Match group *)
+  test Sshd.lns put match_blocks after
+    set "Match[1]/Settings/PermitRootLogin" "yes";
+    set "Match[1]/Settings/#comment" "a comment" =
+"X11Forwarding yes
+Match User sarko Group pres.*
+  Banner /etc/bienvenue.txt
+  X11Forwarding no
+  PermitRootLogin yes
+  # a comment
+Match User bush Group pres.* Host white.house.*
+Banner /etc/welcome.txt\n"
+
+
+(* Test: Sshd.lns
+     Parse Ciphers and KexAlgorithms as lists (GH issue #69) *)
+test Sshd.lns get "Ciphers aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes128-ctr
+KexAlgorithms diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1\n" =
+  { "Ciphers"
+    { "1" = "aes256-gcm@openssh.com" }
+    { "2" = "aes128-gcm@openssh.com" }
+    { "3" = "aes256-ctr" }
+    { "4" = "aes128-ctr" }
+  }
+  { "KexAlgorithms"
+    { "1" = "diffie-hellman-group-exchange-sha256" }
+    { "2" = "diffie-hellman-group14-sha1" }
+    { "3" = "diffie-hellman-group-exchange-sha1" }
+  }
+
+(* Test: Sshd.lns
+     Keys are case-insensitive *)
+test Sshd.lns get "ciPheRs aes256-gcm@openssh.com,aes128-ctr
+maTcH User foo
+  x11forwarding no\n" =
+  { "ciPheRs"
+    { "1" = "aes256-gcm@openssh.com" }
+    { "2" = "aes128-ctr" }
+  }
+  { "maTcH"
+    { "Condition"
+      { "User" = "foo" }
+    }
+    { "Settings"
+      { "x11forwarding" = "no" }
+    }
+  }
+
+(* Test: Sshd.lns
+     Allow AllowGroups in Match groups (GH issue #75) *)
+test Sshd.lns get "Match User foo
+AllowGroups users\n" =
+  { "Match" { "Condition" { "User" = "foo" } }
+    { "Settings" { "AllowGroups" { "1" = "users" } } } }
 
 (* Local Variables: *)
 (* mode: caml       *)
diff --git a/lenses/tests/test_sssd.aug b/lenses/tests/test_sssd.aug
new file mode 100644 (file)
index 0000000..b5ea771
--- /dev/null
@@ -0,0 +1,45 @@
+(*
+Module: Test_sssd
+  Test cases for the sssd lense
+
+Author: Erinn Looney-Triggs
+
+About: License
+  This file is licensed under the LGPLv2+, like the rest of Augeas.
+*)
+module Test_sssd =
+
+let conf = "[domain/example.com]
+#Comment here
+; another comment
+cache_credentials = True
+krb5_store_password_if_offline = True
+ipa_server = _srv_, ipa.example.com
+[sssd]
+services = nss, pam
+config_file_version = 2
+
+domains = example.com
+[nss]
+
+[pam]
+"
+
+test Sssd.lns get conf =
+    { "target" = "domain/example.com" 
+       { "#comment" = "Comment here" }
+       { "#comment" = "another comment" }
+       { "cache_credentials" = "True" }
+       { "krb5_store_password_if_offline" = "True" }
+       { "ipa_server" = "_srv_, ipa.example.com" }
+    }
+    { "target" = "sssd"
+       { "services" = "nss, pam" }
+       { "config_file_version" = "2" }
+       {       }
+       { "domains" = "example.com" }
+    }
+    { "target" = "nss" 
+       {       }
+    }
+    { "target" = "pam" }
diff --git a/lenses/tests/test_subversion.aug b/lenses/tests/test_subversion.aug
new file mode 100644 (file)
index 0000000..0090dad
--- /dev/null
@@ -0,0 +1,118 @@
+(*
+Module: Test_Subversion
+  Provides unit tests and examples for the <Subversion> lens.
+*)
+
+module Test_Subversion =
+
+(* Variable: conf *)
+let conf = "# This file configures various client-side behaviors.
+[auth]
+password-stores = gnome-keyring,kwallet
+store-passwords = no
+store-auth-creds = no
+
+[helpers]
+editor-cmd = /usr/bin/vim
+diff-cmd = /usr/bin/diff
+diff3-cmd = /usr/bin/diff3
+diff3-has-program-arg = yes
+
+[tunnels]
+ssh = $SVN_SSH ssh -o ControlMaster=no
+rsh = /path/to/rsh -l myusername
+
+[miscellany]
+global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo
+   *.rej *~ #*# .#* .*.swp .DS_Store
+# Set log-encoding to the default encoding for log messages
+log-encoding = latin1
+use-commit-times = yes
+no-unlock = yes
+mime-types-file = /path/to/mime.types
+preserved-conflict-file-exts = doc ppt xls od?
+enable-auto-props = yes
+interactive-conflicts = no
+
+[auto-props]
+*.c = svn:eol-style=native
+*.cpp = svn:eol-style=native
+*.h = svn:eol-style=native
+*.dsp = svn:eol-style=CRLF
+*.dsw = svn:eol-style=CRLF
+*.sh = svn:eol-style=native;svn:executable
+*.txt = svn:eol-style=native
+*.png = svn:mime-type=image/png
+*.jpg = svn:mime-type=image/jpeg
+Makefile = svn:eol-style=native
+"
+
+(* Test: Subversion.lns *)
+test Subversion.lns get conf =
+{ "#comment" = "This file configures various client-side behaviors." }
+  { "auth"
+    { "password-stores"
+      { "1" = "gnome-keyring" }
+      { "2" = "kwallet" } }
+    { "store-passwords" = "no" }
+    { "store-auth-creds" = "no" }
+    {  }
+  }
+  { "helpers"
+    { "editor-cmd" = "/usr/bin/vim" }
+    { "diff-cmd" = "/usr/bin/diff" }
+    { "diff3-cmd" = "/usr/bin/diff3" }
+    { "diff3-has-program-arg" = "yes" }
+    {  }
+  }
+  { "tunnels"
+    { "ssh" = "$SVN_SSH ssh -o ControlMaster=no" }
+    { "rsh" = "/path/to/rsh -l myusername" }
+    {  }
+  }
+  { "miscellany"
+    { "global-ignores"
+      { "1" = "*.o" }
+      { "2" = "*.lo" }
+      { "3" = "*.la" }
+      { "4" = "*.al" }
+      { "5" = ".libs" }
+      { "6" = "*.so" }
+      { "7" = "*.so.[0-9]*" }
+      { "8" = "*.a" }
+      { "9" = "*.pyc" }
+      { "10" = "*.pyo" }
+      { "11" = "*.rej" }
+      { "12" = "*~" }
+      { "13" = "#*#" }
+      { "14" = ".#*" }
+      { "15" = ".*.swp" }
+      { "16" = ".DS_Store" } }
+    { "#comment" = "Set log-encoding to the default encoding for log messages" }
+    { "log-encoding" = "latin1" }
+    { "use-commit-times" = "yes" }
+    { "no-unlock" = "yes" }
+    { "mime-types-file" = "/path/to/mime.types" }
+    { "preserved-conflict-file-exts"
+      { "1" = "doc" }
+      { "2" = "ppt" }
+      { "3" = "xls" }
+      { "4" = "od?" } }
+    { "enable-auto-props" = "yes" }
+    { "interactive-conflicts" = "no" }
+    {  }
+  }
+  { "auto-props"
+    { "*.c" = "svn:eol-style=native" }
+    { "*.cpp" = "svn:eol-style=native" }
+    { "*.h" = "svn:eol-style=native" }
+    { "*.dsp" = "svn:eol-style=CRLF" }
+    { "*.dsw" = "svn:eol-style=CRLF" }
+    { "*.sh" = "svn:eol-style=native;svn:executable" }
+    { "*.txt" = "svn:eol-style=native" }
+    { "*.png" = "svn:mime-type=image/png" }
+    { "*.jpg" = "svn:mime-type=image/jpeg" }
+    { "Makefile" = "svn:eol-style=native" }
+  }
+
+
index b2e469d..7114fd3 100644 (file)
@@ -1,6 +1,24 @@
+(* Module: Test_sudoers *)
 module Test_sudoers =
 
-   let conf = "
+let test_user = [ label "user" . Sudoers.sto_to_com_user . Util.eol ]*
+
+(* Test: test_user *)
+test test_user get "root
+@pbuilder
++secre-taries
+@my\ admin\ group
+EXAMPLE\\\\cslack
+MY\ EX-AMPLE\ 9\\\\cslack\ group
+" =
+  { "user" = "root" }
+  { "user" = "@pbuilder" }
+  { "user" = "+secre-taries" }
+  { "user" = "@my\\ admin\\ group" }
+  { "user" = "EXAMPLE\\\\cslack" }
+  { "user" = "MY\\ EX-AMPLE\\ 9\\\\cslack\\ group" }
+
+let conf = "
   Host_Alias LOCALNET = 192.168.0.0/24, localhost
 
    # User alias specification
@@ -26,6 +44,7 @@ Cmnd_Alias \
 Defaults   !visiblepw
 
 Defaults:buildd env_keep+=\"APT_CONFIG DEBIAN_FRONTEND SHELL\"
+Defaults!PBUILDER env_keep+=\"HOME ARCH DIST DISTRIBUTION PDEBUILD_PBUILDER\"
 
 # User privilege specification
 root    ALL=(ALL) ALL
@@ -100,6 +119,15 @@ www-data +biglab=(rpinson)NOEXEC: ICAL \
               { "var" = "APT_CONFIG" }
               { "var" = "DEBIAN_FRONTEND" }
               { "var" = "SHELL" } } }
+      { "Defaults"
+          { "type" = "!PBUILDER" }
+          { "env_keep"
+              { "append" }
+              { "var" = "HOME" }
+              { "var" = "ARCH" }
+              { "var" = "DIST" }
+              { "var" = "DISTRIBUTION" }
+              { "var" = "PDEBUILD_PBUILDER" } } }
       {}
       { "#comment" = "User privilege specification" }
       { "spec"
@@ -212,3 +240,78 @@ test Sudoers.lns get commenteol =
     { "command" = "ALL"
         { "runas_user"  = "ALL" } } }
     { "#comment" = "all root" } }
+
+(* Allow = in commands *)
+test Sudoers.spec get "root ALL= /usr/bin/mylvmbackup --configfile=/etc/mylvbackup_amanda.conf\n" =
+  { "spec"
+    { "user" = "root" }
+    { "host_group"
+      { "host" = "ALL" }
+      { "command" = "/usr/bin/mylvmbackup --configfile=/etc/mylvbackup_amanda.conf" } } }
+
+(* Allow commands without full path
+   -- if they begin with a lowcase letter *)
+test Sudoers.spec get "root ALL= sudoedit /etc/passwd\n" =
+  { "spec"
+    { "user" = "root" }
+    { "host_group"
+      { "host" = "ALL" }
+      { "command" = "sudoedit /etc/passwd" } } }
+
+(* Ticket #263, quoted values in defaults line *)
+let defaults_spaces = "Defaults       passprompt=\"Your SecurID Passcode: \"\n"
+test Sudoers.lns get defaults_spaces =
+  { "Defaults"
+    { "passprompt" = "\"Your SecurID Passcode: \"" }
+  }
+
+(* Ticket #263, quoted values in defaults line (string/bool parameters) *)
+let defaults_spaces_strbool = "Defaults      mailfrom=\"root@example.com\"\n"
+test Sudoers.lns get defaults_spaces_strbool =
+  { "Defaults"
+    { "mailfrom" = "\"root@example.com\"" }
+  }
+
+(* Test: Sudoers.spec
+     Spec users can be aliases *)
+test Sudoers.spec get "APACHE_ADMIN ALL= ALL\n" =
+  { "spec"
+    { "user" = "APACHE_ADMIN" }
+    { "host_group"
+      { "host" = "ALL" }
+      { "command" = "ALL" } } }
+
+(* Test: Sudoers.spec
+     Ticket #337: allow period in user names *)
+test Sudoers.spec get "user.one somehost = ALL\n" =
+  { "spec"
+    { "user" = "user.one" }
+    { "host_group"
+      { "host" = "somehost" }
+      { "command" = "ALL" }
+    }
+  }
+
+(* Test: Sudoers.spec
+     Ticket #370: allow underscore in group names *)
+test Sudoers.spec get "%sudo_users ALL=(ALL) ALL\n" =
+  { "spec"
+    { "user" = "%sudo_users" }
+    { "host_group"
+      { "host" = "ALL" }
+      { "command" = "ALL"
+        { "runas_user" = "ALL" } }
+    }
+  }
+
+(* Test: Sudoers.spec
+     Ticket #376: allow uppercase characters in user names *)
+test Sudoers.spec get "%GrOup ALL = (ALL) ALL\n" =
+  { "spec"
+    { "user" = "%GrOup" }
+    { "host_group"
+      { "host" = "ALL" }
+      { "command" = "ALL"
+        { "runas_user" = "ALL" } }
+    }
+  }
index ef8abd4..fa1601a 100644 (file)
@@ -1,35 +1,40 @@
 (* Test for sysconfig lens *)
 module Test_sysconfig =
 
+  let lns = Sysconfig.lns
+
   let eth_static = "# Intel Corporation PRO/100 VE Network Connection
 DEVICE=eth0
 BOOTPROTO=static
 BROADCAST=172.31.0.255
 HWADDR=ab:cd:ef:12:34:56
-export IPADDR=172.31.0.31
+export IPADDR=172.31.0.31 # this is our IP
 #DHCP_HOSTNAME=host.example.com
 NETMASK=255.255.255.0
 NETWORK=172.31.0.0
-unset ONBOOT
+unset ONBOOT    #   We do not want this var
 "
   let empty_val = "EMPTY=\nDEVICE=eth0\n"
 
   let key_brack = "SOME_KEY[1]=\nDEVICE=eth0\n"
 
-  test Sysconfig.lns get eth_static =
+  test lns get eth_static =
     { "#comment" = "Intel Corporation PRO/100 VE Network Connection" }
     { "DEVICE" = "eth0" }
     { "BOOTPROTO" = "static" }
     { "BROADCAST" = "172.31.0.255" }
     { "HWADDR" = "ab:cd:ef:12:34:56" }
     { "IPADDR" = "172.31.0.31"
-        { "export" } }
+        { "export" }
+        { "#comment" = "this is our IP" } }
     { "#comment" = "DHCP_HOSTNAME=host.example.com" }
     { "NETMASK" = "255.255.255.0" }
     { "NETWORK" = "172.31.0.0" }
-    { "@unset"   = "ONBOOT" }
+    { "@unset"
+      { "1" = "ONBOOT" }
+      { "#comment" = "We do not want this var" } }
 
-  test Sysconfig.lns put eth_static after
+  test lns put eth_static after
       set "BOOTPROTO" "dhcp" ;
       rm "IPADDR" ;
       rm "BROADCAST" ;
@@ -40,71 +45,109 @@ DEVICE=eth0
 BOOTPROTO=dhcp
 HWADDR=ab:cd:ef:12:34:56
 #DHCP_HOSTNAME=host.example.com
-unset ONBOOT
+unset ONBOOT    #   We do not want this var
 "
-  test Sysconfig.lns get empty_val =
+  test lns get empty_val =
     { "EMPTY" = "" } { "DEVICE" = "eth0" }
 
-  test Sysconfig.lns get key_brack =
+  test lns get key_brack =
     { "SOME_KEY[1]" = "" } { "DEVICE" = "eth0" }
 
-  test Sysconfig.lns get "smartd_opts=\"-q never\"\n" =
+  test lns get "smartd_opts=\"-q never\"\n" =
     { "smartd_opts" = "-q never" }
 
-  test Sysconfig.lns get "var=val  \n" = { "var" = "val" }
+  test lns get "var=val  \n" = { "var" = "val" }
 
-  test Sysconfig.lns get ". /etc/java/java.conf\n" =
+  test lns get ". /etc/java/java.conf\n" =
     { ".source" = "/etc/java/java.conf" }
 
   (* Quoted strings and other oddities *)
-  test Sysconfig.lns get "var=\"foo 'bar'\"\n" =
+  test lns get "var=\"foo 'bar'\"\n" =
     { "var" = "foo 'bar'" }
 
-  test Sysconfig.lns get "var=\"eth0\"\n" =
+  test lns get "var=\"eth0\"\n" =
     { "var" = "eth0" }
 
-  test Sysconfig.lns get "var='eth0'\n" =
+  test lns get "var='eth0'\n" =
     { "var" = "eth0" }
 
-  test Sysconfig.lns get "var='Some \"funny\" value'\n" =
+  test lns get "var='Some \"funny\" value'\n" =
     { "var" = "Some \"funny\" value" }
 
-  test Sysconfig.lns get "var=\"\\\"\"\n" =
+  test lns get "var=\"\\\"\"\n" =
     { "var" = "\\\"" }
 
-  test Sysconfig.lns get "var=\\\"\n" =
+  test lns get "var=\\\"\n" =
     { "var" = "\\\"" }
 
-  test Sysconfig.lns get "var=ab#c\n" =
+  test lns get "var=ab#c\n" =
+    { "var" = "ab#c" }
+
+  test lns get "var='ab#c'\n" =
+    { "var" = "ab#c" }
+
+  test lns get "var=\"ab#c\"\n" =
+    { "var" = "ab#c" }
+
+  test lns get "var=\"ab#c\"\n" =
     { "var" = "ab#c" }
 
   (* We don't handle backticks *)
-  test Sysconfig.lns get
+  test lns get
       "var=`grep nameserver /etc/resolv.conf | head -1`\n" = *
 
-  (* We don't handle comments at the end of a line yet *)
-  test Sysconfig.lns get "var=ab #c\n" = *
+  test lns get "var=ab #c\n" =
+    { "var" = "ab"
+        { "#comment" = "c" } }
+
+  test lns put "var=ab #c\n"
+    after rm "/var/#comment" = "var=ab\n"
+
+  test lns put "var=ab\n"
+    after set "/var/#comment" "this is a var" =
+       "var=ab # this is a var\n"
+
+  (* Test semicolons *)
+  test lns get "VAR1=\"this;is;a;test\"\nVAR2=this;\n" =
+  { "VAR1" = "this;is;a;test" }
+  { "VAR2" = "this" }
+
+  (* BZ 761246 *)
+  test lns get "DEVICE=\"eth0\";\n" =
+    { "DEVICE" = "eth0" }
+
+  test lns put "DEVICE=\"eth0\";\n" after
+    set "/DEVICE" "em1" = "DEVICE=\"em1\";\n"
+
+  test lns get "DEVICE=\"eth0\"; # remark\n" =
+    { "DEVICE" = "eth0" }
+    { "#comment" = "remark" }
 
   (* Bug 109: allow a bare export *)
-  test Sysconfig.lns get "export FOO\n" =
-  { "@export" = "FOO" }
+  test lns get "export FOO\n" =
+  { "@export"
+    { "1" = "FOO" } }
 
   (* Check we put quotes in when changes require them *)
-  test Sysconfig.lns put "var=\"v\"\n" after rm "/foo" =
+  test lns put "var=\"v\"\n" after rm "/foo" =
     "var=\"v\"\n"
 
-  test Sysconfig.lns put "var=v\n" after set "/var" "v w"=
+  test lns put "var=v\n" after set "/var" "v w"=
     "var=\"v w\"\n"
 
-  test Sysconfig.lns put "var='v'\n" after set "/var" "v w"=
+  test lns put "var='v'\n" after set "/var" "v w"=
     "var='v w'\n"
 
-  test Sysconfig.lns put "var=v\n" after set "/var" "v'w"=
+  test lns put "var=v\n" after set "/var" "v'w"=
     "var=\"v'w\"\n"
 
-  test Sysconfig.lns put "var=v\n" after set "/var" "v\"w"=
+  test lns put "var=v\n" after set "/var" "v\"w"=
     "var='v\"w'\n"
 
+  (* RHBZ#1043636: empty comment lines after comments *)
+  test lns get "#MOUNTD_NFS_V3\n#\n" =
+    { "#comment" = "MOUNTD_NFS_V3" }
+
 (* Local Variables: *)
 (* mode: caml       *)
 (* End:             *)
diff --git a/lenses/tests/test_sysconfig_route.aug b/lenses/tests/test_sysconfig_route.aug
new file mode 100644 (file)
index 0000000..a3c2275
--- /dev/null
@@ -0,0 +1,15 @@
+(*
+Module: Test_Sysconfig_Route
+  Provides unit tests and examples for the <Sysconfig_Route> lens.
+*)
+module Test_sysconfig_route =
+
+(* Test: Sysconfig_Route.lns *)
+test Sysconfig_Route.lns get "10.40.11.102/32 via 10.40.8.1\n10.1.8.0/24 via 10.40.8.254\n" =
+{ "10.40.8.1" = "10.40.11.102/32" }
+{ "10.40.8.254" = "10.1.8.0/24" }
+
+(* Test: Sysconfig_Route.lns *)
+test Sysconfig_Route.lns get "10.40.11.102/32 via 10.40.8.1\n10.1.8.0/24 via 10.40.8.1\n" =
+{ "10.40.8.1" = "10.40.11.102/32" }
+{ "10.40.8.1" = "10.1.8.0/24" }
index ea51098..42f31c0 100644 (file)
@@ -1,7 +1,12 @@
-(* Test for sysctl lens *)
+(*
+Module: Test_Sysctl
+  Provides unit tests and examples for the <Sysctl> lens.
+*)
+
 module Test_sysctl =
 
-  let default_sysctl = "# Kernel sysctl configuration file
+(* Variable: default_sysctl *)
+let default_sysctl = "# Kernel sysctl configuration file
 # Controls IP packet forwarding
 net.ipv4.ip_forward = 0
 
@@ -13,7 +18,8 @@ kernel.sysrq  =  0
 net.ipv4.tcp_mem = \t393216 524288 786432
 "
 
-  test Sysctl.lns get default_sysctl =
+(* Test: Sysctl.lns *)
+test Sysctl.lns get default_sysctl =
     { "#comment" = "Kernel sysctl configuration file" }
     { "#comment" = "Controls IP packet forwarding"}
     { "net.ipv4.ip_forward" = "0" }
@@ -25,7 +31,8 @@ net.ipv4.tcp_mem = \t393216 524288 786432
     { "#comment" = "Semicolon comments are also allowed" }
     { "net.ipv4.tcp_mem" = "393216 524288 786432" }
 
-  test Sysctl.lns put default_sysctl after
+(* Test: Sysctl.lns *)
+test Sysctl.lns put default_sysctl after
     set "net.ipv4.ip_forward" "1" ;
     rm "net.ipv4.conf.default.rp_filter" ;
     rm "net.ipv4.conf.default.accept_source_route" ;
index 83eb563..2ad1c16 100644 (file)
@@ -13,6 +13,9 @@ daemon.<=info                                 /var/log/foo
 daemon.!<=info                                 /var/log/foo
 *.*                                            @syslog.far.away
 *.*                                            @syslog.far.away:123
+*.*                                            @@syslog.far.away
+*.*                                            @@syslog.far.away:123
+*.*                                            @[2001::1]:514
 *.*                                            foo,bar
 *.*                                            |\"/usr/bin/soft arg\"
 !startslip
@@ -42,6 +45,7 @@ daemon.info                                     /var/log/cvsupd.log
 *.=debug;\
         auth,authpriv.none;\
         news.none;mail.none     -/var/log/debug
+# !pppd
 "
 
        test Syslog.lns get conf =
@@ -87,11 +91,23 @@ daemon.info                                     /var/log/cvsupd.log
          }
          { "entry"
            { "selector" { "facility" = "*" } { "level" = "*" } }
-           { "action" { "hostname" = "syslog.far.away" } }
+           { "action" { "protocol" = "@" } { "hostname" = "syslog.far.away" } }
          }
          { "entry"
            { "selector" { "facility" = "*" } { "level" = "*" } }
-           { "action" { "hostname" = "syslog.far.away" } { "port" = "123" } }
+           { "action" { "protocol" = "@" } { "hostname" = "syslog.far.away" } { "port" = "123" } }
+         }
+         { "entry"
+           { "selector" { "facility" = "*" } { "level" = "*" } }
+           { "action" { "protocol" = "@@" } { "hostname" = "syslog.far.away" } }
+         }
+         { "entry"
+           { "selector" { "facility" = "*" } { "level" = "*" } }
+           { "action" { "protocol" = "@@" } { "hostname" = "syslog.far.away" } { "port" = "123" } }
+         }
+         { "entry"
+           { "selector" { "facility" = "*" } { "level" = "*" } }
+           { "action" { "protocol" = "@" } { "hostname" = "[2001::1]" } { "port" = "514" } }
          }
          { "entry"
            { "selector" { "facility" = "*" } { "level" = "*" } }
@@ -188,6 +204,7 @@ daemon.info                                     /var/log/cvsupd.log
               { "selector" { "facility" = "news" } { "level" = "none" } }
               { "selector" { "facility" = "mail" } { "level" = "none" } }
              { "action" { "no_sync" } { "file" = "/var/log/debug" } } }
+      { "#comment" = "!pppd" }
          }
 
        (* changing file *)
@@ -243,9 +260,17 @@ daemon.info                                     /var/log/cvsupd.log
        (* changing file to remote host *)
        test Syslog.lns put "*.* /var\n" after
          rm "/entry/action/file" ;
+         set "/entry/action/protocol"  "@" ;
          set "/entry/action/hostname" "far.far.away"
          = "*.* @far.far.away\n"
 
+       (* changing file to remote host *)
+       test Syslog.lns put "*.* /var/lib\n" after
+         rm "/entry/action/file" ;
+         set "/entry/action/protocol"  "@@" ;
+         set "/entry/action/hostname" "far.far.away"
+         = "*.* @@far.far.away\n"
+
        (* changing file to * *)
        test Syslog.lns put "*.* /var\n" after
          rm "/entry/action/file" ;
@@ -299,3 +324,20 @@ daemon.info                                     /var/log/cvsupd.log
          set "/hostname/reverse" "" ;
          set "/hostname/hostname" "foo.foo.away"
          = "-foo.foo.away\n"
+
+        (* tokens can contain capital letters *)
+        test Syslog.lns get "LOCAL5.*    -/var/log/foo.log\n" =
+          { "entry"
+            { "selector"
+              { "facility" = "LOCAL5" }
+              { "level" = "*" }
+            }
+            { "action"
+              { "no_sync" }
+              { "file" = "/var/log/foo.log" }
+            }
+          }
+
+    (* test for commented out statements *)
+    test Syslog.lns put "" after
+       set "#comment" "!pppd" = "# !pppd\n"
diff --git a/lenses/tests/test_systemd.aug b/lenses/tests/test_systemd.aug
new file mode 100644 (file)
index 0000000..3397456
--- /dev/null
@@ -0,0 +1,346 @@
+(*
+Module: Test_Systemd
+  Provides unit tests and examples for the <Systemd> lens.
+*)
+
+module Test_Systemd =
+
+(* Variable: desc *)
+let desc = "[Unit]
+Description=RPC
+Description=RPC bind service
+Description=RPC bind\\
+service
+Description= Resets System Activity Logs
+"
+(* Test: Systemd.lns *)
+test Systemd.lns get desc =
+  { "Unit"
+    { "Description"
+      { "value" = "RPC" }
+    }
+    { "Description"
+      { "value" = "RPC bind service" }
+    }
+    { "Description"
+      { "value" = "RPC bind\
+service" }
+    }
+    { "Description"
+      { "value" = "Resets System Activity Logs" }
+    }
+  }
+
+(* Variable: multi *)
+let multi = "[Unit]
+After=syslog.target network.target
+Also=canberra-system-shutdown.service canberra-system-shutdown-reboot.service
+Before=sysinit.target shutdown.target
+CapabilityBoundingSet=CAP_SYS_ADMIN CAP_SETUID CAP_SETGID
+Conflicts=emergency.service emergency.target
+ControlGroup=%R/user/%I/shared cpu:/
+ListenNetlink=kobject-uevent 1
+Requires=shutdown.target umount.target final.target
+Sockets=udev-control.socket udev-kernel.socket
+WantedBy=halt.target poweroff.target
+Wants=local-fs.target swap.target
+Wants=local-fs.target \
+swap.target
+Wants=local-fs.target\
+swap.target
+Wants= local-fs.target
+"
+(* Test: Systemd.lns *)
+test Systemd.lns get multi =
+  { "Unit"
+    { "After"
+      { "value" = "syslog.target" }
+      { "value" = "network.target" }
+    }
+    { "Also"
+      { "value" = "canberra-system-shutdown.service" }
+      { "value" = "canberra-system-shutdown-reboot.service" }
+    }
+    { "Before"
+      { "value" = "sysinit.target" }
+      { "value" = "shutdown.target" }
+    }
+    { "CapabilityBoundingSet"
+      { "value" = "CAP_SYS_ADMIN" }
+      { "value" = "CAP_SETUID" }
+      { "value" = "CAP_SETGID" }
+    }
+    { "Conflicts"
+      { "value" = "emergency.service" }
+      { "value" = "emergency.target" }
+    }
+    { "ControlGroup"
+      { "value" = "%R/user/%I/shared" }
+      { "value" = "cpu:/" }
+    }
+    { "ListenNetlink"
+      { "value" = "kobject-uevent" }
+      { "value" = "1" }
+    }
+    { "Requires"
+      { "value" = "shutdown.target" }
+      { "value" = "umount.target" }
+      { "value" = "final.target" }
+    }
+    { "Sockets"
+      { "value" = "udev-control.socket" }
+      { "value" = "udev-kernel.socket" }
+    }
+    { "WantedBy"
+      { "value" = "halt.target" }
+      { "value" = "poweroff.target" }
+    }
+    { "Wants"
+      { "value" = "local-fs.target" }
+      { "value" = "swap.target" }
+    }
+    { "Wants"
+      { "value" = "local-fs.target" }
+      { "value" = "swap.target" }
+    }
+    { "Wants"
+      { "value" = "local-fs.target" }
+      { "value" = "swap.target" }
+    }
+    { "Wants"
+      { "value" = "local-fs.target" }
+    }
+  }
+
+(* Variable: exec *)
+let exec = "[Service]
+ExecStart=/bin/ls
+ExecReload=/bin/kill -USR1 $MAINPID
+ExecStart=/sbin/rpcbind -w
+ExecStartPost=/bin/systemctl disable firstboot-graphical.service firstboot-text.service
+ExecStartPre=/sbin/modprobe -qa $SUPPORTED_DRIVERS
+ExecStop=/usr/sbin/aiccu stop
+ExecStopPost=-/bin/systemctl poweroff
+ExecStopPost=@/bin/systemctl poweroff
+ExecStopPost=-@/bin/systemctl poweroff
+ExecStopPost=/bin/systemctl\
+poweroff
+"
+(* Test: Systemd.lns *)
+test Systemd.lns get exec =
+  { "Service"
+    { "ExecStart"
+      { "command" = "/bin/ls" }
+    }
+    { "ExecReload"
+      { "command" = "/bin/kill" }
+      { "arguments"
+        { "1" = "-USR1" }
+        { "2" = "$MAINPID" }
+      }
+    }
+    { "ExecStart"
+      { "command" = "/sbin/rpcbind" }
+      { "arguments"
+        { "1" = "-w" }
+      }
+    }
+    { "ExecStartPost"
+      { "command" = "/bin/systemctl" }
+      { "arguments"
+        { "1" = "disable" }
+        { "2" = "firstboot-graphical.service" }
+        { "3" = "firstboot-text.service" }
+      }
+    }
+    { "ExecStartPre"
+      { "command" = "/sbin/modprobe" }
+      { "arguments"
+        { "1" = "-qa" }
+        { "2" = "$SUPPORTED_DRIVERS" }
+      }
+    }
+    { "ExecStop"
+      { "command" = "/usr/sbin/aiccu" }
+      { "arguments"
+        { "1" = "stop" }
+      }
+    }
+    { "ExecStopPost"
+      { "ignoreexit" }
+      { "command" = "/bin/systemctl" }
+      { "arguments"
+        { "1" = "poweroff" }
+      }
+    }
+    { "ExecStopPost"
+      { "arg0" }
+      { "command" = "/bin/systemctl" }
+      { "arguments"
+        { "1" = "poweroff" }
+      }
+    }
+    { "ExecStopPost"
+      { "ignoreexit" }
+      { "arg0" }
+      { "command" = "/bin/systemctl" }
+      { "arguments"
+        { "1" = "poweroff" }
+      }
+    }
+    { "ExecStopPost"
+      { "command" = "/bin/systemctl" }
+      { "arguments"
+        { "1" = "poweroff" }
+      }
+    }
+  }
+
+(* Variable: env *)
+let env = "[Service]
+Environment=LANG=C
+Environment=LANG=C FOO=BAR
+Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION=
+Environment=LANG=C\
+FOO=BAR
+Environment=\"LANG=foo bar\" FOO=BAR
+Environment=OPTIONS=\"-LS0-6d\"
+Environment=OPTIONS='-LS0-6d'
+"
+(* Test: Systemd.lns *)
+test Systemd.lns get env =
+  { "Service"
+    { "Environment"
+      { "LANG" = "C" }
+    }
+    { "Environment"
+      { "LANG" = "C" }
+      { "FOO" = "BAR" }
+    }
+    { "Environment"
+      { "LANG" }
+      { "LANGUAGE" }
+      { "LC_CTYPE" }
+      { "LC_NUMERIC" }
+      { "LC_TIME" }
+      { "LC_COLLATE" }
+      { "LC_MONETARY" }
+      { "LC_MESSAGES" }
+      { "LC_PAPER" }
+      { "LC_NAME" }
+      { "LC_ADDRESS" }
+      { "LC_TELEPHONE" }
+      { "LC_MEASUREMENT" }
+      { "LC_IDENTIFICATION" }
+    }
+    { "Environment"
+      { "LANG" = "C" }
+      { "FOO" = "BAR" }
+    }
+    { "Environment"
+      { "LANG" = "foo bar" }
+      { "FOO" = "BAR" }
+    }
+    { "Environment"
+      { "OPTIONS" = "\"-LS0-6d\"" }
+    }
+    { "Environment"
+      { "OPTIONS" = "'-LS0-6d'" }
+    }
+  }
+
+(* Variable: unit *)
+let unit = "#  This file is part of systemd.
+#
+
+# See systemd.special(7) for details
+
+.include /etc/example
+
+[Unit]
+Description=Locale Service
+# Add another file
+.include /etc/example
+
+[Service]
+ExecStart=/lib/systemd/systemd-localed
+Type=dbus
+BusName=org.freedesktop.locale1
+CapabilityBoundingSet=
+
+"
+(* Test: Systemd.lns *)
+test Systemd.lns get unit =
+  { "#comment" = "This file is part of systemd." }
+  {}
+  {  }
+  { "#comment" = "See systemd.special(7) for details" }
+  {  }
+  { ".include" = "/etc/example" }
+  {  }
+  { "Unit"
+    { "Description"
+      { "value" = "Locale Service" }
+    }
+    { "#comment" = "Add another file" }
+    { ".include" = "/etc/example" }
+    {  }
+  }
+  { "Service"
+    { "ExecStart"
+      { "command" = "/lib/systemd/systemd-localed" }
+    }
+    { "Type"
+      { "value" = "dbus" }
+    }
+    { "BusName"
+      { "value" = "org.freedesktop.locale1" }
+    }
+    { "CapabilityBoundingSet" }
+    {  }
+  }
+
+(* Test: Systemd.lns
+     Values can contain backslashes *)
+test Systemd.entry_command get "ExecStart=/usr/bin/find /var/lib/sudo -exec /usr/bin/touch -t 198501010000 '{}' \073\n" =
+  { "ExecStart"
+    { "command" = "/usr/bin/find" }
+    { "arguments"
+      { "1" = "/var/lib/sudo" }
+      { "2" = "-exec" }
+      { "3" = "/usr/bin/touch" }
+      { "4" = "-t" }
+      { "5" = "198501010000" }
+      { "6" = "'{}'" }
+      { "7" = "\073" }
+    }
+  }
+
+let exec_tmux = "ExecStart=/usr/bin/tmux unbind-key -a; \
+                        kill-window -t anaconda:shell; \
+                        bind-key ? list-keys\n"
+
+(* Test: Systemd.lns
+     Semicolons are permitted in entry values, e.g. as part of a command *)
+test Systemd.entry_command get exec_tmux =
+  { "ExecStart"
+    { "command" = "/usr/bin/tmux" }
+    { "arguments"
+      { "1" = "unbind-key" }
+      { "2" = "-a;" }
+      { "3" = "kill-window" }
+      { "4" = "-t" }
+      { "5" = "anaconda:shell;" }
+      { "6" = "bind-key" }
+      { "7" = "?" }
+      { "8" = "list-keys" } } }
+
+(* Test: Systemd.lns
+     # and ; are OK for standalone comments, but # only for EOL comments *)
+test Systemd.lns get "[Service]\n# hash\n; semicolon\nExecStart=/bin/echo # hash\n" =
+  { "Service"
+    { "#comment" = "hash" }
+    { "#comment" = "semicolon" }
+    { "ExecStart"
+      { "command" = "/bin/echo" }
+      { "#comment" = "hash" } } }
diff --git a/lenses/tests/test_thttpd.aug b/lenses/tests/test_thttpd.aug
new file mode 100644 (file)
index 0000000..77eef85
--- /dev/null
@@ -0,0 +1,45 @@
+(*
+Module: Test_Thttpd
+  Provides unit tests and examples for the <Thttpd> lens.
+*)
+
+module Test_Thttpd =
+
+let conf = "# This file is for thttpd processes created by /etc/init.d/thttpd.
+# Commentary is based closely on the thttpd(8) 2.25b manpage, by Jef Poskanzer.
+
+# Specifies an alternate port number to listen on.
+port=80
+host=
+
+  dir=/var/www
+chroot
+  novhost
+
+  # Specifies what user to switch to after initialization when started as root.
+user=www-data # EOL comment
+nosymlinks # EOL comment
+"
+
+test Thttpd.lns get conf =
+  { "#comment" = "This file is for thttpd processes created by /etc/init.d/thttpd." }
+  { "#comment" = "Commentary is based closely on the thttpd(8) 2.25b manpage, by Jef Poskanzer." }
+  { }
+  { "#comment" = "Specifies an alternate port number to listen on." }
+  { "port" = "80" }
+  { "host" = "" }
+  { }
+  { "dir" = "/var/www" }
+  { "chroot" }
+  { "novhost" }
+  { }
+  { "#comment" = "Specifies what user to switch to after initialization when started as root." }
+  { "user" = "www-data"
+    { "#comment" = "EOL comment" }
+  }
+  { "nosymlinks"
+    { "#comment" = "EOL comment" }
+  }
+
+(* There must not be spaces around the '=' *)
+test Thttpd.lns get "port = 80" = *
diff --git a/lenses/tests/test_tuned.aug b/lenses/tests/test_tuned.aug
new file mode 100644 (file)
index 0000000..e31b19a
--- /dev/null
@@ -0,0 +1,13 @@
+module Test_tuned =
+
+let conf = "# Global tuned configuration file.
+
+dynamic_tuning = 0
+update_interval = 10
+"
+
+test Tuned.lns get conf =
+  { "#comment" = "Global tuned configuration file." }
+  {  }
+  { "dynamic_tuning" = "0" }
+  { "update_interval" = "10" }
diff --git a/lenses/tests/test_up2date.aug b/lenses/tests/test_up2date.aug
new file mode 100644 (file)
index 0000000..b51ca08
--- /dev/null
@@ -0,0 +1,209 @@
+(*
+Module: Test_Up2date
+  Provides unit tests and examples for the <Up2date> lens.
+*)
+
+module Test_Up2date =
+
+(* Variable: empty *)
+let empty = "keyword=
+"
+test Up2date.lns get empty =
+  { "1" = "keyword" }
+
+(* Variable: list_empty *)
+let list_empty = "keyword=;
+"
+test Up2date.lns get list_empty =
+  { "1" = "keyword"
+    { "values" } }
+
+(* Variable: list_one *)
+let list_one = "keyword=foo;
+"
+test Up2date.lns get list_one =
+  { "1" = "keyword"
+    { "values"
+      { "1" = "foo" } } }
+
+(* Variable: list_two
+   Probably not useful, up2date throws "bar" away *)
+let list_two = "keyword=foo;bar
+"
+test Up2date.lns get list_two =
+  { "1" = "keyword"
+    { "values"
+      { "1" = "foo" }
+      { "2" = "bar" } } }
+
+(* Variable: list_two_trailing *)
+let list_two_trailing = "keyword=foo;bar;
+"
+test Up2date.lns get list_two_trailing =
+  { "1" = "keyword"
+    { "values"
+      { "1" = "foo" }
+      { "2" = "bar" } } }
+
+(* Variable: conf *)
+let conf = "# Red Hat Update Agent config file.
+# Format: 1.0
+
+debug[comment]=Whether or not debugging is enabled
+debug=0
+
+systemIdPath[comment]=Location of system id
+systemIdPath=/etc/sysconfig/rhn/systemid
+
+serverURL[comment]=Remote server URL (use FQDN)
+#serverURL=https://xmlrpc.rhn.redhat.com/XMLRPC
+serverURL=https://enter.your.server.url.here/XMLRPC
+
+hostedWhitelist[comment]=RHN Hosted URL's
+hostedWhitelist=
+
+enableProxy[comment]=Use a HTTP Proxy
+enableProxy=0
+
+versionOverride[comment]=Override the automatically determined system version
+versionOverride=
+
+httpProxy[comment]=HTTP proxy in host:port format, e.g. squid.redhat.com:3128
+httpProxy=
+
+noReboot[comment]=Disable the reboot actions
+noReboot=0
+
+networkRetries[comment]=Number of attempts to make at network connections before giving up
+networkRetries=1
+
+disallowConfChanges[comment]=Config options that can not be overwritten by a config update action
+disallowConfChanges=noReboot;sslCACert;useNoSSLForPackages;noSSLServerURL;serverURL;disallowConfChanges;
+
+sslCACert[comment]=The CA cert used to verify the ssl server
+sslCACert=/usr/share/rhn/RHNS-CA-CERT
+
+# Akamai does not support http protocol, therefore setting this option as side effect disable \"Location aware\" function
+useNoSSLForPackages[comment]=Use the noSSLServerURL for package, package list, and header fetching (disable Akamai)
+useNoSSLForPackages=0
+
+retrieveOnly[comment]=Retrieve packages only
+retrieveOnly=0
+
+skipNetwork[comment]=Skips network information in hardware profile sync during registration.
+skipNetwork=0
+
+tmpDir[comment]=Use this Directory to place the temporary transport files
+tmpDir=/tmp
+
+writeChangesToLog[comment]=Log to /var/log/up2date which packages has been added and removed
+writeChangesToLog=0
+
+stagingContent[comment]=Retrieve content of future actions in advance
+stagingContent=1
+
+stagingContentWindow[comment]=How much forward we should look for future actions. In hours.
+stagingContentWindow=24
+"
+
+(* Test: Up2date.lns *)
+test Up2date.lns get conf =
+  { "#comment" = "Red Hat Update Agent config file." }
+  { "#comment" = "Format: 1.0" }
+  {  }
+  { "1" = "debug[comment]"
+    { "value" = "Whether or not debugging is enabled" } }
+  { "2" = "debug"
+    { "value" = "0" } }
+  {  }
+  { "3" = "systemIdPath[comment]"
+    { "value" = "Location of system id" } }
+  { "4" = "systemIdPath"
+    { "value" = "/etc/sysconfig/rhn/systemid" } }
+  {  }
+  { "5" = "serverURL[comment]"
+    { "value" = "Remote server URL (use FQDN)" } }
+  { "#comment" = "serverURL=https://xmlrpc.rhn.redhat.com/XMLRPC" }
+  { "6" = "serverURL"
+    { "value" = "https://enter.your.server.url.here/XMLRPC" } }
+  {  }
+  { "7" = "hostedWhitelist[comment]"
+    { "value" = "RHN Hosted URL's" } }
+  { "8" = "hostedWhitelist" }
+  {  }
+  { "9" = "enableProxy[comment]"
+    { "value" = "Use a HTTP Proxy" } }
+  { "10" = "enableProxy"
+    { "value" = "0" } }
+  {  }
+  { "11" = "versionOverride[comment]"
+    { "value" = "Override the automatically determined system version" } }
+  { "12" = "versionOverride" }
+  {  }
+  { "13" = "httpProxy[comment]"
+    { "value" = "HTTP proxy in host:port format, e.g. squid.redhat.com:3128" } }
+  { "14" = "httpProxy" }
+  {  }
+  { "15" = "noReboot[comment]"
+    { "value" = "Disable the reboot actions" } }
+  { "16" = "noReboot"
+    { "value" = "0" } }
+  {  }
+  { "17" = "networkRetries[comment]"
+    { "value" = "Number of attempts to make at network connections before giving up" } }
+  { "18" = "networkRetries"
+    { "value" = "1" } }
+  {  }
+  { "19" = "disallowConfChanges[comment]"
+    { "value" = "Config options that can not be overwritten by a config update action" } }
+  { "20" = "disallowConfChanges"
+    { "values"
+      { "1" = "noReboot" }
+      { "2" = "sslCACert" }
+      { "3" = "useNoSSLForPackages" }
+      { "4" = "noSSLServerURL" }
+      { "5" = "serverURL" }
+      { "6" = "disallowConfChanges" } } }
+  {  }
+  { "21" = "sslCACert[comment]"
+    { "value" = "The CA cert used to verify the ssl server" } }
+  { "22" = "sslCACert"
+    { "value" = "/usr/share/rhn/RHNS-CA-CERT" } }
+  {  }
+  { "#comment" = "Akamai does not support http protocol, therefore setting this option as side effect disable \"Location aware\" function" }
+  { "23" = "useNoSSLForPackages[comment]"
+    { "value" = "Use the noSSLServerURL for package, package list, and header fetching (disable Akamai)" } }
+  { "24" = "useNoSSLForPackages"
+    { "value" = "0" } }
+  {  }
+  { "25" = "retrieveOnly[comment]"
+    { "value" = "Retrieve packages only" } }
+  { "26" = "retrieveOnly"
+    { "value" = "0" } }
+  {  }
+  { "27" = "skipNetwork[comment]"
+    { "value" = "Skips network information in hardware profile sync during registration." } }
+  { "28" = "skipNetwork"
+    { "value" = "0" } }
+  {  }
+  { "29" = "tmpDir[comment]"
+    { "value" = "Use this Directory to place the temporary transport files" } }
+  { "30" = "tmpDir"
+    { "value" = "/tmp" } }
+  {  }
+  { "31" = "writeChangesToLog[comment]"
+    { "value" = "Log to /var/log/up2date which packages has been added and removed" } }
+  { "32" = "writeChangesToLog"
+    { "value" = "0" } }
+  {  }
+  { "33" = "stagingContent[comment]"
+    { "value" = "Retrieve content of future actions in advance" } }
+  { "34" = "stagingContent"
+    { "value" = "1" } }
+  {  }
+  { "35" = "stagingContentWindow[comment]"
+    { "value" = "How much forward we should look for future actions. In hours." } }
+  { "36" = "stagingContentWindow"
+    { "value" = "24" } }
+
+
diff --git a/lenses/tests/test_updatedb.aug b/lenses/tests/test_updatedb.aug
new file mode 100644 (file)
index 0000000..4939d01
--- /dev/null
@@ -0,0 +1,32 @@
+(*
+Module: Test_UpdateDB
+  Provides unit tests and examples for the <UpdateDB> lens.
+*)
+module Test_UpdateDB =
+
+(* Test: UpdateDB.lns
+     Simple get test *)
+test UpdateDB.lns get "# A comment
+PRUNEPATHS=\"/tmp /var/spool /media /home/.ecryptfs\"
+PRUNEFS= \"NFS nfs nfs4 rpc_pipefs\"
+PRUNE_BIND_MOUNTS = \"yes\"\n" =
+  { "#comment" = "A comment" }
+  { "PRUNEPATHS"
+    { "entry" = "/tmp" }
+    { "entry" = "/var/spool" }
+    { "entry" = "/media" }
+    { "entry" = "/home/.ecryptfs" }
+  }
+  { "PRUNEFS"
+    { "entry" = "NFS" }
+    { "entry" = "nfs" }
+    { "entry" = "nfs4" }
+    { "entry" = "rpc_pipefs" }
+  }
+  { "PRUNE_BIND_MOUNTS" = "yes" }
+
+(* Test: UpdateDB.lns
+     Adding to a list *)
+test UpdateDB.lns put "PRUNEFS=\"NFS nfs nfs4 rpc_pipefs\"\n"
+  after set "/PRUNEFS/entry[last()+1]" "ecryptfs" =
+"PRUNEFS=\"NFS nfs nfs4 rpc_pipefs ecryptfs\"\n"
diff --git a/lenses/tests/test_vfstab.aug b/lenses/tests/test_vfstab.aug
new file mode 100644 (file)
index 0000000..54eb4ae
--- /dev/null
@@ -0,0 +1,88 @@
+module Test_vfstab =
+
+  let simple = "/dev/dsk/c0t0d0s1 /dev/rdsk/c0t0d0s1 /test  ufs 1 yes ro\n"
+  let simple_tree =
+    { "1"
+        { "spec" = "/dev/dsk/c0t0d0s1" }
+        { "fsck" = "/dev/rdsk/c0t0d0s1" }
+        { "file" = "/test" }
+        { "vfstype" = "ufs" }
+        { "passno" = "1" }
+        { "atboot" = "yes" }
+        { "opt" = "ro" } }
+  test Vfstab.lns get simple = simple_tree
+
+  let trailing_ws = "/dev/dsk/c0t0d0s1\t /dev/rdsk/c0t0d0s1\t /test\t ufs\t    1\t  yes\t  ro  \t  \n"
+  test Vfstab.lns get trailing_ws = simple_tree
+
+  (* Now test combinations where unneeded fields can be replaced by dashes and
+     then should not appear in the tree. *)
+  let gen_empty_field(fsck:string) (passno:string) (opt:string) =
+    "/dev/dsk/c0t0d0s1\t " . fsck . "\t /test\t ufs\t " . passno . " yes " .  opt . "\t\n"
+
+  (* Missing fsck *)
+  let no_fsck = gen_empty_field "-" "1" "ro"
+  test Vfstab.lns get no_fsck =
+    { "1"
+        { "spec" = "/dev/dsk/c0t0d0s1" }
+        { "file" = "/test" }
+        { "vfstype" = "ufs" }
+        { "passno" = "1" }
+        { "atboot" = "yes" }
+        { "opt" = "ro" } }
+
+  test Vfstab.lns put no_fsck after
+    insa "fsck" "/1/spec" ;
+    set "/1/fsck" "/dev/rdsk/c0t0d0s1" = gen_empty_field "/dev/rdsk/c0t0d0s1" "1" "ro"
+
+  (* Missing passno *)
+  let no_passno = gen_empty_field "/dev/rdsk/c0t0d0s1" "-" "ro"
+  test Vfstab.lns get no_passno =
+    { "1"
+        { "spec" = "/dev/dsk/c0t0d0s1" }
+        { "fsck" = "/dev/rdsk/c0t0d0s1" }
+        { "file" = "/test" }
+        { "vfstype" = "ufs" }
+        { "atboot" = "yes" }
+        { "opt" = "ro" } }
+
+  test Vfstab.lns put no_passno after
+    insa "passno" "/1/vfstype" ;
+    set "/1/passno" "1" = gen_empty_field "/dev/rdsk/c0t0d0s1" "1" "ro"
+
+  (* Missing opts *)
+  let no_opts = gen_empty_field "/dev/rdsk/c0t0d0s1" "1" "-"
+  test Vfstab.lns get no_opts =
+    { "1"
+        { "spec" = "/dev/dsk/c0t0d0s1" }
+        { "fsck" = "/dev/rdsk/c0t0d0s1" }
+        { "file" = "/test" }
+        { "vfstype" = "ufs" }
+        { "passno" = "1" }
+        { "atboot" = "yes" } }
+
+  test Vfstab.lns put no_opts after
+    insa "opt" "/1/atboot" ;
+    insa "opt" "/1/atboot" ;
+    set "/1/opt[1]" "ro" ;
+    set "/1/opt[2]" "fg"  = gen_empty_field "/dev/rdsk/c0t0d0s1" "1" "ro,fg"
+
+  let multi_opts = "/dev/dsk/c0t0d0s1 /dev/rdsk/c0t0d0s1 /test  ufs 1 yes ro,nosuid,retry=5,fg\n"
+  let multi_opts_tree =
+    { "1"
+        { "spec" = "/dev/dsk/c0t0d0s1" }
+        { "fsck" = "/dev/rdsk/c0t0d0s1" }
+        { "file" = "/test" }
+        { "vfstype" = "ufs" }
+        { "passno" = "1" }
+        { "atboot" = "yes" }
+        { "opt" = "ro" }
+        { "opt" = "nosuid" }
+        { "opt" = "retry"
+            { "value" = "5" } }
+        { "opt" = "fg" } }
+  test Vfstab.lns get multi_opts = multi_opts_tree
+
+(* Local Variables: *)
+(* mode: caml       *)
+(* End:             *)
diff --git a/lenses/tests/test_vmware_config.aug b/lenses/tests/test_vmware_config.aug
new file mode 100644 (file)
index 0000000..2431b6d
--- /dev/null
@@ -0,0 +1,49 @@
+(*
+Module: Test_VMware_Config
+  Provides unit tests and examples for the <VMware_Config> lens.
+*)
+
+module Test_VMware_Config =
+
+(* Variable: conf *)
+let conf = "libdir = \"/usr/lib/vmware\"
+dhcpd.fullpath = \"/usr/bin/vmnet-dhcpd\"
+authd.fullpath = \"/usr/sbin/vmware-authd\"
+authd.client.port = \"902\"
+loop.fullpath = \"/usr/bin/vmware-loop\"
+vmware.fullpath = \"/usr/bin/vmware\"
+control.fullpath = \"/usr/bin/vmware-cmd\"
+serverd.fullpath = \"/usr/sbin/vmware-serverd\"
+wizard.fullpath = \"/usr/bin/vmware-wizard\"
+serverd.init.fullpath = \"/usr/lib/vmware/serverd/init.pl\"
+serverd.vpxuser = \"vpxuser\"
+serverd.snmpdconf.subagentenabled = \"TRUE\"
+template.useFlatDisks = \"TRUE\"
+autoStart.defaultStartDelay = \"60\"
+autoStart.enabled = \"True\"
+autoStart.defaultStopDelay = \"60\"
+"
+
+(* Test: VMware_Config.lns *)
+test VMware_Config.lns get conf =
+  { "libdir" = "/usr/lib/vmware" }
+  { "dhcpd.fullpath" = "/usr/bin/vmnet-dhcpd" }
+  { "authd.fullpath" = "/usr/sbin/vmware-authd" }
+  { "authd.client.port" = "902" }
+  { "loop.fullpath" = "/usr/bin/vmware-loop" }
+  { "vmware.fullpath" = "/usr/bin/vmware" }
+  { "control.fullpath" = "/usr/bin/vmware-cmd" }
+  { "serverd.fullpath" = "/usr/sbin/vmware-serverd" }
+  { "wizard.fullpath" = "/usr/bin/vmware-wizard" }
+  { "serverd.init.fullpath" = "/usr/lib/vmware/serverd/init.pl" }
+  { "serverd.vpxuser" = "vpxuser" }
+  { "serverd.snmpdconf.subagentenabled" = "TRUE" }
+  { "template.useFlatDisks" = "TRUE" }
+  { "autoStart.defaultStartDelay" = "60" }
+  { "autoStart.enabled" = "True" }
+  { "autoStart.defaultStopDelay" = "60" }
+
+(* Test: VMware_Config.lns
+   Quotes are not mandatory *)
+test VMware_Config.lns get "xkeymap.nokeycodeMap = true\n" =
+  { "xkeymap.nokeycodeMap" = "true" }
index d728d73..ff69f29 100644 (file)
@@ -21,6 +21,7 @@ service cvspserver
         server_args             = -f --allow-root=/var/cvs pserver
 #       bind                    = 127.0.0.1
         log_on_failure         += HOST
+        FLAGS                   = IPv6 IPv4
 }
 "
 
@@ -60,7 +61,10 @@ test Xinetd.lns get cvs =
           { "value" = "--allow-root=/var/cvs" }
           { "value" = "pserver" } }
       { "#comment" = "bind                    = 127.0.0.1" }
-      { "log_on_failure" { "add" } { "value" = "HOST" } } }
+      { "log_on_failure" { "add" } { "value" = "HOST" } }
+      { "FLAGS"
+          { "value" = "IPv6" }
+          { "value" = "IPv4" } } }
 
 (* Switch the '+=' to a simple '=' *)
 test Xinetd.lns put lst_add after rm "/service/log_on_failure/add" =
@@ -74,6 +78,13 @@ test Xinetd.lns put "" after
 }
 "
 
+(* Support missing values in lists *)
+test Xinetd.lns get "service check_mk\n{\n  log_on_success =\n  server_args=\n}\n" =
+  { "service" = "check_mk"
+    { "log_on_success" }
+    { "server_args" }
+  }
+
 (* Local Variables: *)
 (* mode: caml       *)
 (* End:             *)
index 33b41d2..8307f0d 100644 (file)
@@ -74,9 +74,9 @@ test Xml.decl_def_item get
    !DOCTYPE tags are mapped in "!DOCTYPE" nodes.
    The associated system attribute is mapped in a "SYSTEM" subnode. *)
 test Xml.doctype get
- "<!DOCTYPE greeting SYSTEM \"hello.dtd\">" =
+ "<!DOCTYPE greeting:foo SYSTEM \"hello.dtd\">" =
 
-  { "!DOCTYPE" = "greeting"
+  { "!DOCTYPE" = "greeting:foo"
     { "SYSTEM" = "hello.dtd" }
   }
 
@@ -184,6 +184,21 @@ test Xml.attributes get " refs=\"A1\nA2  A3\"" =
 test Xml.attributes put attr1 after rm "/#attribute[1]";
                                     set "/#attribute/attr2" "foo" = attr2
 
+(* test quoting *)
+(* well formed values *)
+test Xml.attributes get " attr1=\"value1\"" = { "#attribute" { "attr1" = "value1" } }
+test Xml.attributes get " attr1='value1'" = { "#attribute" { "attr1" = "value1" } }
+test Xml.attributes get " attr1='va\"lue1'" = { "#attribute" { "attr1" = "va\"lue1" } }
+test Xml.attributes get " attr1=\"va'lue1\"" = { "#attribute" { "attr1" = "va'lue1" } }
+
+(* illegal as per the XML standard *)
+test Xml.attributes get " attr1=\"va\"lue1\"" = *
+test Xml.attributes get " attr1='va'lue1'" = *
+
+(* malformed values *)
+test Xml.attributes get " attr1=\"value1'" = *
+test Xml.attributes get " attr1='value1\"" = *
+
 (* Group: empty *)
 
 (* Variable: empty1 *)
@@ -247,7 +262,7 @@ test Xml.lns get "<oor:component-data xmlns:oor=\"http://openoffice.org/2001/reg
 
 (* Variable: input1 *)
 let input1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-<html>
+<html>\r
     <head>
         <title>Wiki</title>
     </head>
@@ -273,7 +288,7 @@ test Xml.doc get input1 =
     }
   }
   { "html"
-    { "#text" = "\n    " }
+    { "#text" = "\r\n    " }
     { "head"
       { "#text" = "\n        " }
       { "title"
@@ -322,7 +337,7 @@ test Xml.doc get input1 =
    Modify <input1> with <Xml.doc> *)
 test Xml.doc put input1 after rm "/html/body" =
 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-<html>
+<html>\r
     <head>
         <title>Wiki</title>
     </head>
@@ -622,7 +637,14 @@ test Xml.lns get p10pass1_1 =
     }
   }
 
-test Xml.lns get p10pass1_2 = *
+test Xml.lns get p10pass1_2 =
+  { "doc"
+    { "A" = "#empty"
+      { "#attribute"
+        { "a" = "\"\">&#39;&#34;" }
+      }
+    }
+  }
 
 (* here again, test exclude single quote *)
 let p11pass1 = "<!--Inability to resolve a notation should not be reported as an error-->
@@ -696,9 +718,9 @@ test Xml.lns get p22pass3 =
 
 let p25pass2 = "<?xml version
 
-     
+
 =
-  
+
 
 \"1.0\"?>
 <doc></doc>"
@@ -712,7 +734,7 @@ test Xml.lns get p25pass2 =
   { "doc" }
 
 
-test Xml.lns get "<!DOCTYPE 
+test Xml.lns get "<!DOCTYPE
 
 doc
 
@@ -742,6 +764,10 @@ test Xml.lns get "<a><doc att=\"val\" \natt2=\"val2\" att3=\"val3\"/></a>" =
 
 test Xml.lns get "<doc/>" = { "doc" = "#empty" }
 
+test Xml.lns get "<a><![CDATA[Thu, 13 Feb 2014 12:22:35 +0000]]></a>" =
+  { "a"
+    { "#CDATA" = "Thu, 13 Feb 2014 12:22:35 +0000" } }
+
 (* failure tests *)
 (* only one document element *)
 test Xml.lns get "<doc></doc><bad/>" = *
@@ -764,12 +790,17 @@ test Xml.lns get "<doc><![ CDATA[a]]></doc>" = *
 (* no space after "CDATA" *)
 test Xml.lns get "<doc><![CDATA [a]]></doc>" = *
 
-(* CDSect's can't nest *)
+(* FIXME: CDSect's can't nest *)
 test Xml.lns get "<doc>
 <![CDATA[
 <![CDATA[XML doesn't allow CDATA sections to nest]]>
 ]]>
-</doc>" = *
+</doc>" =
+  { "doc"
+    { "#text" = "\n" }
+    { "#CDATA" = "\n<![CDATA[XML doesn't allow CDATA sections to nest" }
+    { "#text" = "\n]]" }
+    { "#text" = ">\n" } }
 
 (* Comment is illegal in VersionInfo *)
 test Xml.lns get "<?xml version <!--bad comment--> =\"1.0\"?>
@@ -788,3 +819,7 @@ test Xml.lns get "<!DOCTYPE doc [
 ]>
 <doc></doc>" = *
 
+(* Escape character in attributes *)
+test Xml.lns get "<a password=\"my\!pass\" />" =
+  { "a" = "#empty"
+    { "#attribute" { "password" = "my\!pass" } } }
index 4fd937f..339435a 100644 (file)
@@ -23,6 +23,7 @@ Section \"Device\"
        Option          \"MonitorLayout\" \"LVDS,VGA\"
        VideoRam        229376
         Option          \"NoAccel\"
+        Screen          0
 EndSection
 
 Section \"Screen\"
@@ -35,6 +36,12 @@ Section \"Screen\"
                 Modes    \"1280x1024\" \"1280x960\" \"1280x800\"
         EndSubSection
 EndSection
+
+Section \"Module\"
+          SubSection \"extmod\"
+                   Option  \"omit XFree86-DGA\"
+          EndSubSection
+EndSection
 "
 
   test Xorg.lns get conf =
@@ -61,7 +68,9 @@ EndSection
         { "Option"     = "MonitorLayout"
              { "value"  = "LVDS,VGA" } }
         { "VideoRam"   = "229376" }
-        { "Option"     = "NoAccel" } }
+        { "Option"     = "NoAccel" } 
+        { "Screen"
+          { "num" = "0" } } }
      { }
      { "Screen"
         { "Identifier" = "Screen0" }
@@ -76,3 +85,7 @@ EndSection
               { "mode" = "1280x1024" }
               { "mode" = "1280x960" }
               { "mode" = "1280x800" } } } }
+     { }
+     { "Module"
+       { "extmod"
+           { "Option" = "omit XFree86-DGA" } } }
diff --git a/lenses/tests/test_xymon.aug b/lenses/tests/test_xymon.aug
new file mode 100644 (file)
index 0000000..99f1386
--- /dev/null
@@ -0,0 +1,162 @@
+module Test_xymon =
+
+let conf = "
+#atest comment
+
+title test title
+page page1 'This is a test page'
+1.1.1.1 testhost.localdomain # test1 test2 http:443 ldaps=testhost.localdomain http://testhost.localdomain
+2.2.2.2 testhost2.local.domain # COMMENT:stuff apache=wow
+#test comment
+
+page newpage
+1.1.1.1  testhost.localdomain # test1 test2 http:443 ldaps=testhost.localdomain http://testhost.localdomain
+2.2.2.2     testhost2.local.domain # COMMENT:stuff apache=wow
+
+title test title
+group group1
+3.3.3.3 host1 #
+4.4.4.4 host2 #
+
+subparent page1 page2 This is after page 1
+10.0.0.1 router1.loni.org #
+10.0.0.2 sw1.localdomain #
+
+"
+test Xymon.lns get conf =
+  {  }
+  { "#comment" = "atest comment" }
+  {  }
+  { "title" = "test title" }
+  { "page" = "page1"
+    { "pagetitle" = "'This is a test page'" }
+    { "host"
+      { "ip" = "1.1.1.1" }
+      { "fqdn" = "testhost.localdomain" }
+      { "tag" = "test1" }
+      { "tag" = "test2" }
+      { "tag" = "http:443" }
+      { "tag" = "ldaps=testhost.localdomain" }
+      { "tag" = "http://testhost.localdomain" }
+    }
+    { "host"
+      { "ip" = "2.2.2.2" }
+      { "fqdn" = "testhost2.local.domain" }
+      { "tag" = "COMMENT:stuff" }
+      { "tag" = "apache=wow" }
+    }
+    { "#comment" = "test comment" }
+    {  }
+  }
+  { "page" = "newpage"
+    { "host"
+      { "ip" = "1.1.1.1" }
+      { "fqdn" = "testhost.localdomain" }
+      { "tag" = "test1" }
+      { "tag" = "test2" }
+      { "tag" = "http:443" }
+      { "tag" = "ldaps=testhost.localdomain" }
+      { "tag" = "http://testhost.localdomain" }
+    }
+    { "host"
+      { "ip" = "2.2.2.2" }
+      { "fqdn" = "testhost2.local.domain" }
+      { "tag" = "COMMENT:stuff" }
+      { "tag" = "apache=wow" }
+    }
+    {  }
+    { "title" = "test title" }
+    { "group" = "group1"
+      { "host"
+        { "ip" = "3.3.3.3" }
+        { "fqdn" = "host1" }
+      }
+      { "host"
+        { "ip" = "4.4.4.4" }
+        { "fqdn" = "host2" }
+      }
+      {  }
+    }
+  }
+  { "subparent" = "page2"
+    { "parent" = "page1" }
+    { "pagetitle" = "This is after page 1" }
+    { "host"
+      { "ip" = "10.0.0.1" }
+      { "fqdn" = "router1.loni.org" }
+    }
+    { "host"
+      { "ip" = "10.0.0.2" }
+      { "fqdn" = "sw1.localdomain" }
+    }
+    {  }
+  }
+
+
+  test Xymon.host get "192.168.1.1 server1.test.example.com # tag1 tag2 CLASS:classname CLIENT:clienthostname NOCOLUMNS:column1,column2\n" =
+  { "host"
+    { "ip" = "192.168.1.1" }
+    { "fqdn" = "server1.test.example.com" }
+    { "tag" = "tag1" }
+    { "tag" = "tag2" }
+    { "tag" = "CLASS:classname" }
+    { "tag" = "CLIENT:clienthostname" }
+    { "tag" = "NOCOLUMNS:column1,column2" }
+  }
+
+  test Xymon.host get "192.168.1.1 test.example.com # \n" = 
+  { "host"
+    { "ip" = "192.168.1.1" }
+    { "fqdn" = "test.example.com" }
+  }
+  
+  test Xymon.host get "192.168.1.1 test.example.com # http://google.com COMMENT:asdf\n" = 
+  { "host"
+    { "ip" = "192.168.1.1" }
+    { "fqdn" = "test.example.com" }
+    { "tag" = "http://google.com" }
+    { "tag" = "COMMENT:asdf" }
+  }
+
+  test Xymon.include get "include file1.txt\n" = 
+  { "include" = "file1.txt" }
+  
+  test Xymon.include get "directory dir2\n" = 
+  { "directory" = "dir2" }
+
+  test Xymon.page get "page page1 page 1 title is here\n" =
+  { "page" = "page1"
+    { "pagetitle" = "page 1 title is here" }
+  }
+  
+  test Xymon.page get "page page2\n" =
+  { "page" = "page2"
+  }
+  
+  test Xymon.subparent get "subparent page1 page2 PAGETITLE 1\n1.1.1.1 host1.lan #\n2.2.2.2 host2.lan #   \n" =
+  { "subparent" = "page2"
+    { "parent" = "page1" }
+    { "pagetitle" = "PAGETITLE 1" }
+    { "host"
+      { "ip" = "1.1.1.1" }
+      { "fqdn" = "host1.lan" }
+    }
+    { "host"
+      { "ip" = "2.2.2.2" }
+      { "fqdn" = "host2.lan" }
+    }
+  }
+
+  test Xymon.title get "title title 1 goes here\n" =
+  { "title" = "title 1 goes here" }
+
+  test Xymon.lns get "page page1\ninclude file1.cfg\nsubparent page1 page2\ninclude page2.cfg\n" =
+  { "page" = "page1"
+    { "include" = "file1.cfg" }
+  }
+  { "subparent" = "page2"
+    { "parent" = "page1" }
+    { "include" = "page2.cfg" }
+  }
+
+
diff --git a/lenses/tests/test_xymon_alerting.aug b/lenses/tests/test_xymon_alerting.aug
new file mode 100644 (file)
index 0000000..77525cb
--- /dev/null
@@ -0,0 +1,289 @@
+(*
+Module: Test_Xymon_Alerting
+  Provides unit tests and examples for the <Xymon_Alerting> lens.
+*)
+
+module Test_Xymon_Alerting =
+    let macro_definition = "$NOTIF_LOCAL=SCRIPT /foo/xymonqpage.sh $PAGER SCRIPT /foo/xymonsms.sh $SMS FORMAT=SMS COLOR=!yellow\n"
+    test Xymon_Alerting.lns get macro_definition = 
+    { "$NOTIF_LOCAL" = "SCRIPT /foo/xymonqpage.sh $PAGER SCRIPT /foo/xymonsms.sh $SMS FORMAT=SMS COLOR=!yellow" }
+
+    let basic_syntax = "HOST=hostname IGNORE\n"
+    test Xymon_Alerting.lns get basic_syntax = 
+      { "1"
+        { "filters"
+          { "HOST" = "hostname" }
+        }
+        { "recipients"
+          { "IGNORE" { "filters" } }
+        }
+      }
+
+    let two_filters = "HOST=hostname SERVICE=service IGNORE\n"
+    test Xymon_Alerting.lns get two_filters =
+      { "1"
+        { "filters"
+          { "HOST"    = "hostname" }
+          { "SERVICE" = "service" }
+        }
+        { "recipients"
+          { "IGNORE" { "filters" } }
+        }
+      }
+
+    let two_recipients = "HOST=hostname IGNORE STOP\n"
+    test Xymon_Alerting.lns get two_recipients =
+      { "1"
+        { "filters"
+          { "HOST"    = "hostname" }
+        }
+        { "recipients"
+          { "IGNORE" { "filters" } }
+          { "STOP"   { "filters" } }
+        }
+      }
+
+    let two_lines = "HOST=hostname SERVICE=service\n    IGNORE\n"
+    test Xymon_Alerting.lns get two_lines =
+      { "1"
+        { "filters"
+          { "HOST"    = "hostname" }
+          { "SERVICE" = "service" }
+        }
+        { "recipients"
+          { "IGNORE" { "filters" } }
+        }
+      }
+
+    let two_lines_for_recipients = "HOST=hostname SERVICE=service\n    IGNORE\nSTOP\n"
+    test Xymon_Alerting.lns get two_lines_for_recipients =
+      { "1"
+        { "filters"
+          { "HOST"    = "hostname" }
+          { "SERVICE" = "service" }
+        }
+        { "recipients"
+          { "IGNORE" { "filters" } }
+          { "STOP"   { "filters" } }
+        }
+      }
+
+    let with_blanks_at_eol = "HOST=hostname SERVICE=service  \n    IGNORE  \n"
+    test Xymon_Alerting.lns get with_blanks_at_eol =
+      { "1"
+        { "filters"
+          { "HOST"    = "hostname" }
+          { "SERVICE" = "service" }
+        }
+        { "recipients"
+          { "IGNORE" { "filters" } }
+        }
+      }
+
+    let several_rules = "HOST=hostname SERVICE=service\nIGNORE\nHOST=hostname2 SERVICE=svc\nIGNORE\nSTOP\n"
+    test Xymon_Alerting.lns get several_rules =
+      { "1"
+        { "filters"
+          { "HOST" = "hostname" }
+          { "SERVICE" = "service" }
+        }
+        { "recipients"
+          { "IGNORE" { "filters" } }
+        }
+      }
+      { "2"
+        { "filters"
+          { "HOST" = "hostname2" }
+          { "SERVICE" = "svc" }
+        }
+        { "recipients"
+          { "IGNORE" { "filters" } }
+          { "STOP"   { "filters" } }
+        }
+      }
+
+
+    let duration = "HOST=hostname DURATION>20 SERVICE=service\nIGNORE\n"
+    test Xymon_Alerting.lns get duration =
+      { "1"
+        { "filters"
+          { "HOST" = "hostname" }
+          { "DURATION"
+            { "operator" = ">" }
+            { "value"    = "20" }
+          }
+          { "SERVICE" = "service" }
+        }
+        { "recipients"
+          { "IGNORE" { "filters" } }
+        }
+      }
+
+    let notice = "HOST=hostname NOTICE SERVICE=service\nIGNORE\n"
+    test Xymon_Alerting.lns get notice =
+      { "1"
+        { "filters"
+          { "HOST" = "hostname" }
+          { "NOTICE" }
+          { "SERVICE" = "service" }
+        }
+        { "recipients"
+          { "IGNORE" { "filters" } }
+        }
+      }
+
+    let mail = "HOST=hostname MAIL astreinteMail\n"
+    test Xymon_Alerting.lns get mail =
+      { "1"
+        { "filters"
+          { "HOST" = "hostname" }
+        }
+        { "recipients"
+          { "MAIL" = "astreinteMail"
+            { "filters" }
+          }
+        }
+      }
+
+    let script = "HOST=hostname SCRIPT /foo/email.sh astreinteMail\n"
+    test Xymon_Alerting.lns get script =
+      { "1"
+        { "filters"
+          { "HOST" = "hostname" }
+        }
+        { "recipients"
+          { "SCRIPT"
+            { "script"    = "/foo/email.sh" }
+            { "recipient" = "astreinteMail" }
+            { "filters" }
+          }
+        }
+      }
+
+    let repeat = "HOST=hostname REPEAT=15\n"
+    test Xymon_Alerting.lns get repeat =
+      { "1"
+        { "filters"
+          { "HOST" = "hostname" }
+        }
+        { "recipients"
+          { "REPEAT" = "15" 
+            { "filters" }
+          }
+        }
+      }
+
+    let mail_with_filters = "HOST=hostname MAIL astreinteMail EXSERVICE=service\n"
+    test Xymon_Alerting.lns get mail_with_filters =
+      { "1"
+        { "filters"
+          { "HOST" = "hostname" }
+        }
+        { "recipients"
+          { "MAIL" = "astreinteMail"
+            { "filters"
+              { "EXSERVICE" = "service" }
+            }
+          }
+        }
+      }
+
+    let mail_with_several_filters = "HOST=hostname MAIL astreinteMail EXSERVICE=service DURATION>20\n"
+    test Xymon_Alerting.lns get mail_with_several_filters =
+      { "1"
+        { "filters"
+          { "HOST" = "hostname" }
+        }
+        { "recipients"
+          { "MAIL" = "astreinteMail"
+            { "filters"
+              { "EXSERVICE" = "service" }
+              { "DURATION"
+                { "operator" = ">" }
+                { "value" = "20" }
+              }
+            }
+          }
+        }
+      }
+
+    let script_with_several_filters = "HOST=hostname SCRIPT /foo/email.sh astreinteMail EXSERVICE=service DURATION>20\n"
+    test Xymon_Alerting.lns get script_with_several_filters =
+      { "1"
+        { "filters"
+          { "HOST" = "hostname" }
+        }
+        { "recipients"
+          { "SCRIPT"
+            { "script"    = "/foo/email.sh" }
+            { "recipient" = "astreinteMail" }
+            { "filters"
+              { "EXSERVICE" = "service" }
+              { "DURATION"
+                { "operator" = ">" }
+                { "value" = "20" }
+              }
+            }
+          }
+        }
+      }
+
+    let repeat_with_several_filters = "HOST=hostname REPEAT=15 EXSERVICE=service DURATION>20\n"
+    test Xymon_Alerting.lns get repeat_with_several_filters =
+      { "1"
+        { "filters"
+          { "HOST" = "hostname" }
+        }
+        { "recipients"
+          { "REPEAT" = "15" 
+            { "filters"
+              { "EXSERVICE" = "service" }
+              { "DURATION"
+                { "operator" = ">" }
+                { "value" = "20" }
+              }
+            }
+          }
+        }
+      }
+
+    let recipients_with_several_filters = "HOST=hostname\nREPEAT=15 EXSERVICE=service DURATION>20\nMAIL astreinteMail TIME=weirdtimeformat\n"
+    test Xymon_Alerting.lns get recipients_with_several_filters =
+      { "1"
+        { "filters"
+          { "HOST" = "hostname" }
+        }
+        { "recipients"
+          { "REPEAT" = "15" 
+            { "filters"
+              { "EXSERVICE" = "service" }
+              { "DURATION"
+                { "operator" = ">" }
+                { "value" = "20" }
+              }
+            }
+          }
+          { "MAIL" = "astreinteMail"
+            { "filters"
+              { "TIME" = "weirdtimeformat" }
+            }
+          }
+        }
+      }
+
+    let recipient_macro = "HOST=hostname\n    $NOTIF_LOCAL\n    STOP\n"
+    test Xymon_Alerting.lns get recipient_macro =
+      { "1"
+        { "filters"
+          { "HOST" = "hostname" }
+        }
+        { "recipients"
+          { "$NOTIF_LOCAL"
+            { "filters" }
+          }
+          { "STOP"
+            { "filters" }
+          }
+        }
+      }
+
index bfb7743..2688182 100644 (file)
@@ -1,3 +1,8 @@
+(*
+Module: Test_Yum
+  Provides unit tests and examples for the <Yum> lens.
+*)
+
 module Test_yum =
 
   let yum_simple = "[sec1]
@@ -73,8 +78,15 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
   let cont = "[main]\nbaseurl=url1\n   url2 , url3\n   \n"
 
   test Yum.lns get yum_simple =
-    { "sec1" {} { "key" = "value" } }
-    { "sec-two" { "key1" = "value1" } {} { "key2" = "value2" } }
+  { "sec1"
+    { "#comment" = "comment" }
+    { "key" = "value" }
+  }
+  { "sec-two"
+    { "key1" = "value1" }
+    { "#comment" = "comment" }
+    { "key2" = "value2" }
+  }
 
   test Yum.lns put yum_conf after
       rm "main"
@@ -120,7 +132,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
   test Yum.lns get "[repo]\nbaseurl=url1\nbaseurl=url2\n" = *
 
   (* This checks that we take the right branch in the section lens.     *)
-  test Yum.section get "[repo]\nname=A name\nbaseurl=url1\n" =
+  test Yum.record get "[repo]\nname=A name\nbaseurl=url1\n" =
     { "repo"
         { "name" = "A name" }
         { "baseurl" = "url1" } }
@@ -135,7 +147,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
   { "fedora"
     { "name" = "Fedora $releasever - $basearch" }
     { "failovermethod" = "priority" }
-    {  }
+    { "#comment" = "baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/" }
     { "mirrorlist" = "http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch" }
     { "enabled" = "1" }
     { "gpgcheck" = "1" }
@@ -146,7 +158,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
   { "fedora-debuginfo"
     { "name" = "Fedora $releasever - $basearch - Debug" }
     { "failovermethod" = "priority" }
-    {  }
+    { "#comment" = "baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/" }
     { "mirrorlist" = "http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-$releasever&arch=$basearch" }
     { "enabled" = "0" }
     { "gpgcheck" = "1" }
@@ -157,7 +169,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
   { "fedora-source"
     { "name" = "Fedora $releasever - Source" }
     { "failovermethod" = "priority" }
-    {  }
+    { "#comment" = "baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/source/SRPMS/" }
     { "mirrorlist" = "http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-source-$releasever&arch=$basearch" }
     { "enabled" = "0" }
     { "gpgcheck" = "1" }
@@ -166,7 +178,6 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
   }
 
 
-
   test Yum.lns get yum_repo2 =
   { "remi"
     { "name" = "Les RPM de remi pour FC$releasever - $basearch" }
@@ -186,6 +197,31 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
     { "gpgkey" = "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi" }
   }
 
+  (* Test: Yum.lns
+      Check that we can parse an empty line, to fix test-save *)
+  test Yum.lns get "\n" = { }
+
+  (* Test: Yum.lns
+       Issue #45: allow spaces around equals sign *)
+  test Yum.lns get "[rpmforge]
+name = RHEL $releasever - RPMforge.net - dag
+baseurl = http://apt.sw.be/redhat/el6/en/$basearch/rpmforge\n" =
+    { "rpmforge"
+      { "name" = "RHEL $releasever - RPMforge.net - dag" }
+      { "baseurl" = "http://apt.sw.be/redhat/el6/en/$basearch/rpmforge" }
+    }
+
+  (* Test: Yum.lns
+       Issue #275: parse excludes as a list *)
+  test Yum.lns get "[epel]
+name=Extra Packages for Enterprise Linux 6 - $basearch
+exclude=ocs* clamav*
+" =
+    { "epel"
+      { "name" = "Extra Packages for Enterprise Linux 6 - $basearch" }
+      { "exclude" = "ocs*" }
+      { "exclude" = "clamav*" } }
+
 (* Local Variables: *)
 (* mode: caml       *)
 (* End:             *)
diff --git a/lenses/thttpd.aug b/lenses/thttpd.aug
new file mode 100644 (file)
index 0000000..bf6c491
--- /dev/null
@@ -0,0 +1,48 @@
+(*
+Module: Thttpd
+  Parses Thttpd's configuration files
+
+Author: Marc Fournier <marc.fournier@camptocamp.com>
+
+About: Reference
+    This lens is based on Thttpd's default thttpd.conf file.
+
+About: Usage Example
+(start code)
+    augtool> get /files/etc/thttpd/thttpd.conf/port
+    /files/etc/thttpd/thttpd.conf/port = 80
+
+    augtool> set /files/etc/thttpd/thttpd.conf/port 8080
+    augtool> save
+    Saved 1 file(s)
+(end code)
+   The <Test_Thttpd> file also contains various examples.
+
+About: License
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
+*)
+
+module Thttpd =
+autoload xfm
+
+let comment     = Util.comment
+let comment_eol = Util.comment_generic /[ \t]*[#][ \t]*/ " # "
+let empty       = Util.empty
+let eol         = Util.del_str "\n"
+let bol         = Util.del_opt_ws ""
+
+let kvkey       = /(port|dir|data_dir|user|cgipat|throttles|host|logfile|pidfile|charset|p3p|max_age)/
+let flag        = /(no){0,1}(chroot|symlinks|vhost|globalpasswd)/
+let val         = /[^\n# \t]*/
+
+let kventry     = key kvkey . Util.del_str "=" . store val
+let flagentry   = key flag
+
+let kvline      = [ bol . kventry . (eol|comment_eol) ]
+let flagline    = [ bol . flagentry . (eol|comment_eol) ]
+
+let lns         = (kvline|flagline|comment|empty)*
+
+let filter      = incl "/etc/thttpd/thttpd.conf"
+
+let xfm         = transform lns filter
diff --git a/lenses/tuned.aug b/lenses/tuned.aug
new file mode 100644 (file)
index 0000000..506ed07
--- /dev/null
@@ -0,0 +1,21 @@
+(*
+Module: Tuned
+  Parses Tuned's configuration files
+
+Author: Pat Riehecky <riehecky@fnal.gov>
+
+About: Reference
+    This lens is based on tuned's tuned-main.conf
+
+About: License
+  This file is licensed under the LGPL v2+, like the rest of Augeas.
+*)
+
+module Tuned =
+autoload xfm
+
+let lns = Simplevars.lns
+
+let filter = incl "/etc/tuned/tuned-main.conf"
+
+let xfm = transform lns filter
diff --git a/lenses/up2date.aug b/lenses/up2date.aug
new file mode 100644 (file)
index 0000000..f1d9ab7
--- /dev/null
@@ -0,0 +1,84 @@
+(*
+Module: Up2date
+  Parses /etc/sysconfig/rhn/up2date
+
+Author: Raphael Pinson <raphink@gmail.com>
+
+About: Reference
+  This lens tries to keep as close as possible to `man 5 up2date` where possible.
+
+About: License
+   This file is licenced under the LGPLv2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to /etc/sysconfig/rhn/up2date. See <filter>.
+
+About: Examples
+   The <Test_Up2date> file contains various examples and tests.
+*)
+
+module Up2date =
+
+autoload xfm
+
+(************************************************************************
+ * Group:                 USEFUL PRIMITIVES
+ *************************************************************************)
+
+(* Variable: key_re *)
+let key_re   = /[^=# \t\n]+/
+
+(* Variable: value_re *)
+let value_re = /[^ \t\n;][^\n;]*[^ \t\n;]|[^ \t\n;]/
+
+(* View: sep_semi *)
+let sep_semi = Sep.semicolon
+
+(************************************************************************
+ * Group:                 ENTRIES
+ *************************************************************************)
+
+(* View: single_entry
+   key=foo *)
+let single_entry = [ label "value" . store value_re ]
+
+(* View: multi_empty
+   key=; *)
+let multi_empty  = sep_semi
+
+(* View: multi_value
+   One value in a list setting *)
+let multi_value  = [ seq "multi" . store value_re ]
+
+(* View: multi_single
+   key=foo;  (parsed as a list) *)
+let multi_single = multi_value . sep_semi
+
+(* View: multi_values
+   key=foo;bar
+   key=foo;bar; *)
+let multi_values = multi_value . ( sep_semi . multi_value )+ . del /;?/ ";"
+
+(* View: multi_entry
+   List settings go under a 'values' node *)
+let multi_entry  = [ label "values" . counter "multi"
+                     . ( multi_single | multi_values | multi_empty ) ]
+
+(* View: entry *)
+let entry = [ seq "entry" . store key_re . Sep.equal
+              . ( multi_entry | single_entry )? . Util.eol ]
+
+(************************************************************************
+ * Group:                 LENS
+ *************************************************************************)
+
+(* View: lns *)
+let lns = (Util.empty | Util.comment | entry)*
+
+(* Variable: filter *)
+let filter = incl "/etc/sysconfig/rhn/up2date"
+
+let xfm = transform lns filter
diff --git a/lenses/updatedb.aug b/lenses/updatedb.aug
new file mode 100644 (file)
index 0000000..40cd26f
--- /dev/null
@@ -0,0 +1,49 @@
+(*
+Module: UpdateDB
+  Parses /etc/updatedb.conf
+
+Author: Raphael Pinson <raphink@gmail.com>
+
+About: Reference
+  This lens tries to keep as close as possible to `man 5 updatedb.conf` where possible.
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to /etc/updatedb.conf. See <filter>.
+
+About: Examples
+   The <Test_UpdateDB> file contains various examples and tests.
+*)
+
+module UpdateDB =
+
+autoload xfm
+
+(* View: list
+     A list entry *)
+let list =
+     let entry = [ label "entry" . store Rx.no_spaces ]
+  in let entry_list = Build.opt_list entry Sep.space
+  in [ key /PRUNE(FS|NAMES|PATHS)/ . Sep.space_equal
+     . Quote.do_dquote entry_list . Util.doseol ]
+
+(* View: bool
+     A boolean entry *)
+let bool = [ key "PRUNE_BIND_MOUNTS" . Sep.space_equal
+           . Quote.do_dquote (store /[01]|no|yes/)
+           . Util.doseol ]
+
+(* View: lns
+     The <UpdateDB> lens *)
+let lns = (Util.empty|Util.comment|list|bool)*
+
+(* Variable: filter
+      The filter *)
+let filter = incl "/etc/updatedb.conf"
+
+let xfm = transform lns filter
index 03a0a52..1418c23 100644 (file)
@@ -54,6 +54,14 @@ Variable: eol
   let eol = del /[ \t]*\n/ "\n"
 
 (*
+Variable: doseol
+  Delete end of line with optional carriage return,
+  including optional trailing whitespace
+*)
+  let doseol = del /[ \t]*\r?\n/ "\n"
+   
+
+(*
 Variable: indent
   Delete indentation, including leading whitespace
 *)
@@ -64,20 +72,34 @@ Variable: indent
      It allows indentation for comments, removes the leading and trailing spaces
      of comments and stores them in nodes, except for empty comments which are
      ignored together with empty lines
+*)
+
 
-View: comment_generic
+(* View: comment_generic_seteol
   Map comments and set default comment sign
 *)
 
-  let comment_generic (r:regexp) (d:string) =
+  let comment_generic_seteol (r:regexp) (d:string) (eol:lens) =
     [ label "#comment" . del r d
-        . store /([^ \t\n].*[^ \t\n]|[^ \t\n])/ . eol ]
+        . store /([^ \t\r\n].*[^ \t\r\n]|[^ \t\r\n])/ . eol ]
+
+(* View: comment_generic
+  Map comments and set default comment sign
+*)
+
+  let comment_generic (r:regexp) (d:string) =
+    comment_generic_seteol r d doseol
 
 (* View: comment
   Map comments into "#comment" nodes
 *)
   let comment = comment_generic /[ \t]*#[ \t]*/ "# "
 
+(* View: comment_noindent
+  Map comments into "#comment" nodes, without indentation
+*)
+  let comment_noindent = comment_generic /#[ \t]*/ "# "
+
 (* View: comment_eol
   Map eol comments into "#comment" nodes
   Add a space before # for end of line comments
@@ -91,14 +113,14 @@ View: comment_generic
 (* View: comment_multiline
     A C-style multiline comment *)
   let comment_multiline =
-     let mline_re = (/[^ \t\n].*[^ \t\n]|[^ \t\n]/ - /.*\*\/.*/) in
+     let mline_re = (/[^ \t\r\n].*[^ \t\r\n]|[^ \t\r\n]/ - /.*\*\/.*/) in
      let mline = [ seq "mline"
-                 . del /[ \t\n]*/ "\n"
+                 . del /[ \t\r\n]*/ "\n"
                  . store mline_re ] in
      [ label "#mcomment" . del /[ \t]*\/\*/ "/*"
        . counter "mline"
        . mline . (eol . mline)*
-       . del /[ \t\n]*\*\/[ \t]*\n/ "\n*/\n" ]
+       . del /[ \t\r\n]*\*\/[ \t]*\r?\n/ "\n*/\n" ]
 
 (* View: comment_c_style
     A comment line, C-style *)
@@ -111,15 +133,28 @@ View: comment_generic
   let empty_generic (r:regexp) =
     [ del r "" . del_str "\n" ]
 
+(* Variable: empty_generic_re *)
+  let empty_generic_re = /[ \t]*#?[ \t]*/
+
 (* View: empty
   Map empty lines, including empty comments *)
-  let empty = empty_generic /[ \t]*#?[ \t]*/
+  let empty = empty_generic empty_generic_re
 
 (* View: empty_c_style
   Map empty lines, including C-style empty comment *)
   let empty_c_style =
     empty_generic /[ \t]*((\/\/)|(\/\*[ \t]*\*\/))?[ \t]*/
 
+(* View: empty_generic_dos
+  A generic definition of <empty> with dos newlines
+  Map empty lines, including empty comments *)
+  let empty_generic_dos (r:regexp) =
+    [ del r "" . del /\r?\n/ "\n" ]
+
+(* View: empty_dos *)
+  let empty_dos =
+    empty_generic_dos /[ \t]*#?[ \t]*/
+
 
 (* View: Split *)
 (* Split (SEP . ELT)* into an array-like tree where each match for ELT *)
@@ -129,6 +164,10 @@ View: comment_generic
     let sym = gensym "split" in
     counter sym . ( [ seq sym . sep . elt ] ) *
 
+(* View: delim *)
+  let delim (op:string) = del (/[ \t]*/ . op . /[ \t]*/)
+                              (" " . op . " ")
+
 (* Group: Exclusions
 
 Variable: stdexcl
@@ -142,4 +181,7 @@ Variable: stdexcl
     (excl "*.dpkg-bak") .
     (excl "*.dpkg-dist") .
     (excl "*.augsave") .
-    (excl "*.augnew")
+    (excl "*.augnew") .
+    (excl "*.bak") .
+    (excl "*.old") .
+    (excl "#*#")
diff --git a/lenses/vfstab.aug b/lenses/vfstab.aug
new file mode 100644 (file)
index 0000000..f730329
--- /dev/null
@@ -0,0 +1,67 @@
+(*
+Module: Vfstab
+  Parses Solaris vfstab config file, based on Fstab lens
+
+Author: Dominic Cleal <dcleal@redhat.com>
+
+About: Reference
+  See vfstab(4)
+
+About: License
+   This file is licenced under the LGPLv2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to /etc/vfstab.
+
+About: Examples
+   The <Test_Vfstab> file contains various examples and tests.
+*)
+
+module Vfstab =
+  autoload xfm
+
+  let sep_tab = Sep.tab
+  let sep_spc = Sep.space
+  let comma   = Sep.comma
+  let eol     = Util.eol
+
+  let comment = Util.comment
+  let empty   = Util.empty
+
+  let file    = /[^# \t\n]+/
+
+  let int     = Rx.integer
+  let bool    = "yes" | "no"
+
+  (* An option label can't contain comma, comment, equals, or space *)
+  let optlabel = /[^,#= \n\t]+/ - "-"
+  let spec    = /[^-,# \n\t][^ \n\t]*/
+
+  let optional = Util.del_str "-"
+
+  let comma_sep_list (l:string) =
+    let value = [ label "value" . Util.del_str "=" . store Rx.neg1 ] in
+      let lns = [ label l . store optlabel . value? ] in
+         Build.opt_list lns comma
+
+  let record = [ seq "mntent" .
+                   [ label "spec" . store spec ] . sep_tab .
+                   ( [ label "fsck" . store spec ] | optional ). sep_tab .
+                   [ label "file" . store file ] . sep_tab .
+                   comma_sep_list "vfstype" . sep_tab .
+                   ( [ label "passno" . store int ] | optional ) . sep_spc .
+                   [ label "atboot" . store bool ] . sep_tab .
+                   ( comma_sep_list "opt" | optional ) .
+                   eol ]
+
+  let lns = ( empty | comment | record ) *
+  let filter = incl "/etc/vfstab"
+
+  let xfm = transform lns filter
+
+(* Local Variables: *)
+(* mode: caml *)
+(* End: *)
diff --git a/lenses/vmware_config.aug b/lenses/vmware_config.aug
new file mode 100644 (file)
index 0000000..e7398d0
--- /dev/null
@@ -0,0 +1,34 @@
+(*
+Module: VWware_Config
+  Parses /etc/vmware/config
+
+Author: Raphael Pinson <raphael.pinson@camptocamp.com>
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Configuration files
+   This lens applies to /etc/vmware/config. See <filter>.
+
+About: Examples
+   The <Test_VMware_Config> file contains various examples and tests.
+*)
+module VMware_Config =
+
+autoload xfm
+
+(* View: entry *)
+let entry =
+  Build.key_value_line Rx.word Sep.space_equal Quote.double_opt
+
+(* View: lns *)
+let lns = (Util.empty | Util.comment | entry)*
+
+
+(* Variable: filter *)
+let filter = incl "/etc/vmware/config"
+
+let xfm = transform lns filter
index f95bdd0..8a2b994 100644 (file)
@@ -8,7 +8,7 @@ let eol = Util.del_str "\n"
 let empty = Util.empty
 let comment = Util.comment
 
-let bool_option_re = /anonymous_enable|local_enable|pasv_enable|port_enable|chroot_local_user|write_enable|anon_upload_enable|anon_mkdir_write_enable|anon_other_write_enable|chown_uploads|connect_from_port_20|xferlog_enable|dirmessage_enable|anon_world_readable_only|async_abor_enable|ascii_upload_enable|ascii_download_enable|one_process_model|xferlog_std_format|pasv_promiscuous|deny_email_enable|chroot_list_enable|setproctitle_enable|text_userdb_names|ls_recurse_enable|log_ftp_protocol|guest_enable|userlist_enable|userlist_deny|use_localtime|check_shell|hide_ids|listen|port_promiscuous|passwd_chroot_enable|no_anon_password|tcp_wrappers|use_sendfile|force_dot_files|listen_ipv6|dual_log_enable|syslog_enable|background|virtual_use_local_privs|session_support|download_enable|dirlist_enable|chmod_enable|secure_email_list_enable|run_as_launching_user|no_log_lock|ssl_enable|allow_anon_ssl|force_local_logins_ssl|force_local_data_ssl|ssl_sslv2|ssl_sslv3|ssl_tlsv1|tilde_user_enable|force_anon_logins_ssl|force_anon_data_ssl|mdtm_write|lock_upload_files|pasv_addr_resolve|debug_ssl|require_cert|validate_cert/
+let bool_option_re = /anonymous_enable|local_enable|pasv_enable|port_enable|chroot_local_user|write_enable|anon_upload_enable|anon_mkdir_write_enable|anon_other_write_enable|chown_uploads|connect_from_port_20|xferlog_enable|dirmessage_enable|anon_world_readable_only|async_abor_enable|ascii_upload_enable|ascii_download_enable|one_process_model|xferlog_std_format|pasv_promiscuous|deny_email_enable|chroot_list_enable|setproctitle_enable|text_userdb_names|ls_recurse_enable|log_ftp_protocol|guest_enable|userlist_enable|userlist_deny|use_localtime|check_shell|hide_ids|listen|port_promiscuous|passwd_chroot_enable|no_anon_password|tcp_wrappers|use_sendfile|force_dot_files|listen_ipv6|dual_log_enable|syslog_enable|background|virtual_use_local_privs|session_support|download_enable|dirlist_enable|chmod_enable|secure_email_list_enable|run_as_launching_user|no_log_lock|ssl_enable|allow_anon_ssl|force_local_logins_ssl|force_local_data_ssl|ssl_sslv2|ssl_sslv3|ssl_tlsv1|tilde_user_enable|force_anon_logins_ssl|force_anon_data_ssl|mdtm_write|lock_upload_files|pasv_addr_resolve|debug_ssl|require_cert|validate_cert|require_ssl_reuse/
 
 let uint_option_re = /accept_timeout|connect_timeout|local_umask|anon_umask|ftp_data_port|idle_session_timeout|data_connection_timeout|pasv_min_port|pasv_max_port|anon_max_rate|local_max_rate|listen_port|max_clients|file_open_mode|max_per_ip|trans_chunk_size|delay_failed_login|delay_successful_login|max_login_fails|chown_upload_mode/
 
index 8899d71..2bc4f3e 100644 (file)
@@ -40,9 +40,7 @@ let lns        = (comment|empty|entry) *
 
 let wm_incl (n:string)
                = (incl ("/etc/webmin/" . n))
-let filter
-               = wm_incl "miniserv.conf"
+let filter     = wm_incl "miniserv.conf"
                . wm_incl "ldap-useradmin/config"
-               . Util.stdexcl
 
 let xfm        = transform lns filter
index 2f8e707..132e479 100644 (file)
@@ -33,5 +33,5 @@ let sexpr = [ lbrack . var_name . ws . no_ws_comment? . thing . ws_and_comment?
 
 let lns = ( empty_line | standalone_comment | sexpr ) *
 
-let filter = incl "xend-config.sxp" . Util.stdexcl
+let filter = incl "xend-config.sxp"
 let xfm = transform lns filter
index e5944a3..506c025 100644 (file)
 module Xinetd =
   autoload xfm
 
-  let comment = Util.comment
-  let empty   = Util.empty
+  let opt_spc = Util.del_opt_ws " "
 
-  let name = key /[^ \t\n\/=+-]+/
-  let bol_spc = del /[ \t]*/ "\t"
-  let spc = del /[ \t]+/ " "
-  let eol = del /[ \t]*\n/ "\n"
+  let spc_equal = opt_spc . Sep.equal
 
-  let op_delim (op:string) = del (/[ \t]*/ . op . /[ \t]*/) (" " . op . " ")
-  let eq       = op_delim "="
+  let op = ([ label "add" . opt_spc . Util.del_str "+=" ]
+           |[ label "del" . opt_spc . Util.del_str "-=" ]
+           | spc_equal)
 
-  let op = ([ label "add" . op_delim "+=" ]
-           |[ label "del" . op_delim "-=" ]
-           | eq)
+  let value = store Rx.no_spaces
 
-  let value = store /[^ \t\n]+/
+  let indent = del Rx.opt_space "\t"
 
   let attr_one (n:regexp) =
-    [ bol_spc . key n . eq . value . eol ]
+    Build.key_value n Sep.space_equal value
 
   let attr_lst (n:regexp) (op_eq: lens) =
-    [ bol_spc . key n . op_eq .
-        [label "value" . value] . [label "value" . spc . value]* .
-      eol ]
+    let value_entry =  [ label "value" . value ] in
+    Build.key_value n op_eq (opt_spc . Build.opt_list value_entry Sep.space)?
 
-  let attr_lst_eq (n:regexp) = attr_lst n eq
+  let attr_lst_eq (n:regexp) = attr_lst n spc_equal
 
   let attr_lst_op (n:regexp) = attr_lst n op
 
@@ -53,28 +47,22 @@ module Xinetd =
    *      using lens union (attr_one "a" | attr_one "b"|..) because the latter
    *      causes the type checker to work _very_ hard.
    *)
-
   let service_attr =
-    attr_one ("socket_type" | "protocol" | "wait" | "user" | "group"
-             |"server" | "instances"  | "rpc_version" | "rpc_number"
-             | "id" | "port" | "nice" | "banner" | "bind" | "interface"
-             | "per_source" | "groups" | "banner_success" | "banner_fail"
-             | "disable" | "max_load" | "rlimit_as" | "rlimit_cpu"
-             | "rlimit_data" | "rlimit_rss" | "rlimit_stack" | "v6only"
-             | "deny_time" | "umask" | "mdns" | "libwrap")
+   attr_one (/socket_type|protocol|wait|user|group|server|instances/i
+     |/rpc_version|rpc_number|id|port|nice|banner|bind|interface/i
+     |/per_source|groups|banner_success|banner_fail|disable|max_load/i
+     |/rlimit_as|rlimit_cpu|rlimit_data|rlimit_rss|rlimit_stack|v6only/i
+     |/deny_time|umask|mdns|libwrap/i)
    (* redirect and cps aren't really lists, they take exactly two values *)
-   |attr_lst_eq ("server_args" | "log_type" |  "access_times" | "type"
-                | "flags" | "redirect" | "cps")
-   |attr_lst_op ( "log_on_success" | "log_on_failure"| "only_from"
-                | "no_access" | "env" | "passenv")
+   |attr_lst_eq (/server_args|log_type|access_times|type|flags|redirect|cps/i)
+   |attr_lst_op (/log_on_success|log_on_failure|only_from|no_access|env|passenv/i)
 
   let default_attr =
-    attr_one ( "instances" | "banner" | "bind" | "interface" | "per_source"
-             | "groups" | "banner_success" | "banner_fail" | "max_load"
-             | "v6only" | "umask" | "mdns")
-   |attr_lst_eq "cps"       (* really only two values, not a whole list *)
-   |attr_lst_op ( "log_type" | "log_on_success" | "log_on_failure" | "disabled"
-                | "no_access" | "only_from" | "passenv" | "enabled" )
+    attr_one (/instances|banner|bind|interface|per_source|groups/i
+      |/banner_success|banner_fail|max_load|v6only|umask|mdns/i)
+   |attr_lst_eq /cps/i       (* really only two values, not a whole list *)
+   |attr_lst_op (/log_type|log_on_success|log_on_failure|disabled/i
+      |/no_access|only_from|passenv|enabled/i)
 
   (* View: body
    *   Note:
@@ -86,9 +74,9 @@ module Xinetd =
    *       about how to write that down. The resulting regular expressions
    *       would simply be prohibitively large.
    *)
-  let body (attr:lens) = del /\n\{[ \t]*\n/ "\n{\n"
-                       . (empty|comment|attr)*
-                       . del /[ \t]*\}[ \t]*\n/ "}\n"
+  let body (attr:lens) = Build.block_newlines
+                            (indent . attr . Util.eol)
+                            Util.comment
 
   (* View: includes
    *  Note:
@@ -98,16 +86,16 @@ module Xinetd =
    *   currently not possible, and implementing that has a good amount of
    *   hairy corner cases to consider.
    *)
-  let includes = [ key /include|includedir/
-                     . Util.del_ws_spc . store /[^ \t\n]+/ . eol ]
+  let includes =
+     Build.key_value_line /include(dir)?/ Sep.space (store Rx.no_spaces)
 
   let service =
      let sto_re = /[^# \t\n\/]+/ in
-     [ key "service" . Sep.space . store sto_re . body service_attr ]
+     Build.key_value_line "service" Sep.space (store sto_re . body service_attr)
 
-  let defaults = [ key "defaults" . del /[ \t]*/ "" . body default_attr ]
+  let defaults = [ key "defaults" . body default_attr . Util.eol ]
 
-  let lns = ( empty | comment | includes | defaults | service )*
+  let lns = ( Util.empty | Util.comment | includes | defaults | service )*
 
   let filter = incl "/etc/xinetd.d/*"
              . incl "/etc/xinetd.conf"
index 1bcdc6a..23ee002 100644 (file)
@@ -13,18 +13,18 @@ autoload xfm
  *************************************************************************)
 
 let dels (s:string)   = del s s
-let spc               = /[ \t\n]+/
-let osp               = /[ \t\n]*/
-let sep_spc           = del /[ \t\n]+/ " "
-let sep_osp           = del /[ \t\n]*/ ""
-let sep_eq            = del /[ \t\n]*=[ \t\n]*/ "="
+let spc               = /[ \t\r\n]+/
+let osp               = /[ \t\r\n]*/
+let sep_spc           = del /[ \t\r\n]+/ " "
+let sep_osp           = del /[ \t\r\n]*/ ""
+let sep_eq            = del /[ \t\r\n]*=[ \t\r\n]*/ "="
 
 let nmtoken             = /[a-zA-Z:_][a-zA-Z0-9:_.-]*/
 let word                = /[a-zA-Z][a-zA-Z0-9._-]*/
-let char                = /.|\n/
+let char                = /.|(\r?\n)/
 (* if we hide the quotes, then we can only accept single or double quotes *)
 (* otherwise a put ambiguity is raised *)
-let sto_dquote          = dels "\"" . store /[^"]*/ . dels "\""
+let sto_dquote          = dels "\"" . store /[^"]*/ . dels "\"" (* " *)
 let sto_squote          = dels "'" . store /[^']*/ . dels "'"
 
 let comment             = [ label "#comment" .
@@ -34,7 +34,7 @@ let comment             = [ label "#comment" .
 
 let pi_target           = nmtoken - /[Xx][Mm][Ll]/
 let empty               = Util.empty
-let del_end             = del />[\n]?/ ">\n"
+let del_end             = del />[\r?\n]?/ ">\n"
 let del_end_simple      = dels ">"
 
 (* This is siplified version of processing instruction
@@ -42,7 +42,7 @@ let del_end_simple      = dels ">"
  * must not contain "?>". We restrict too much by not allowing any
  * "?" nor ">" in PI
  *)
-let pi                  = /[^ \n\t]|[^ \n\t][^?>]*[^ \n\t]/
+let pi                  = /[^ \r\n\t]|[^ \r\n\t][^?>]*[^ \r\n\t]/
 
 (************************************************************************
  *                            Attributes
@@ -53,7 +53,7 @@ let decl          = [ label "#decl" . sep_spc .
                       store /[^> \t\n\r]|[^> \t\n\r][^>\t\n\r]*[^> \t\n\r]/ ]
 
 let decl_def (r:regexp) (b:lens) = [ dels "<" . key r .
-                                     sep_spc . store word .
+                                     sep_spc . store nmtoken .
                                      b . sep_osp . del_end_simple ]
 
 let elem_def      = decl_def /!ELEMENT/ decl
@@ -74,7 +74,7 @@ let att_def       = counter "att_id" .
                       [ label "#name" . store word . sep_spc ] .
                       [ label "#type" . store att_type . sep_spc ] .
                       ([ key   /#REQUIRED|#IMPLIED/ ] |
-                       [ label "#FIXED" . del /#FIXED[ \n\t]*|/ "" . sto_dquote ]) ]*
+                       [ label "#FIXED" . del /#FIXED[ \r\n\t]*|/ "" . sto_dquote ]) ]*
 
 let att_list_def = decl_def /!ATTLIST/ att_def
 
@@ -89,8 +89,24 @@ let decl_outer    = sep_osp . del /\[[ \n\t\r]*/ "[\n" .
 
 let doctype       = decl_def /!DOCTYPE/ (decl_outer|id_def)
 
-let attributes    = [ label "#attribute" .
-                      [ sep_spc . key nmtoken . sep_eq . sto_dquote ]+ ]
+(* General shape of an attribute
+ * q   is the regexp matching the quote character for the value
+ * qd  is the default quote character
+ * brx is what the actual attribute value must match *)
+let attval (q:regexp) (qd:string) (brx:regexp) =
+  let quote = del q qd in
+  let body = store brx in
+  [ sep_spc . key nmtoken . sep_eq . square quote body quote ]
+
+(* We treat attributes according to one of the following three patterns:
+   attval1 : values that must be quoted with single quotes
+   attval2 : values that must be quoted with double quotes
+   attval3 : values that can be quoted with either *)
+let attributes    =
+  let attval1 = attval "'" "'" /[^']*"[^']*/ in (* " *)
+  let attval2 = attval "\"" "\"" /[^"]*'[^"]*/ in
+  let attval3 = attval /['"]/ "\"" /(\\\\|[^'\"])*/ in (* " *)
+  [ label "#attribute" . (attval1|attval2|attval3)+ ]
 
 let prolog        = [ label "#declaration" .
                       dels "<?xml" .
@@ -109,12 +125,16 @@ let text      = [ label "#text" . store text_re ]
 let cdata     = [ label "#CDATA" . dels "<![CDATA[" .
                   store (char* - (char* . "]]>" . char*)) . dels "]]>" ]
 
+(* the value of nmtoken_del is always the nmtoken_key string *)
+let nmtoken_key = key nmtoken
+let nmtoken_del = del nmtoken "a"
+
 let element (body:lens) =
     let h = attributes? . sep_osp . dels ">" . body* . dels "</" in
-        [ dels "<" . square nmtoken h . sep_osp . del_end ]
+        [ dels "<" . square nmtoken_key h nmtoken_del . sep_osp . del_end ]
 
-let empty_element = [ dels "<" . key nmtoken . value "#empty" .
-                      attributes? . sep_osp . del /\/>[\n]?/ "/>\n" ]
+let empty_element = [ dels "<" . nmtoken_key . value "#empty" .
+                      attributes? . sep_osp . del /\/>[\r?\n]?/ "/>\n" ]
 
 let pi_instruction = [ dels "<?" . label "#pi" .
                        [ label "#target" . store pi_target ] .
@@ -127,7 +147,7 @@ let content1 = element text
 let rec content2 = element (content1|text|comment)
 *)
 
-let rec content = element (text|comment|content|empty_element|pi_instruction)
+let rec content = element (text|comment|content|empty_element|pi_instruction|cdata)
 
 (* Constraints are weaker here, but it's better than being too strict *)
 let doc = (sep_osp . (prolog  | comment | doctype | pi_instruction))* .
@@ -138,6 +158,5 @@ let lns = doc
 
 let filter = (incl "/etc/xml/*.xml")
     . (incl "/etc/xml/catalog")
-    . Util.stdexcl
 
 let xfm = transform lns filter
index e621d8f..a1c0dfb 100644 (file)
@@ -135,10 +135,10 @@ let option = [ indent . del /[oO]ption/ "Option" . label "Option" . sep_spc
 (* View: screen
  * The Screen entry of ServerLayout
  *)
-let screen = [ indent . del /[sS]creen/ "Screen" . label "Screen" . sep_spc
-               . [ label "num" . store int . sep_spc ]?
-               . quoted_string_val
-               . [ sep_spc . label "position" . store to_eol ]?
+let screen = [ indent . del /[sS]creen/ "Screen" . label "Screen"
+               . [ sep_spc . label "num" . store int ]?
+               . ( sep_spc . quoted_string_val
+               . [ sep_spc . label "position" . store to_eol ]? )?
                . eol ]
 
 (* View: input_device *)
@@ -209,6 +209,19 @@ let display = [ indent . del "SubSection" "SubSection" . sep_spc
                        . display_entry*
                        . indent . del "EndSubSection" "EndSubSection" . eol ]
 
+(************************************************************************
+ * Group:                          EXTMOD SUBSECTION
+ *************************************************************************)
+
+let extmod_entry =  entry_str "Option"  /[oO]ption/ |
+                    empty |
+                    comment
+
+let extmod = [ indent . del "SubSection" "SubSection" . sep_spc
+                       . sep_dquote . key "extmod" . sep_dquote
+                       . eol
+                       . extmod_entry*
+                       . indent . del "EndSubSection" "EndSubSection" . eol ]
 
 (************************************************************************
  * Group:                       SECTIONS
@@ -256,6 +269,7 @@ let section_re_obsolete = /(Keyboard|Pointer)/
 let section_entry = option |
                     screen |
                     display |
+                    extmod |
                     input_device |
                     driver |
                     identifier |
@@ -290,8 +304,8 @@ let lns = ( empty | comment | section )*
 
 
 (* Variable: filter *)
-let filter = (incl "/etc/X11/xorg.conf") .
-  (incl "/etc/X11/xorg.conf.d/*.conf") .
-  Util.stdexcl
+let filter = incl "/etc/X11/xorg.conf"
+           . incl "/etc/X11/xorg.conf.d/*.conf"
+           . Util.stdexcl
 
 let xfm = transform lns filter
diff --git a/lenses/xymon.aug b/lenses/xymon.aug
new file mode 100644 (file)
index 0000000..9fc89e3
--- /dev/null
@@ -0,0 +1,55 @@
+(*
+Xymon configuration
+By Jason Kincl - 2012
+*)
+
+module Xymon =
+  autoload xfm
+
+let empty = Util.empty
+let eol = Util.eol
+let word = Rx.word
+let space = Rx.space
+let ip = Rx.ip 
+let del_ws_spc = Util.del_ws_spc
+let value_to_eol = store /[^ \t][^\n]+/
+let eol_no_spc = Util.del_str "\n"
+
+let comment = Util.comment_generic /[ \t]*[;#][ \t]*/ "# "
+let include = [ key /include|dispinclude|netinclude|directory/ . del_ws_spc . value_to_eol . eol_no_spc ]
+let title = [ key "title" . del_ws_spc . value_to_eol . eol_no_spc ]
+
+(* Define host *)
+let tag = del_ws_spc . [ label "tag" . store /[^ \n\t]+/ ] 
+let host_ip = [ label "ip" . store ip ]
+let host_hostname =  [ label "fqdn" . store word ]
+let host_colon = del /[ \t]*#/ " #"
+let host = [ label "host" . host_ip . del space " " . host_hostname . host_colon . tag* . eol ] 
+
+(* Define group-compress and group-only *)
+let group_extra = del_ws_spc . value_to_eol . eol_no_spc . (comment | empty | host | title)*
+let group = [ key "group" . group_extra ]
+let group_compress = [ key "group-compress" . group_extra ]
+
+let group_only_col = [ label "col" . store Rx.word ]
+let group_only_cols = del_ws_spc . group_only_col . ( Util.del_str "|" . group_only_col )*
+let group_only = [ key "group-only" . group_only_cols . group_extra ]
+
+(* Have to use namespacing because page's title overlaps plain title tag *)
+let page_name = store word
+let page_title = [ label "pagetitle" . del_ws_spc . value_to_eol . eol_no_spc ]
+let page_extra = del_ws_spc . page_name . (page_title | eol_no_spc) . (comment | empty | title | include | host)* 
+                                                                     . (group | group_compress | group_only)*
+let page = [ key /page|subpage/ . page_extra ]
+
+let subparent_parent = [ label "parent" . store word ]
+let subparent = [ key "subparent" . del_ws_spc . subparent_parent . page_extra ]
+
+let ospage = [ key "ospage" . del_ws_spc . store word . del_ws_spc . [ label "ospagetitle" . value_to_eol . eol_no_spc ] ]
+
+let lns = (empty | comment | include | host | title | ospage )* . (group | group_compress | group_only)* . (page | subparent)*
+
+let filter = incl "/etc/xymon/hosts.cfg" . incl "/etc/xymon/pages.cfg"
+
+let xfm = transform lns filter
+
diff --git a/lenses/xymon_alerting.aug b/lenses/xymon_alerting.aug
new file mode 100644 (file)
index 0000000..d4265a8
--- /dev/null
@@ -0,0 +1,199 @@
+(*
+Module: Xymon_Alerting
+  Parses xymon alerting files 
+
+Author: Francois Maillard <fmaillard@gmail.com>
+
+About: Reference
+  This lens tries to keep as close as possible to `man 5 alerts.cfg` where possible.
+
+About: License
+   This file is licenced under the LGPL v2+, like the rest of Augeas.
+
+About: Lens Usage
+   To be documented
+
+About: Not supported
+   File inclusion are not followed
+
+About: Configuration files
+   This lens applies to /etc/xymon/alerts.d/*.cfg and /etc/xymon/alerts.cfg. See <filter>.
+
+About: Examples
+   The <Test_Xymon_Alerting> file contains various examples and tests.
+*)
+
+module Xymon_Alerting =
+    autoload xfm
+
+    (************************************************************************
+     * Group:                 USEFUL PRIMITIVES
+     *************************************************************************)
+
+    (* View: store_word *)
+    let store_word  = store /[^ =\t\n#]+/
+
+    (* View: comparison The greater and lesser than operators *)
+    let comparison  = store /[<>]/
+
+    (* View: equal *)
+    let equal       = Sep.equal
+
+    (* View: ws *)
+    let ws          = Sep.space
+
+    (* View: eol *)
+    let eol         = Util.eol
+
+    (* View: ws_or_eol *)
+    let ws_or_eol   = del /([ \t]+|[ \t]*\n[ \t]*)/ " "
+
+    (* View: comment *)
+    let comment = Util.comment
+
+    (* View: empty *)
+    let empty   = Util.empty
+
+    (* View: include *)
+    let include         = [ key "include" . ws . store_word . eol ]
+
+    (************************************************************************
+     * Group:                 MACRO DEFINITION
+     *************************************************************************)
+
+    (* View: macrodefinition
+         A string that starts with $ and that is assigned something *)
+    let macrodefinition = [ key /\$[^ =\t\n#\/]+/ . Sep.space_equal . store Rx.space_in . eol ]
+
+
+    (* View: flag
+         A flag value *)
+    let flag (kw:string) = Build.flag kw
+
+    (* View: kw_word
+         A key=value value *)
+    let kw_word (kw:regexp) = Build.key_value kw equal store_word
+
+    (************************************************************************
+     * Group:                 FILTERS 
+     *************************************************************************)
+
+    (* View: page
+         The (ex)?page filter definition *)
+    let page      = kw_word /(EX)?PAGE/
+
+    (* View: group
+         The (ex)?group filter definition *)
+    let group     = kw_word /(EX)?GROUP/
+
+    (* View: host
+         The (ex)?host filter definition *)
+    let host      = kw_word /(EX)?HOST/
+
+    (* View: service
+         The (ex)?service filter definition *)
+    let service   = kw_word /(EX)?SERVICE/
+
+    (* View: color
+         The color filter definition *)
+    let color     = kw_word "COLOR"
+
+    (* View: time
+         The time filter definition *)
+    let time      = kw_word "TIME"
+
+    (* View: duration
+         The duration filter definition *)
+    let duration  = [ key "DURATION" . [ label "operator" . comparison ] . [ label "value" . store_word ] ]
+    (* View: recover
+         The recover filter definition *)
+    let recover   = flag "RECOVER"
+    (* View: notice
+         The notice filter definition *)
+    let notice    = flag "NOTICE"
+
+    (* View: rule_filter
+         Filters are made out of any of the above filter definitions *)
+    let rule_filter = page | group | host | service
+                    | color | time | duration | recover | notice
+
+    (* View: filters
+         One or more filters *)
+    let filters = [ label "filters" . Build.opt_list rule_filter ws ]
+
+    (* View: filters_opt
+         Zero, one or more filters *)
+    let filters_opt = [ label "filters" . (ws . Build.opt_list rule_filter ws)? ]
+
+    (* View: kw_word_filters_opt
+         A <kw_word> entry with optional filters *)
+    let kw_word_filters_opt (kw:string) = [ key kw . equal . store_word . filters_opt ]
+
+    (* View: flag_filters_opt
+         A <flag> with optional filters *) 
+    let flag_filters_opt (kw:string) = [ key kw . filters_opt ]
+
+    (************************************************************************
+     * Group:                 RECIPIENTS
+     *************************************************************************)
+
+    (* View: mail
+         The mail recipient definition *)
+    let mail      = [ key "MAIL" . ws . store_word . filters_opt ]
+
+    (* View: script
+         The script recipient definition *)
+    let script    = [ key "SCRIPT" . ws . [ label "script" . store_word ]
+                  . ws . [ label "recipient" . store_word ] . filters_opt ]
+
+    (* View: ignore
+         The ignore recipient definition *)
+    let ignore    = flag_filters_opt "IGNORE"
+
+    (* View: format
+         The format recipient definition *)
+    let format    = kw_word_filters_opt "FORMAT"
+
+    (* View: repeat
+         The repeat recipient definition *)
+    let repeat    = kw_word_filters_opt "REPEAT"
+
+    (* View: unmatched
+         The unmatched recipient definition *)
+    let unmatched = flag_filters_opt "UNMATCHED"
+
+    (* View: stop
+         The stop recipient definition *)
+    let stop      = flag_filters_opt "STOP"
+
+    (* View: macro
+         The macro recipient definition *)
+    let macro     = [ key /\$[^ =\t\n#\/]+/ . filters_opt ]
+
+    (* View: recipient
+         Recipients are made out of any of the above recipient definitions *)
+    let recipient = mail | script | ignore | format | repeat | unmatched
+                  | stop | macro
+
+    let recipients = [ label "recipients" . Build.opt_list recipient ws_or_eol ]
+
+
+    (************************************************************************
+     * Group:                 RULES
+     *************************************************************************)
+
+    (* View: rule
+         Rules are made of rule_filter and then recipients sperarated by a whitespace *)
+    let rule = [ seq "rules" . filters . ws_or_eol . recipients . eol ] 
+
+    (* View: lns
+         The Xymon_Alerting lens *)
+    let lns = ( rule | macrodefinition | include | empty | comment )*
+
+    (* Variable: filter *)
+    let filter = incl "/etc/xymon/alerts.d/*.cfg"
+               . incl "/etc/xymon/alerts.cfg"
+               . Util.stdexcl
+
+    let xfm = transform lns filter
+
index d6eeb81..035d81a 100644 (file)
@@ -2,55 +2,55 @@
 module Yum =
   autoload xfm
 
-  let eol = Util.del_str "\n"
+(************************************************************************
+ * INI File settings
+ *************************************************************************)
 
-  let key_re = /[^#;:= \t\n[\/]+/ - /baseurl|gpgkey/
+let comment  = IniFile.comment "#" "#"
+let sep      = IniFile.sep "=" "="
+let empty    = Util.empty
+let eol      = IniFile.eol
 
-  let eq = del /[ \t]*[:=][ \t]*/ "="
-  let secname = /[^]\/]+/
+(************************************************************************
+ *                        ENTRY
+ *************************************************************************)
 
-  let value = /[^ \t\n][^\n]*/
+let list_entry (list_key:string)  =
+  let list_value = store /[^# \t\r\n,][^ \t\r\n,]*[^# \t\r\n,]|[^# \t\r\n,]/ in
+  let list_sep = del /([ \t]*(,[ \t]*|\r?\n[ \t]+))|[ \t]+/ "\n\t" in
+  [ key list_key . sep . Sep.opt_space . list_value ]
+  . (list_sep . Build.opt_list [ label list_key . list_value ] list_sep)?
+  . eol
 
-  (* We really need to allow comments starting with REM and rem but that     *)
-  (* leads to ambiguities with keys 'rem=' and 'REM=' The regular expression *)
-  (* to do that cleanly is somewhat annoying to craft by hand; we'd need to  *)
-  (* define KEY_RE as /[A-Za-z0-9]+/ - "REM" - "rem"                         *)
-  let comment = [ del /([;#].*)?[ \t]*\n/ "\n" ]
+let entry_re = IniFile.entry_re - ("baseurl" | "gpgkey" | "exclude")
 
-  let list_sep = del /([ \t]*(,[ \t]*|\n[ \t]+))|[ \t]+/ "\n\t"
-  let list_value = store /[^ \t\n,]+/
+let entry       = IniFile.entry entry_re sep comment
+                | empty
 
-  let kv_list(s:string) =
-    [ key s . eq . list_value ] .
-      [ list_sep . label s . list_value ]* . eol
+let entries =
+     let list_entry_elem (k:string) = list_entry k . entry*
+  in entry*
+   | entry* . Build.combine_three_opt
+                (list_entry_elem "baseurl")
+                (list_entry_elem "gpgkey")
+                (list_entry_elem "exclude")
 
-  let kv = [ key key_re . eq . store value . eol ]
 
-  let sechead = Util.del_str "[" . key secname . Util.del_str "]"
-      . del /[ \t]*[;#]?.*/ ""
-      . eol
+(***********************************************************************a
+ *                         TITLE
+ *************************************************************************)
+let title       = IniFile.title IniFile.record_re
+let record      = [ title . entries ]
 
-  let entry = comment | kv
 
-  (* A section is a section head, followed by any number of key value    *)
-  (* entries, with comments and blank lines freely interspersed. The     *)
-  (* continuation lines allowed for baseurl entries make this a little   *)
-  (* more interesting: there can be at most one baseurl entry in each    *)
-  (* section (more precisely, yum will only obey one of them, but we act *)
-  (* as if yum would actually barf)                                      *)
-  let section =
-    let list_baseurl = kv_list "baseurl" in
-      let list_gpgkey = kv_list "gpgkey" in
-    [ sechead . (  entry*
-                 | entry* . list_baseurl . entry*
-                 | entry* . list_gpgkey . entry*
-                 | entry* . list_baseurl . entry* . list_gpgkey . entry*
-                 | entry* . list_gpgkey . entry* . list_baseurl . entry*)]
-
-  let lns = (comment) * . (section) *
+(************************************************************************
+ *                         LENS & FILTER
+ *************************************************************************)
+let lns    = (empty | comment)* . record*
 
   let filter = (incl "/etc/yum.conf")
-      . (incl "/etc/yum.repos.d/*")
+      . (incl "/etc/yum.repos.d/*.repo")
+      . (incl "/etc/yum/yum-cron*.conf") 
       . (incl "/etc/yum/pluginconf.d/*")
       . (excl "/etc/yum/pluginconf.d/versionlock.list")
       . Util.stdexcl
index ea5c7a1..e635575 100644 (file)
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in 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.
 
 @SET_MAKE@
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -33,13 +77,14 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = man
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/alloca.m4 \
        $(top_srcdir)/gnulib/m4/argz.m4 \
        $(top_srcdir)/gnulib/m4/btowc.m4 \
        $(top_srcdir)/gnulib/m4/canonicalize.m4 \
+       $(top_srcdir)/gnulib/m4/close.m4 \
        $(top_srcdir)/gnulib/m4/codeset.m4 \
        $(top_srcdir)/gnulib/m4/configmake.m4 \
        $(top_srcdir)/gnulib/m4/ctype.m4 \
@@ -48,24 +93,33 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/eealloc.m4 \
        $(top_srcdir)/gnulib/m4/environ.m4 \
        $(top_srcdir)/gnulib/m4/errno_h.m4 \
+       $(top_srcdir)/gnulib/m4/exponentd.m4 \
        $(top_srcdir)/gnulib/m4/extensions.m4 \
        $(top_srcdir)/gnulib/m4/fcntl-o.m4 \
        $(top_srcdir)/gnulib/m4/fcntl_h.m4 \
+       $(top_srcdir)/gnulib/m4/fdopen.m4 \
        $(top_srcdir)/gnulib/m4/float_h.m4 \
        $(top_srcdir)/gnulib/m4/fnmatch.m4 \
+       $(top_srcdir)/gnulib/m4/fpieee.m4 \
+       $(top_srcdir)/gnulib/m4/fstat.m4 \
+       $(top_srcdir)/gnulib/m4/getcwd.m4 \
        $(top_srcdir)/gnulib/m4/getdelim.m4 \
        $(top_srcdir)/gnulib/m4/getline.m4 \
        $(top_srcdir)/gnulib/m4/getopt.m4 \
        $(top_srcdir)/gnulib/m4/getpagesize.m4 \
+       $(top_srcdir)/gnulib/m4/gettimeofday.m4 \
        $(top_srcdir)/gnulib/m4/glibc21.m4 \
        $(top_srcdir)/gnulib/m4/gnulib-common.m4 \
        $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \
        $(top_srcdir)/gnulib/m4/include_next.m4 \
        $(top_srcdir)/gnulib/m4/intlmacosx.m4 \
        $(top_srcdir)/gnulib/m4/intmax_t.m4 \
+       $(top_srcdir)/gnulib/m4/inttypes-pri.m4 \
+       $(top_srcdir)/gnulib/m4/inttypes.m4 \
        $(top_srcdir)/gnulib/m4/inttypes_h.m4 \
        $(top_srcdir)/gnulib/m4/isblank.m4 \
        $(top_srcdir)/gnulib/m4/langinfo_h.m4 \
+       $(top_srcdir)/gnulib/m4/largefile.m4 \
        $(top_srcdir)/gnulib/m4/lcmessage.m4 \
        $(top_srcdir)/gnulib/m4/lib-ld.m4 \
        $(top_srcdir)/gnulib/m4/lib-link.m4 \
@@ -77,6 +131,7 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/locale-tr.m4 \
        $(top_srcdir)/gnulib/m4/locale-zh.m4 \
        $(top_srcdir)/gnulib/m4/locale_h.m4 \
+       $(top_srcdir)/gnulib/m4/localeconv.m4 \
        $(top_srcdir)/gnulib/m4/localename.m4 \
        $(top_srcdir)/gnulib/m4/lock.m4 \
        $(top_srcdir)/gnulib/m4/longlong.m4 \
@@ -94,15 +149,21 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/mbtowc.m4 \
        $(top_srcdir)/gnulib/m4/memchr.m4 \
        $(top_srcdir)/gnulib/m4/mempcpy.m4 \
+       $(top_srcdir)/gnulib/m4/mkstemp.m4 \
        $(top_srcdir)/gnulib/m4/mmap-anon.m4 \
        $(top_srcdir)/gnulib/m4/mode_t.m4 \
+       $(top_srcdir)/gnulib/m4/msvc-inval.m4 \
+       $(top_srcdir)/gnulib/m4/msvc-nothrow.m4 \
        $(top_srcdir)/gnulib/m4/multiarch.m4 \
        $(top_srcdir)/gnulib/m4/nl_langinfo.m4 \
+       $(top_srcdir)/gnulib/m4/nocrash.m4 \
+       $(top_srcdir)/gnulib/m4/off_t.m4 \
        $(top_srcdir)/gnulib/m4/onceonly.m4 \
        $(top_srcdir)/gnulib/m4/open.m4 \
        $(top_srcdir)/gnulib/m4/pathmax.m4 \
        $(top_srcdir)/gnulib/m4/printf.m4 \
        $(top_srcdir)/gnulib/m4/putenv.m4 \
+       $(top_srcdir)/gnulib/m4/rawmemchr.m4 \
        $(top_srcdir)/gnulib/m4/readlink.m4 \
        $(top_srcdir)/gnulib/m4/realloc.m4 \
        $(top_srcdir)/gnulib/m4/regex.m4 \
@@ -122,13 +183,18 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/stdlib_h.m4 \
        $(top_srcdir)/gnulib/m4/stpcpy.m4 \
        $(top_srcdir)/gnulib/m4/stpncpy.m4 \
+       $(top_srcdir)/gnulib/m4/strchrnul.m4 \
        $(top_srcdir)/gnulib/m4/string_h.m4 \
        $(top_srcdir)/gnulib/m4/strndup.m4 \
        $(top_srcdir)/gnulib/m4/strnlen.m4 \
        $(top_srcdir)/gnulib/m4/strstr.m4 \
        $(top_srcdir)/gnulib/m4/symlink.m4 \
+       $(top_srcdir)/gnulib/m4/sys_socket_h.m4 \
        $(top_srcdir)/gnulib/m4/sys_stat_h.m4 \
+       $(top_srcdir)/gnulib/m4/sys_time_h.m4 \
+       $(top_srcdir)/gnulib/m4/sys_types_h.m4 \
        $(top_srcdir)/gnulib/m4/sys_wait_h.m4 \
+       $(top_srcdir)/gnulib/m4/tempname.m4 \
        $(top_srcdir)/gnulib/m4/thread.m4 \
        $(top_srcdir)/gnulib/m4/threadlib.m4 \
        $(top_srcdir)/gnulib/m4/time_h.m4 \
@@ -152,14 +218,25 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_$(V))
-am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
-am__v_GEN_0 = @echo "  GEN   " $@;
-AM_V_at = $(am__v_at_$(V))
-am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
 am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -181,10 +258,17 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 man1dir = $(mandir)/man1
 am__installdirs = "$(DESTDIR)$(man1dir)"
 NROFF = nroff
 MANS = $(man1_MANS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 pkglibexecdir = @pkglibexecdir@
 ACLOCAL = @ACLOCAL@
@@ -194,6 +278,7 @@ AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 AR = @AR@
+ARFLAGS = @ARFLAGS@
 ARGZ_H = @ARGZ_H@
 AUGEAS_CFLAGS = @AUGEAS_CFLAGS@
 AUTOCONF = @AUTOCONF@
@@ -237,9 +322,11 @@ GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
 GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
+GNULIB_CHDIR = @GNULIB_CHDIR@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
+GNULIB_DUP = @GNULIB_DUP@
 GNULIB_DUP2 = @GNULIB_DUP2@
 GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
@@ -251,16 +338,25 @@ 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_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FFSL = @GNULIB_FFSL@
+GNULIB_FFSLL = @GNULIB_FFSLL@
+GNULIB_FGETC = @GNULIB_FGETC@
+GNULIB_FGETS = @GNULIB_FGETS@
 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_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@
@@ -268,6 +364,8 @@ 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@
@@ -280,8 +378,14 @@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
 GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
+GNULIB_IMAXABS = @GNULIB_IMAXABS@
+GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
+GNULIB_ISATTY = @GNULIB_ISATTY@
 GNULIB_ISBLANK = @GNULIB_ISBLANK@
 GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
 GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
@@ -289,6 +393,7 @@ GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
 GNULIB_LINKAT = @GNULIB_LINKAT@
+GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
@@ -329,25 +434,31 @@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
 GNULIB_MKTIME = @GNULIB_MKTIME@
 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_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_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
 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_RANDOM = @GNULIB_RANDOM@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
 GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
+GNULIB_READ = @GNULIB_READ@
 GNULIB_READLINK = @GNULIB_READLINK@
 GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
@@ -357,12 +468,15 @@ GNULIB_RENAME = @GNULIB_RENAME@
 GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
 GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
+GNULIB_SCANF = @GNULIB_SCANF@
 GNULIB_SETENV = @GNULIB_SETENV@
+GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
 GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
 GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
 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@
@@ -380,9 +494,11 @@ 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@
@@ -392,7 +508,7 @@ GNULIB_TIME_R = @GNULIB_TIME_R@
 GNULIB_TMPFILE = @GNULIB_TMPFILE@
 GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
 GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
-GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
+GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
 GNULIB_UNLINK = @GNULIB_UNLINK@
 GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
@@ -404,8 +520,10 @@ 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@
@@ -454,6 +572,7 @@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
 HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
 HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
 HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
 HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
@@ -464,18 +583,23 @@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 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_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
 HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
 HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
@@ -491,7 +615,10 @@ HAVE_FCHDIR = @HAVE_FCHDIR@
 HAVE_FCHMODAT = @HAVE_FCHMODAT@
 HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
 HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
 HAVE_FSEEKO = @HAVE_FSEEKO@
 HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
@@ -505,7 +632,9 @@ HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
 HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
 HAVE_ISBLANK = @HAVE_ISBLANK@
 HAVE_ISWBLANK = @HAVE_ISWBLANK@
@@ -539,15 +668,21 @@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
 HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
 HAVE_MKSTEMP = @HAVE_MKSTEMP@
 HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
 HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OPENAT = @HAVE_OPENAT@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
 HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
 HAVE_PREAD = @HAVE_PREAD@
 HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
 HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_RANDOM = @HAVE_RANDOM@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
 HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -557,6 +692,7 @@ HAVE_REALPATH = @HAVE_REALPATH@
 HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
 HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
@@ -573,6 +709,7 @@ HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
 HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
 HAVE_SYMLINK = @HAVE_SYMLINK@
 HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
@@ -580,6 +717,7 @@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
 HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
 HAVE_TIMEGM = @HAVE_TIMEGM@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
@@ -621,6 +759,7 @@ HAVE_WCSXFRM = @HAVE_WCSXFRM@
 HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
 HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
 HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WMEMCHR = @HAVE_WMEMCHR@
 HAVE_WMEMCMP = @HAVE_WMEMCMP@
@@ -637,6 +776,8 @@ INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 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@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
@@ -682,6 +823,7 @@ 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_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
 NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
 NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H = @NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H@
@@ -691,6 +833,8 @@ 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_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_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@
@@ -701,6 +845,7 @@ 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_INTTYPES_H = @NEXT_INTTYPES_H@
 NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_LOCALE_H = @NEXT_LOCALE_H@
 NEXT_SELINUX_SELINUX_H = @NEXT_SELINUX_SELINUX_H@
@@ -710,6 +855,8 @@ NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
 NEXT_STRING_H = @NEXT_STRING_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_WAIT_H = @NEXT_SYS_WAIT_H@
 NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
@@ -736,6 +883,8 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 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@
@@ -752,6 +901,7 @@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
 REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
@@ -763,6 +913,7 @@ REPLACE_FSTAT = @REPLACE_FSTAT@
 REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
 REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
 REPLACE_GETDELIM = @REPLACE_GETDELIM@
@@ -771,11 +922,15 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISATTY = @REPLACE_ISATTY@
 REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ITOLD = @REPLACE_ITOLD@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
 REPLACE_LINK = @REPLACE_LINK@
 REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALECONV = @REPLACE_LOCALECONV@
 REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
@@ -804,8 +959,11 @@ REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
 REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
 REPLACE_REALLOC = @REPLACE_REALLOC@
 REPLACE_REALPATH = @REPLACE_REALPATH@
@@ -819,9 +977,11 @@ REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
 REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
 REPLACE_STPNCPY = @REPLACE_STPNCPY@
 REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
 REPLACE_STRDUP = @REPLACE_STRDUP@
 REPLACE_STRERROR = @REPLACE_STRERROR@
 REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
@@ -831,10 +991,14 @@ REPLACE_STRNLEN = @REPLACE_STRNLEN@
 REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
 REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
 REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
+REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
 REPLACE_SYMLINK = @REPLACE_SYMLINK@
 REPLACE_TIMEGM = @REPLACE_TIMEGM@
 REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
 REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
 REPLACE_UNLINK = @REPLACE_UNLINK@
 REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
@@ -867,6 +1031,8 @@ STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+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_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
@@ -874,6 +1040,8 @@ VERSION = @VERSION@
 VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@
 WARN_CFLAGS = @WARN_CFLAGS@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 YACC = @YACC@
 YFLAGS = @YFLAGS@
@@ -979,9 +1147,18 @@ clean-libtool:
        -rm -rf .libs _libs
 install-man1: $(man1_MANS)
        @$(NORMAL_INSTALL)
-       test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
-       @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
-       { for i in $$list; do echo "$$i"; done; \
+       @list1='$(man1_MANS)'; \
+       list2=''; \
+       test -n "$(man1dir)" \
+         && test -n "`echo $$list1$$list2`" \
+         || exit 0; \
+       echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+       $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+       { for i in $$list1; do echo "$$i"; done;  \
+       if test -n "$$list2"; then \
+         for i in $$list2; do echo "$$i"; done \
+           | sed -n '/\.1[a-z]*$$/p'; \
+       fi; \
        } | while read p; do \
          if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; echo "$$p"; \
@@ -1008,30 +1185,15 @@ uninstall-man1:
        files=`{ for i in $$list; do echo "$$i"; done; \
        } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
              -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
-       test -z "$$files" || { \
-         echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
-         cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
-tags: TAGS
-TAGS:
+       dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
+tags TAGS:
+
+ctags CTAGS:
 
-ctags: CTAGS
-CTAGS:
+cscope cscopelist:
 
 
 distdir: $(DISTFILES)
-       @list='$(MANS)'; if test -n "$$list"; then \
-         list=`for p in $$list; do \
-           if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-           if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
-         if test -n "$$list" && \
-           grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-           echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
-           grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
-           echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-           echo "       typically \`make maintainer-clean' will remove them" >&2; \
-           exit 1; \
-         else :; fi; \
-       else :; fi
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -1078,10 +1240,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
 mostlyclean-generic:
 
 clean-generic:
@@ -1164,16 +1331,17 @@ uninstall-man: uninstall-man1
 .MAKE: install-am install-strip
 
 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
-       distclean distclean-generic distclean-libtool 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-man1 \
-       install-pdf install-pdf-am install-ps install-ps-am \
-       install-strip installcheck installcheck-am installdirs \
-       maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-       uninstall uninstall-am uninstall-man uninstall-man1
+       cscopelist-am ctags-am distclean distclean-generic \
+       distclean-libtool 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-man1 install-pdf install-pdf-am install-ps \
+       install-ps-am install-strip installcheck installcheck-am \
+       installdirs maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+       ps ps-am tags-am uninstall uninstall-am uninstall-man \
+       uninstall-man1
 
 
 %.1: %.pod
index cd4ab6e..8702e6d 100644 (file)
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
+.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.20)
 .\"
 .\" Standard preamble:
 .\" ========================================================================
 .\" ========================================================================
 .\"
 .IX Title "AUGPARSE 1"
-.TH AUGPARSE 1 "2011-11-29" "Augeas 0.9.0" "Augeas"
+.TH AUGPARSE 1 "2013-02-06" "Augeas 1.0.0" "Augeas"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
@@ -139,12 +139,15 @@ augparse [\s-1OPTIONS\s0] \s-1MODULE\s0
 Execute an Augeas module, most commonly to evaluate the tests it contains.
 .SH "OPTIONS"
 .IX Header "OPTIONS"
-.IP "\fB\-I\fR \fI\s-1DIR\s0\fR" 4
-.IX Item "-I DIR"
+.IP "\fB\-I\fR, \fB\-\-include\fR=\fI\s-1DIR\s0\fR" 4
+.IX Item "-I, --include=DIR"
 Add \s-1DIR\s0 to the module loadpath. Can be given multiple times. The
 directories set here are searched before any directories specified in the
 \&\s-1AUGEAS_LENS_LIB\s0 environment variable, and before the default directory
 \&\fI/usr/share/augeas/lenses\fR.
+.IP "\fB\-t\fR, \fB\-\-trace\fR" 4
+.IX Item "-t, --trace"
+Print a trace of the modules that are being loaded.
 .IP "\fB\-\-nostdinc\fR" 4
 .IX Item "--nostdinc"
 Do not search any of the default directories for modules. When this option
index 15e84f0..5221a64 100644 (file)
@@ -14,13 +14,17 @@ Execute an Augeas module, most commonly to evaluate the tests it contains.
 
 =over 4
 
-=item B<-I> I<DIR>
+=item B<-I>, B<--include>=I<DIR>
 
 Add DIR to the module loadpath. Can be given multiple times. The
 directories set here are searched before any directories specified in the
 AUGEAS_LENS_LIB environment variable, and before the default directory
 F</usr/share/augeas/lenses>.
 
+=item B<-t>, B<--trace>
+
+Print a trace of the modules that are being loaded.
+
 =item B<--nostdinc>
 
 Do not search any of the default directories for modules. When this option
index a21aea7..090c48e 100644 (file)
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
+.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28)
 .\"
 .\" Standard preamble:
 .\" ========================================================================
@@ -38,6 +38,8 @@
 .    ds PI \(*p
 .    ds L" ``
 .    ds R" ''
+.    ds C`
+.    ds C'
 'br\}
 .\"
 .\" Escape single quotes in literal strings from groff's Unicode transform.
 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
 .\" entries marked with X<> in POD.  Of course, you'll have to process the
 .\" output yourself in some meaningful fashion.
-.ie \nF \{\
-.    de IX
-.    tm Index:\\$1\t\\n%\t"\\$2"
+.\"
+.\" Avoid warning from groff about undefined register 'F'.
+.de IX
 ..
-.    nr % 0
-.    rr F
-.\}
-.el \{\
-.    de IX
+.nr rF 0
+.if \n(.g .if rF .nr rF 1
+.if (\n(rF:(\n(.g==0)) \{
+.    if \nF \{
+.        de IX
+.        tm Index:\\$1\t\\n%\t"\\$2"
 ..
+.        if !\nF==2 \{
+.            nr % 0
+.            nr F 2
+.        \}
+.    \}
 .\}
+.rr rF
 .\"
 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
 .\" ========================================================================
 .\"
 .IX Title "AUGTOOL 1"
-.TH AUGTOOL 1 "2011-12-01" "Augeas 0.9.0" "Augeas"
+.TH AUGTOOL 1 "2014-06-04" "Augeas 1.2.0" "Augeas"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
@@ -142,8 +151,8 @@ changes are made by manipulating this tree and saving it back into
 native config files.
 .PP
 augtool provides a command line interface to the generated tree. \s-1COMMAND\s0
-can be a single command as described under \*(L"\s-1COMMANDS\s0\*(R". When called with
-no \s-1COMMAND\s0, it reads commands from standard input until an end-of-file is
+can be a single command as described under \*(L"\s-1COMMANDS\*(R"\s0. When called with
+no \s-1COMMAND,\s0 it reads commands from standard input until an end-of-file is
 encountered.
 .SH "OPTIONS"
 .IX Header "OPTIONS"
@@ -167,18 +176,22 @@ root set with the \s-1AUGEAS_ROOT\s0 environment variable.
 .IX Item "-I, --include=DIR"
 Add \s-1DIR\s0 to the module loadpath. Can be given multiple times. The
 directories set here are searched before any directories specified in the
-\&\s-1AUGEAS_LENS_LIB\s0 environment variable, and before the default directory
-\&\fI/usr/share/augeas/lenses\fR.
+\&\s-1AUGEAS_LENS_LIB\s0 environment variable, and before the default directories
+\&\fI/usr/share/augeas/lenses\fR and \fI/usr/share/augeas/lenses/dist\fR.
+.IP "\fB\-t\fR, \fB\-\-transform\fR=\fI\s-1XFM\s0\fR" 4
+.IX Item "-t, --transform=XFM"
+Add a file transform; uses the 'transform' command syntax,
+e.g. \f(CW\*(C`\-t \*(AqFstab incl /etc/fstab.bak\*(Aq\*(C'\fR.
 .IP "\fB\-f\fR, \fB\-\-file\fR=\fI\s-1FILE\s0\fR" 4
 .IX Item "-f, --file=FILE"
-Read commands from \s-1FILE\s0.
+Read commands from \s-1FILE.\s0
 .IP "\fB\-i\fR, \fB\-\-interactive\fR" 4
 .IX Item "-i, --interactive"
 Read commands from the terminal. When combined with \fB\-f\fR or redirection of
 stdin, drop into an interactive session after executing the commands from
 the file.
-.IP "\fB\-e\fR" 4
-.IX Item "-e"
+.IP "\fB\-e\fR, \fB\-\-echo\fR" 4
+.IX Item "-e, --echo"
 When reading commands from a file via stdin, echo the commands before
 printing their output.
 .IP "\fB\-s\fR, \fB\-\-autosave\fR" 4
@@ -200,6 +213,10 @@ Do not load any lens modules, and therefore no files, on startup. This
 creates no entries under \f(CW\*(C`/augeas/load\*(C'\fR whatsoever; to read any files,
 they need to be set up manually and loading must be initiated with a
 \&\f(CW\*(C`load\*(C'\fR command. Using this option gives the fastest startup.
+.IP "\fB\-\-span\fR" 4
+.IX Item "--span"
+Load span positions for nodes in the tree, as they relate to the original
+file. Enables the use of the \fBspan\fR command to retrieve position data.
 .IP "\fB\-\-version\fR" 4
 .IX Item "--version"
 Print version information and exit. The version is also in the tree under
@@ -214,85 +231,142 @@ separated by \f(CW\*(C`/\*(C'\fR. In each segment, the character \f(CW\*(C`*\*(C
 every node regardless of its label. Sibling nodes with identical labels can
 be distinguished by appending \f(CW\*(C`[N]\*(C'\fR to their label to match the N\-th
 sibling with such a label. The last sibling with a specific label can be
-reached as \f(CW\*(C`[last()]\*(C'\fR. See \*(L"\s-1EXAMPLES\s0\*(R" for some examples of this.
+reached as \f(CW\*(C`[last()]\*(C'\fR. See \*(L"\s-1EXAMPLES\*(R"\s0 for some examples of this.
+.SS "\s-1ADMIN COMMANDS\s0"
+.IX Subsection "ADMIN COMMANDS"
+The following commands control the behavior of Augeas and augtool itself.
+.IP "\fBhelp\fR" 4
+.IX Item "help"
+Print this help text
+.IP "\fBload\fR" 4
+.IX Item "load"
+Load files according to the transforms in \f(CW\*(C`/augeas/load\*(C'\fR.
 .IP "\fBquit\fR" 4
 .IX Item "quit"
 Exit the program
+.IP "\fBretrieve\fR <\s-1LENS\s0> <\s-1NODE_IN\s0> <\s-1PATH\s0> <\s-1NODE_OUT\s0>" 4
+.IX Item "retrieve <LENS> <NODE_IN> <PATH> <NODE_OUT>"
+Transform tree at \s-1PATH\s0 back into text using lens \s-1LENS\s0 and store the
+resulting string at \s-1NODE_OUT.\s0 Assume that the tree was initially read in
+with the same lens and the string stored at \s-1NODE_IN\s0 as input.
+.IP "\fBsave\fR" 4
+.IX Item "save"
+Save all pending changes to disk. Unless either the \fB\-b\fR or \fB\-n\fR
+command line options are given, files are changed in place.
+.IP "\fBstore\fR <\s-1LENS\s0> <\s-1NODE\s0> <\s-1PATH\s0>" 4
+.IX Item "store <LENS> <NODE> <PATH>"
+Parse \s-1NODE\s0 using \s-1LENS\s0 and store the resulting tree at \s-1PATH.\s0
+.IP "\fBtransform\fR <\s-1LENS\s0> <\s-1FILTER\s0> <\s-1FILE\s0>" 4
+.IX Item "transform <LENS> <FILTER> <FILE>"
+Add a transform for \s-1FILE\s0 using \s-1LENS.\s0 The \s-1LENS\s0 may be a module name or a
+full lens name.  If a module name is given, then \*(L"lns\*(R" will be the lens
+assumed.  The \s-1FILTER\s0 must be either \*(L"incl\*(R" or \*(L"excl\*(R".  If the filter is
+\&\*(L"incl\*(R",  the \s-1FILE\s0 will be parsed by the \s-1LENS. \s0 If the filter is \*(L"excl\*(R",
+the \s-1FILE\s0 will be excluded from the \s-1LENS. FILE\s0 may contain wildcards.
+.SS "\s-1READ COMMANDS\s0"
+.IX Subsection "READ COMMANDS"
+The following commands are used to retrieve data from the Augeas tree.
+.IP "\fBdump-xml\fR \fI[<\s-1PATH\s0>]\fR" 4
+.IX Item "dump-xml [<PATH>]"
+Print entries in the tree as \s-1XML.\s0 If \s-1PATH\s0 is given, printing starts there,
+otherwise the whole tree is printed.
+.IP "\fBget\fR <\s-1PATH\s0>" 4
+.IX Item "get <PATH>"
+Print the value associated with \s-1PATH\s0
+.IP "\fBlabel\fR <\s-1PATH\s0>" 4
+.IX Item "label <PATH>"
+Get and print the label associated with \s-1PATH\s0
 .IP "\fBls\fR <\s-1PATH\s0>" 4
 .IX Item "ls <PATH>"
 List the direct children of \s-1PATH\s0
 .IP "\fBmatch\fR <\s-1PATTERN\s0> [<\s-1VALUE\s0>]" 4
 .IX Item "match <PATTERN> [<VALUE>]"
-Find all paths that match \s-1PATTERN\s0. If \s-1VALUE\s0 is given, only the matching
+Find all paths that match \s-1PATTERN.\s0 If \s-1VALUE\s0 is given, only the matching
 paths whose value equals \s-1VALUE\s0 are printed
-.IP "\fBrm\fR <\s-1PATH\s0>" 4
-.IX Item "rm <PATH>"
-Delete \s-1PATH\s0 and all its children from the tree
+.IP "\fBprint\fR \fI[<\s-1PATH\s0>]\fR" 4
+.IX Item "print [<PATH>]"
+Print entries in the tree. If \s-1PATH\s0 is given, printing starts there,
+otherwise the whole tree is printed
+.IP "\fBspan\fR <\s-1PATH\s0>" 4
+.IX Item "span <PATH>"
+Print the name of the file from which the node \s-1PATH\s0 was generated, as well
+as information about the positions in the file corresponding to the label,
+the value, and the entire node. \s-1PATH\s0 must match exactly one node.
+.Sp
+You need to run 'set /augeas/span enable' prior to loading files to enable
+recording of span information. It is disabled by default.
+.SS "\s-1WRITE COMMANDS\s0"
+.IX Subsection "WRITE COMMANDS"
+The following commands are used to modify the Augeas tree.
+.IP "\fBclear\fR <\s-1PATH\s0>" 4
+.IX Item "clear <PATH>"
+Set the value for \s-1PATH\s0 to \s-1NULL.\s0 If \s-1PATH\s0 is not in the tree yet, it and all
+its ancestors will be created.
+.IP "\fBclearm\fR <\s-1BASE\s0> <\s-1SUB\s0>" 4
+.IX Item "clearm <BASE> <SUB>"
+Clear multiple nodes values in one operation. Find or create a node matching \s-1SUB\s0
+by interpreting \s-1SUB\s0 as a path expression relative to each node matching
+\&\s-1BASE.\s0 If \s-1SUB\s0 is '.', the nodes matching \s-1BASE\s0 will be modified.
+.IP "\fBins\fR \fI<\s-1LABEL\s0>\fR \fI<\s-1WHERE\s0>\fR \fI<\s-1PATH\s0>\fR" 4
+.IX Item "ins <LABEL> <WHERE> <PATH>"
+Insert a new node with label \s-1LABEL\s0 right before or after \s-1PATH\s0 into the
+tree. \s-1WHERE\s0 must be either 'before' or 'after'.
+.IP "\fBinsert\fR \fI<\s-1LABEL\s0>\fR \fI<\s-1WHERE\s0>\fR \fI<\s-1PATH\s0>\fR" 4
+.IX Item "insert <LABEL> <WHERE> <PATH>"
+Alias of \fBins\fR.
 .IP "\fBmv\fR <\s-1SRC\s0> <\s-1DST\s0>" 4
 .IX Item "mv <SRC> <DST>"
-Move node \s-1SRC\s0 to \s-1DST\s0. \s-1SRC\s0 must match exactly one node in the tree.  \s-1DST\s0
+Move node \s-1SRC\s0 to \s-1DSTSRC\s0 must match exactly one node in the tree.  \s-1DST\s0
 must either match exactly one node in the tree, or may not exist yet. If
 \&\s-1DST\s0 exists already, it and all its descendants are deleted. If \s-1DST\s0 does not
 exist yet, it and all its missing ancestors are created.
+.IP "\fBmove\fR <\s-1SRC\s0> <\s-1DST\s0>" 4
+.IX Item "move <SRC> <DST>"
+Alias of \fBmv\fR.
+.IP "\fBcp\fR <\s-1SRC\s0> <\s-1DST\s0>" 4
+.IX Item "cp <SRC> <DST>"
+Copy node \s-1SRC\s0 to \s-1DST. SRC\s0 must match exactly one node in the tree.  \s-1DST\s0
+must either match exactly one node in the tree, or may not exist yet. If
+\&\s-1DST\s0 exists already, it and all its descendants are deleted. If \s-1DST\s0 does not
+exist yet, it and all its missing ancestors are created.
+.IP "\fBcopy\fR <\s-1SRC\s0> <\s-1DST\s0>" 4
+.IX Item "copy <SRC> <DST>"
+Alias of \fBcp\fR.
+.IP "\fBrename\fR <\s-1SRC\s0> <\s-1LBL\s0>" 4
+.IX Item "rename <SRC> <LBL>"
+Rename the label of all nodes matching \s-1SRC\s0 to \s-1LBL.\s0
+.IP "\fBrm\fR <\s-1PATH\s0>" 4
+.IX Item "rm <PATH>"
+Delete \s-1PATH\s0 and all its children from the tree
 .IP "\fBset\fR <\s-1PATH\s0> <\s-1VALUE\s0>" 4
 .IX Item "set <PATH> <VALUE>"
-Associate \s-1VALUE\s0 with \s-1PATH\s0. If \s-1PATH\s0 is not in the tree yet,
+Associate \s-1VALUE\s0 with \s-1PATH.\s0 If \s-1PATH\s0 is not in the tree yet,
 it and all its ancestors will be created.
-.IP "\fBclear\fR <\s-1PATH\s0>" 4
-.IX Item "clear <PATH>"
-Set the value for \s-1PATH\s0 to \s-1NULL\s0. If \s-1PATH\s0 is not in the tree yet, it and all
-its ancestors will be created.
-.IP "\fBsetm\fR <\s-1BASE\s0> <\s-1SUB\s0> <\s-1VALUE\s0>" 4
-.IX Item "setm <BASE> <SUB> <VALUE>"
+.IP "\fBsetm\fR <\s-1BASE\s0> <\s-1SUB\s0> [<\s-1VALUE\s0>]" 4
+.IX Item "setm <BASE> <SUB> [<VALUE>]"
 Set multiple nodes in one operation.  Find or create a node matching \s-1SUB\s0 by
 interpreting \s-1SUB\s0 as a path expression relative to each node matching
-\&\s-1BASE\s0. If \s-1SUB\s0 is '.', the nodes matching \s-1BASE\s0 will be modified.
-.IP "\fBget\fR <\s-1PATH\s0>" 4
-.IX Item "get <PATH>"
-Print the value associated with \s-1PATH\s0
-.IP "\fBprint\fR \fI[<\s-1PATH\s0>]\fR" 4
-.IX Item "print [<PATH>]"
-Print entries in the tree. If \s-1PATH\s0 is given, printing starts there,
-otherwise the whole tree is printed
-.IP "\fBdump-xml\fR \fI[<\s-1PATH\s0>]\fR \fI[<\s-1FILENAME\s0>]\fR" 4
-.IX Item "dump-xml [<PATH>] [<FILENAME>]"
-Print entries in the tree as \s-1XML\s0. If \s-1PATH\s0 is given, printing starts there,
-otherwise the whole tree is printed. If \s-1FILENAME\s0 is given, the \s-1XML\s0 is saved
-to the given file.
-.IP "\fBins\fR \fI<\s-1LABEL\s0>\fR \fI<\s-1WHERE\s0>\fR \fI<\s-1PATH\s0>\fR" 4
-.IX Item "ins <LABEL> <WHERE> <PATH>"
-Insert a new node with label \s-1LABEL\s0 right before or after \s-1PATH\s0 into the
-tree. \s-1WHERE\s0 must be either 'before' or 'after'.
-.IP "\fBsave\fR" 4
-.IX Item "save"
-Save all pending changes to disk. Unless either the \fB\-b\fR or \fB\-n\fR
-command line options are given, files are changed in place.
-.IP "\fBload\fR" 4
-.IX Item "load"
-Load files according to the transforms in \f(CW\*(C`/augeas/load\*(C'\fR.
-.IP "\fBdefvar\fR <\s-1NAME\s0> <\s-1EXPR\s0>" 4
-.IX Item "defvar <NAME> <EXPR>"
-Define the variable \s-1NAME\s0 to the result of evaluating \s-1EXPR\s0. The variable
-can be used in path expressions as \f(CW$NAME\fR. Note that \s-1EXPR\s0 is evaluated when
-the variable is defined, not when it is used.
+\&\s-1BASE.\s0 If \s-1SUB\s0 is '.', the nodes matching \s-1BASE\s0 will be modified.
+.IP "\fBtouch\fR <\s-1PATH\s0>" 4
+.IX Item "touch <PATH>"
+Create \s-1PATH\s0 with the value \s-1NULL\s0 if it is not in the tree yet.  All its
+ancestors will also be created.  These new tree entries will appear
+last amongst their siblings.
+.SS "\s-1PATH EXPRESSION COMMANDS\s0"
+.IX Subsection "PATH EXPRESSION COMMANDS"
+The following commands help when working with path expressions.
 .IP "\fBdefnode\fR <\s-1NAME\s0> <\s-1EXPR\s0> [<\s-1VALUE\s0>]" 4
 .IX Item "defnode <NAME> <EXPR> [<VALUE>]"
-Define the variable \s-1NAME\s0 to the result of evaluating \s-1EXPR\s0, which must be a
+Define the variable \s-1NAME\s0 to the result of evaluating \s-1EXPR,\s0 which must be a
 nodeset. If no node matching \s-1EXPR\s0 exists yet, one is created and \s-1NAME\s0 will
-refer to it. If \s-1VALUE\s0 is given, this is the same as 'set \s-1EXPR\s0 \s-1VALUE\s0'; if
+refer to it. If \s-1VALUE\s0 is given, this is the same as 'set \s-1EXPR VALUE\s0'; if
 \&\s-1VALUE\s0 is not given, the node is created as if with 'clear \s-1EXPR\s0' would and
 \&\s-1NAME\s0 refers to that node.
-.IP "\fBspan\fR <\s-1PATH\s0>" 4
-.IX Item "span <PATH>"
-Print the name of the file from which the node \s-1PATH\s0 was generated, as well
-as information about the positions in the file corresponding to the label,
-the value, and the entire node. \s-1PATH\s0 must match exactly one node.
-.Sp
-You need to run 'set /augeas/span enable' prior to loading files to enable
-recording of span information. It is disabled by default.
-.IP "\fBhelp\fR" 4
-.IX Item "help"
-Print this help text
+.IP "\fBdefvar\fR <\s-1NAME\s0> <\s-1EXPR\s0>" 4
+.IX Item "defvar <NAME> <EXPR>"
+Define the variable \s-1NAME\s0 to the result of evaluating \s-1EXPR.\s0 The variable
+can be used in path expressions as \f(CW$NAME\fR. Note that \s-1EXPR\s0 is evaluated when
+the variable is defined, not when it is used.
 .SH "ENVIRONMENT VARIABLES"
 .IX Header "ENVIRONMENT VARIABLES"
 .IP "\fB\s-1AUGEAS_ROOT\s0\fR" 4
@@ -303,7 +377,8 @@ the \fB\-r\fR command line option
 .IX Item "AUGEAS_LENS_LIB"
 Colon separated list of directories with lenses. Directories specified here
 are searched after any directories set with the \fB\-I\fR command line option,
-but before the default directory \fI/usr/share/augeas/lenses\fR
+but before the default directories \fI/usr/share/augeas/lenses\fR and
+\&\fI/usr/share/augeas/lenses/dist\fR
 .SH "DIAGNOSTICS"
 .IX Header "DIAGNOSTICS"
 Normally, exit status is 0. If one or more commands fail, the exit status
@@ -336,7 +411,8 @@ why.
 .Ve
 .SH "FILES"
 .IX Header "FILES"
-Lenses and schema definitions in \fI/usr/share/augeas/lenses\fR
+Lenses and schema definitions in \fI/usr/share/augeas/lenses\fR and
+\&\fI/usr/share/augeas/lenses/dist\fR
 .SH "AUTHOR"
 .IX Header "AUTHOR"
 .Vb 1
@@ -344,7 +420,7 @@ Lenses and schema definitions in \fI/usr/share/augeas/lenses\fR
 .Ve
 .SH "COPYRIGHT AND LICENSE"
 .IX Header "COPYRIGHT AND LICENSE"
-Copyright 2007\-2011 Red Hat Inc.
+Copyright 2007\-2012 Red Hat Inc.
 .PP
 Augeas (and augtool) are distributed under the \s-1GNU\s0 Lesser General Public
 License (\s-1LGPL\s0)
index e744f59..78d5a20 100644 (file)
@@ -46,8 +46,13 @@ root set with the AUGEAS_ROOT environment variable.
 
 Add DIR to the module loadpath. Can be given multiple times. The
 directories set here are searched before any directories specified in the
-AUGEAS_LENS_LIB environment variable, and before the default directory
-F</usr/share/augeas/lenses>.
+AUGEAS_LENS_LIB environment variable, and before the default directories
+F</usr/share/augeas/lenses> and F</usr/share/augeas/lenses/dist>.
+
+=item B<-t>, B<--transform>=I<XFM>
+
+Add a file transform; uses the 'transform' command syntax,
+e.g. C<-t 'Fstab incl /etc/fstab.bak'>.
 
 =item B<-f>, B<--file>=I<FILE>
 
@@ -59,7 +64,7 @@ Read commands from the terminal. When combined with B<-f> or redirection of
 stdin, drop into an interactive session after executing the commands from
 the file.
 
-=item B<-e>
+=item B<-e>, B<--echo>
 
 When reading commands from a file via stdin, echo the commands before
 printing their output.
@@ -87,6 +92,11 @@ creates no entries under C</augeas/load> whatsoever; to read any files,
 they need to be set up manually and loading must be initiated with a
 C<load> command. Using this option gives the fastest startup.
 
+=item B<--span>
+
+Load span positions for nodes in the tree, as they relate to the original
+file. Enables the use of the B<span> command to retrieve position data.
+
 =item B<--version>
 
 Print version information and exit. The version is also in the tree under
@@ -106,12 +116,68 @@ be distinguished by appending C<[N]> to their label to match the N-th
 sibling with such a label. The last sibling with a specific label can be
 reached as C<[last()]>. See L</EXAMPLES> for some examples of this.
 
+=head2 ADMIN COMMANDS
+
+The following commands control the behavior of Augeas and augtool itself.
+
 =over 4
 
+=item B<help>
+
+Print this help text
+
+=item B<load>
+
+Load files according to the transforms in C</augeas/load>.
+
 =item B<quit>
 
 Exit the program
 
+=item B<retrieve> E<lt>LENSE<gt> E<lt>NODE_INE<gt> E<lt>PATHE<gt> E<lt>NODE_OUTE<gt>
+
+Transform tree at PATH back into text using lens LENS and store the
+resulting string at NODE_OUT. Assume that the tree was initially read in
+with the same lens and the string stored at NODE_IN as input.
+
+=item B<save>
+
+Save all pending changes to disk. Unless either the B<-b> or B<-n>
+command line options are given, files are changed in place.
+
+=item B<store> E<lt>LENSE<gt> E<lt>NODEE<gt> E<lt>PATHE<gt>
+
+Parse NODE using LENS and store the resulting tree at PATH.
+
+=item B<transform> E<lt>LENSE<gt> E<lt>FILTERE<gt> E<lt>FILEE<gt>
+
+Add a transform for FILE using LENS. The LENS may be a module name or a
+full lens name.  If a module name is given, then "lns" will be the lens
+assumed.  The FILTER must be either "incl" or "excl".  If the filter is
+"incl",  the FILE will be parsed by the LENS.  If the filter is "excl",
+the FILE will be excluded from the LENS. FILE may contain wildcards.
+
+=back
+
+=head2 READ COMMANDS
+
+The following commands are used to retrieve data from the Augeas tree.
+
+=over 4
+
+=item B<dump-xml> I<[E<lt>PATHE<gt>]>
+
+Print entries in the tree as XML. If PATH is given, printing starts there,
+otherwise the whole tree is printed.
+
+=item B<get> E<lt>PATHE<gt>
+
+Print the value associated with PATH
+
+=item B<label> E<lt>PATHE<gt>
+
+Get and print the label associated with PATH
+
 =item B<ls> E<lt>PATHE<gt>
 
 List the direct children of PATH
@@ -121,9 +187,47 @@ List the direct children of PATH
 Find all paths that match PATTERN. If VALUE is given, only the matching
 paths whose value equals VALUE are printed
 
-=item B<rm> E<lt>PATHE<gt>
+=item B<print> I<[E<lt>PATHE<gt>]>
 
-Delete PATH and all its children from the tree
+Print entries in the tree. If PATH is given, printing starts there,
+otherwise the whole tree is printed
+
+=item B<span> E<lt>PATHE<gt>
+
+Print the name of the file from which the node PATH was generated, as well
+as information about the positions in the file corresponding to the label,
+the value, and the entire node. PATH must match exactly one node.
+
+You need to run 'set /augeas/span enable' prior to loading files to enable
+recording of span information. It is disabled by default.
+
+=back
+
+=head2 WRITE COMMANDS
+
+The following commands are used to modify the Augeas tree.
+
+=over 4
+
+=item B<clear> E<lt>PATHE<gt>
+
+Set the value for PATH to NULL. If PATH is not in the tree yet, it and all
+its ancestors will be created.
+
+=item B<clearm> E<lt>BASEE<gt> E<lt>SUBE<gt>
+
+Clear multiple nodes values in one operation. Find or create a node matching SUB
+by interpreting SUB as a path expression relative to each node matching
+BASE. If SUB is '.', the nodes matching BASE will be modified.
+
+=item B<ins> I<E<lt>LABELE<gt>> I<E<lt>WHEREE<gt>> I<E<lt>PATHE<gt>>
+
+Insert a new node with label LABEL right before or after PATH into the
+tree. WHERE must be either 'before' or 'after'.
+
+=item B<insert> I<E<lt>LABELE<gt>> I<E<lt>WHEREE<gt>> I<E<lt>PATHE<gt>>
+
+Alias of B<ins>.
 
 =item B<mv> E<lt>SRCE<gt> E<lt>DSTE<gt>
 
@@ -132,56 +236,53 @@ must either match exactly one node in the tree, or may not exist yet. If
 DST exists already, it and all its descendants are deleted. If DST does not
 exist yet, it and all its missing ancestors are created.
 
-=item B<set> E<lt>PATHE<gt> E<lt>VALUEE<gt>
+=item B<move> E<lt>SRCE<gt> E<lt>DSTE<gt>
 
-Associate VALUE with PATH. If PATH is not in the tree yet,
-it and all its ancestors will be created.
+Alias of B<mv>.
 
-=item B<clear> E<lt>PATHE<gt>
+=item B<cp> E<lt>SRCE<gt> E<lt>DSTE<gt>
 
-Set the value for PATH to NULL. If PATH is not in the tree yet, it and all
-its ancestors will be created.
+Copy node SRC to DST. SRC must match exactly one node in the tree.  DST
+must either match exactly one node in the tree, or may not exist yet. If
+DST exists already, it and all its descendants are deleted. If DST does not
+exist yet, it and all its missing ancestors are created.
 
-=item B<setm> E<lt>BASEE<gt> E<lt>SUBE<gt> E<lt>VALUEE<gt>
+=item B<copy> E<lt>SRCE<gt> E<lt>DSTE<gt>
 
-Set multiple nodes in one operation.  Find or create a node matching SUB by
-interpreting SUB as a path expression relative to each node matching
-BASE. If SUB is '.', the nodes matching BASE will be modified.
+Alias of B<cp>.
 
-=item B<get> E<lt>PATHE<gt>
+=item B<rename> E<lt>SRCE<gt> E<lt>LBLE<gt>
 
-Print the value associated with PATH
+Rename the label of all nodes matching SRC to LBL.
 
-=item B<print> I<[E<lt>PATHE<gt>]>
+=item B<rm> E<lt>PATHE<gt>
 
-Print entries in the tree. If PATH is given, printing starts there,
-otherwise the whole tree is printed
+Delete PATH and all its children from the tree
 
-=item B<dump-xml> I<[E<lt>PATHE<gt>]> I<[E<lt>FILENAMEE<gt>]>
+=item B<set> E<lt>PATHE<gt> E<lt>VALUEE<gt>
 
-Print entries in the tree as XML. If PATH is given, printing starts there,
-otherwise the whole tree is printed. If FILENAME is given, the XML is saved
-to the given file.
+Associate VALUE with PATH. If PATH is not in the tree yet,
+it and all its ancestors will be created.
 
-=item B<ins> I<E<lt>LABELE<gt>> I<E<lt>WHEREE<gt>> I<E<lt>PATHE<gt>>
+=item B<setm> E<lt>BASEE<gt> E<lt>SUBE<gt> [E<lt>VALUEE<gt>]
 
-Insert a new node with label LABEL right before or after PATH into the
-tree. WHERE must be either 'before' or 'after'.
+Set multiple nodes in one operation.  Find or create a node matching SUB by
+interpreting SUB as a path expression relative to each node matching
+BASE. If SUB is '.', the nodes matching BASE will be modified.
 
-=item B<save>
+=item B<touch> E<lt>PATHE<gt>
 
-Save all pending changes to disk. Unless either the B<-b> or B<-n>
-command line options are given, files are changed in place.
+Create PATH with the value NULL if it is not in the tree yet.  All its
+ancestors will also be created.  These new tree entries will appear
+last amongst their siblings.
 
-=item B<load>
+=back
 
-Load files according to the transforms in C</augeas/load>.
+=head2 PATH EXPRESSION COMMANDS
 
-=item B<defvar> E<lt>NAMEE<gt> E<lt>EXPRE<gt>
+The following commands help when working with path expressions.
 
-Define the variable NAME to the result of evaluating EXPR. The variable
-can be used in path expressions as $NAME. Note that EXPR is evaluated when
-the variable is defined, not when it is used.
+=over 4
 
 =item B<defnode> E<lt>NAMEE<gt> E<lt>EXPRE<gt> [E<lt>VALUEE<gt>]
 
@@ -191,18 +292,11 @@ refer to it. If VALUE is given, this is the same as 'set EXPR VALUE'; if
 VALUE is not given, the node is created as if with 'clear EXPR' would and
 NAME refers to that node.
 
-=item B<span> E<lt>PATHE<gt>
-
-Print the name of the file from which the node PATH was generated, as well
-as information about the positions in the file corresponding to the label,
-the value, and the entire node. PATH must match exactly one node.
-
-You need to run 'set /augeas/span enable' prior to loading files to enable
-recording of span information. It is disabled by default.
-
-=item B<help>
+=item B<defvar> E<lt>NAMEE<gt> E<lt>EXPRE<gt>
 
-Print this help text
+Define the variable NAME to the result of evaluating EXPR. The variable
+can be used in path expressions as $NAME. Note that EXPR is evaluated when
+the variable is defined, not when it is used.
 
 =back
 
@@ -219,7 +313,8 @@ the B<-r> command line option
 
 Colon separated list of directories with lenses. Directories specified here
 are searched after any directories set with the B<-I> command line option,
-but before the default directory F</usr/share/augeas/lenses>
+but before the default directories F</usr/share/augeas/lenses> and
+F</usr/share/augeas/lenses/dist>
 
 =back
 
@@ -255,7 +350,8 @@ why.
 
 =head1 FILES
 
-Lenses and schema definitions in F</usr/share/augeas/lenses>
+Lenses and schema definitions in F</usr/share/augeas/lenses> and
+F</usr/share/augeas/lenses/dist>
 
 =head1 AUTHOR
 
@@ -263,7 +359,7 @@ Lenses and schema definitions in F</usr/share/augeas/lenses>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2007-2011 Red Hat Inc.
+Copyright 2007-2012 Red Hat Inc.
 
 Augeas (and augtool) are distributed under the GNU Lesser General Public
 License (LGPL)
index 259a964..5616796 100644 (file)
@@ -1,5 +1,5 @@
 GNULIB= ../gnulib/lib/libgnu.la
-GNULIB_CFLAGS= -I $(top_srcdir)/gnulib/lib
+GNULIB_CFLAGS= -I $(top_builddir)/gnulib/lib -I $(top_srcdir)/gnulib/lib
 
 AM_CFLAGS = @AUGEAS_CFLAGS@ @WARN_CFLAGS@ $(GNULIB_CFLAGS) $(LIBXML_CFLAGS)
 
@@ -62,6 +62,6 @@ internal.h: datadir.h
 
 FORCE-datadir.h: Makefile
        echo '#define DATADIR "$(datadir)"' > datadir.h1
-       $(top_srcdir)/build/aux/move-if-change datadir.h1 datadir.h
+       $(top_srcdir)/build/ac-aux/move-if-change datadir.h1 datadir.h
 
 datadir.h: FORCE-datadir.h
index e55e0e2..0fd2931 100644 (file)
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in 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.
 
 
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -45,9 +89,10 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = augtool$(EXEEXT) augparse$(EXEEXT)
-DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in $(top_srcdir)/Makefile.inc lexer.c \
-       parser.c parser.h
+DIST_COMMON = $(top_srcdir)/Makefile.inc $(srcdir)/Makefile.in \
+       $(srcdir)/Makefile.am parser.h parser.c lexer.c \
+       $(top_srcdir)/build/ac-aux/depcomp \
+       $(top_srcdir)/build/ac-aux/ylwrap $(include_HEADERS)
 subdir = src
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
@@ -55,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/argz.m4 \
        $(top_srcdir)/gnulib/m4/btowc.m4 \
        $(top_srcdir)/gnulib/m4/canonicalize.m4 \
+       $(top_srcdir)/gnulib/m4/close.m4 \
        $(top_srcdir)/gnulib/m4/codeset.m4 \
        $(top_srcdir)/gnulib/m4/configmake.m4 \
        $(top_srcdir)/gnulib/m4/ctype.m4 \
@@ -63,24 +109,33 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/eealloc.m4 \
        $(top_srcdir)/gnulib/m4/environ.m4 \
        $(top_srcdir)/gnulib/m4/errno_h.m4 \
+       $(top_srcdir)/gnulib/m4/exponentd.m4 \
        $(top_srcdir)/gnulib/m4/extensions.m4 \
        $(top_srcdir)/gnulib/m4/fcntl-o.m4 \
        $(top_srcdir)/gnulib/m4/fcntl_h.m4 \
+       $(top_srcdir)/gnulib/m4/fdopen.m4 \
        $(top_srcdir)/gnulib/m4/float_h.m4 \
        $(top_srcdir)/gnulib/m4/fnmatch.m4 \
+       $(top_srcdir)/gnulib/m4/fpieee.m4 \
+       $(top_srcdir)/gnulib/m4/fstat.m4 \
+       $(top_srcdir)/gnulib/m4/getcwd.m4 \
        $(top_srcdir)/gnulib/m4/getdelim.m4 \
        $(top_srcdir)/gnulib/m4/getline.m4 \
        $(top_srcdir)/gnulib/m4/getopt.m4 \
        $(top_srcdir)/gnulib/m4/getpagesize.m4 \
+       $(top_srcdir)/gnulib/m4/gettimeofday.m4 \
        $(top_srcdir)/gnulib/m4/glibc21.m4 \
        $(top_srcdir)/gnulib/m4/gnulib-common.m4 \
        $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \
        $(top_srcdir)/gnulib/m4/include_next.m4 \
        $(top_srcdir)/gnulib/m4/intlmacosx.m4 \
        $(top_srcdir)/gnulib/m4/intmax_t.m4 \
+       $(top_srcdir)/gnulib/m4/inttypes-pri.m4 \
+       $(top_srcdir)/gnulib/m4/inttypes.m4 \
        $(top_srcdir)/gnulib/m4/inttypes_h.m4 \
        $(top_srcdir)/gnulib/m4/isblank.m4 \
        $(top_srcdir)/gnulib/m4/langinfo_h.m4 \
+       $(top_srcdir)/gnulib/m4/largefile.m4 \
        $(top_srcdir)/gnulib/m4/lcmessage.m4 \
        $(top_srcdir)/gnulib/m4/lib-ld.m4 \
        $(top_srcdir)/gnulib/m4/lib-link.m4 \
@@ -92,6 +147,7 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/locale-tr.m4 \
        $(top_srcdir)/gnulib/m4/locale-zh.m4 \
        $(top_srcdir)/gnulib/m4/locale_h.m4 \
+       $(top_srcdir)/gnulib/m4/localeconv.m4 \
        $(top_srcdir)/gnulib/m4/localename.m4 \
        $(top_srcdir)/gnulib/m4/lock.m4 \
        $(top_srcdir)/gnulib/m4/longlong.m4 \
@@ -109,15 +165,21 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/mbtowc.m4 \
        $(top_srcdir)/gnulib/m4/memchr.m4 \
        $(top_srcdir)/gnulib/m4/mempcpy.m4 \
+       $(top_srcdir)/gnulib/m4/mkstemp.m4 \
        $(top_srcdir)/gnulib/m4/mmap-anon.m4 \
        $(top_srcdir)/gnulib/m4/mode_t.m4 \
+       $(top_srcdir)/gnulib/m4/msvc-inval.m4 \
+       $(top_srcdir)/gnulib/m4/msvc-nothrow.m4 \
        $(top_srcdir)/gnulib/m4/multiarch.m4 \
        $(top_srcdir)/gnulib/m4/nl_langinfo.m4 \
+       $(top_srcdir)/gnulib/m4/nocrash.m4 \
+       $(top_srcdir)/gnulib/m4/off_t.m4 \
        $(top_srcdir)/gnulib/m4/onceonly.m4 \
        $(top_srcdir)/gnulib/m4/open.m4 \
        $(top_srcdir)/gnulib/m4/pathmax.m4 \
        $(top_srcdir)/gnulib/m4/printf.m4 \
        $(top_srcdir)/gnulib/m4/putenv.m4 \
+       $(top_srcdir)/gnulib/m4/rawmemchr.m4 \
        $(top_srcdir)/gnulib/m4/readlink.m4 \
        $(top_srcdir)/gnulib/m4/realloc.m4 \
        $(top_srcdir)/gnulib/m4/regex.m4 \
@@ -137,13 +199,18 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/stdlib_h.m4 \
        $(top_srcdir)/gnulib/m4/stpcpy.m4 \
        $(top_srcdir)/gnulib/m4/stpncpy.m4 \
+       $(top_srcdir)/gnulib/m4/strchrnul.m4 \
        $(top_srcdir)/gnulib/m4/string_h.m4 \
        $(top_srcdir)/gnulib/m4/strndup.m4 \
        $(top_srcdir)/gnulib/m4/strnlen.m4 \
        $(top_srcdir)/gnulib/m4/strstr.m4 \
        $(top_srcdir)/gnulib/m4/symlink.m4 \
+       $(top_srcdir)/gnulib/m4/sys_socket_h.m4 \
        $(top_srcdir)/gnulib/m4/sys_stat_h.m4 \
+       $(top_srcdir)/gnulib/m4/sys_time_h.m4 \
+       $(top_srcdir)/gnulib/m4/sys_types_h.m4 \
        $(top_srcdir)/gnulib/m4/sys_wait_h.m4 \
+       $(top_srcdir)/gnulib/m4/tempname.m4 \
        $(top_srcdir)/gnulib/m4/thread.m4 \
        $(top_srcdir)/gnulib/m4/threadlib.m4 \
        $(top_srcdir)/gnulib/m4/time_h.m4 \
@@ -188,6 +255,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
        "$(DESTDIR)$(includedir)"
 LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
@@ -199,9 +272,10 @@ am_libaugeas_la_OBJECTS = augeas.lo augrun.lo pathx.lo internal.lo \
        regexp.lo transform.lo ast.lo get.lo put.lo info.lo errcode.lo \
        jmt.lo
 libaugeas_la_OBJECTS = $(am_libaugeas_la_OBJECTS)
-AM_V_lt = $(am__v_lt_$(V))
-am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+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 = 
 libaugeas_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(libaugeas_la_LDFLAGS) $(LDFLAGS) -o $@
@@ -225,8 +299,20 @@ am_augtool_OBJECTS = augtool.$(OBJEXT)
 augtool_OBJECTS = $(am_augtool_OBJECTS)
 augtool_DEPENDENCIES = libaugeas.la $(am__DEPENDENCIES_1) \
        $(am__DEPENDENCIES_1) $(GNULIB)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/build/aux/depcomp
+depcomp = $(SHELL) $(top_srcdir)/build/ac-aux/depcomp
 am__depfiles_maybe = depfiles
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -235,40 +321,62 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
        $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
        $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_$(V))
-am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
-am__v_CC_0 = @echo "  CC    " $@;
-AM_V_at = $(am__v_at_$(V))
-am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
-am__v_at_0 = @
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_$(V))
-am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
-am__v_CCLD_0 = @echo "  CCLD  " $@;
-LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS)
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS)
 LTLEXCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
-       $(LIBTOOLFLAGS) --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS)
-AM_V_LEX = $(am__v_LEX_$(V))
-am__v_LEX_ = $(am__v_LEX_$(AM_DEFAULT_VERBOSITY))
-am__v_LEX_0 = @echo "  LEX   " $@;
-YLWRAP = $(top_srcdir)/build/aux/ylwrap
-YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
+       $(LIBTOOLFLAGS) --mode=compile $(LEX) $(AM_LFLAGS) $(LFLAGS)
+AM_V_LEX = $(am__v_LEX_@AM_V@)
+am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@)
+am__v_LEX_0 = @echo "  LEX     " $@;
+am__v_LEX_1 = 
+YLWRAP = $(top_srcdir)/build/ac-aux/ylwrap
+am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \
+                  -e s/c++$$/h++/ -e s/c$$/h/
+YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS)
 LTYACCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
-       $(LIBTOOLFLAGS) --mode=compile $(YACC) $(YFLAGS) $(AM_YFLAGS)
-AM_V_YACC = $(am__v_YACC_$(V))
-am__v_YACC_ = $(am__v_YACC_$(AM_DEFAULT_VERBOSITY))
-am__v_YACC_0 = @echo "  YACC  " $@;
-AM_V_GEN = $(am__v_GEN_$(V))
-am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
-am__v_GEN_0 = @echo "  GEN   " $@;
+       $(LIBTOOLFLAGS) --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS)
+AM_V_YACC = $(am__v_YACC_@AM_V@)
+am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@)
+am__v_YACC_0 = @echo "  YACC    " $@;
+am__v_YACC_1 = 
 SOURCES = $(libaugeas_la_SOURCES) $(libfa_la_SOURCES) \
        $(liblexer_la_SOURCES) $(augparse_SOURCES) $(augtool_SOURCES)
 DIST_SOURCES = $(libaugeas_la_SOURCES) $(libfa_la_SOURCES) \
        $(liblexer_la_SOURCES) $(augparse_SOURCES) $(augtool_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 HEADERS = $(include_HEADERS)
+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
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -280,6 +388,7 @@ AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 AR = @AR@
+ARFLAGS = @ARFLAGS@
 ARGZ_H = @ARGZ_H@
 AUGEAS_CFLAGS = @AUGEAS_CFLAGS@
 AUTOCONF = @AUTOCONF@
@@ -323,9 +432,11 @@ GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
 GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
+GNULIB_CHDIR = @GNULIB_CHDIR@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
+GNULIB_DUP = @GNULIB_DUP@
 GNULIB_DUP2 = @GNULIB_DUP2@
 GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
@@ -337,16 +448,25 @@ 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_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FFSL = @GNULIB_FFSL@
+GNULIB_FFSLL = @GNULIB_FFSLL@
+GNULIB_FGETC = @GNULIB_FGETC@
+GNULIB_FGETS = @GNULIB_FGETS@
 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_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@
@@ -354,6 +474,8 @@ 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@
@@ -366,8 +488,14 @@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
 GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
+GNULIB_IMAXABS = @GNULIB_IMAXABS@
+GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
+GNULIB_ISATTY = @GNULIB_ISATTY@
 GNULIB_ISBLANK = @GNULIB_ISBLANK@
 GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
 GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
@@ -375,6 +503,7 @@ GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
 GNULIB_LINKAT = @GNULIB_LINKAT@
+GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
@@ -415,25 +544,31 @@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
 GNULIB_MKTIME = @GNULIB_MKTIME@
 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_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_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
 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_RANDOM = @GNULIB_RANDOM@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
 GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
+GNULIB_READ = @GNULIB_READ@
 GNULIB_READLINK = @GNULIB_READLINK@
 GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
@@ -443,12 +578,15 @@ GNULIB_RENAME = @GNULIB_RENAME@
 GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
 GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
+GNULIB_SCANF = @GNULIB_SCANF@
 GNULIB_SETENV = @GNULIB_SETENV@
+GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
 GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
 GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
 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@
@@ -466,9 +604,11 @@ 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@
@@ -478,7 +618,7 @@ GNULIB_TIME_R = @GNULIB_TIME_R@
 GNULIB_TMPFILE = @GNULIB_TMPFILE@
 GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
 GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
-GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
+GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
 GNULIB_UNLINK = @GNULIB_UNLINK@
 GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
@@ -490,8 +630,10 @@ 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@
@@ -540,6 +682,7 @@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
 HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
 HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
 HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
 HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
@@ -550,18 +693,23 @@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 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_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
 HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
 HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
@@ -577,7 +725,10 @@ HAVE_FCHDIR = @HAVE_FCHDIR@
 HAVE_FCHMODAT = @HAVE_FCHMODAT@
 HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
 HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
 HAVE_FSEEKO = @HAVE_FSEEKO@
 HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
@@ -591,7 +742,9 @@ HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
 HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
 HAVE_ISBLANK = @HAVE_ISBLANK@
 HAVE_ISWBLANK = @HAVE_ISWBLANK@
@@ -625,15 +778,21 @@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
 HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
 HAVE_MKSTEMP = @HAVE_MKSTEMP@
 HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
 HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OPENAT = @HAVE_OPENAT@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
 HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
 HAVE_PREAD = @HAVE_PREAD@
 HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
 HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_RANDOM = @HAVE_RANDOM@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
 HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -643,6 +802,7 @@ HAVE_REALPATH = @HAVE_REALPATH@
 HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
 HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
@@ -659,6 +819,7 @@ HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
 HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
 HAVE_SYMLINK = @HAVE_SYMLINK@
 HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
@@ -666,6 +827,7 @@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
 HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
 HAVE_TIMEGM = @HAVE_TIMEGM@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
@@ -707,6 +869,7 @@ HAVE_WCSXFRM = @HAVE_WCSXFRM@
 HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
 HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
 HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WMEMCHR = @HAVE_WMEMCHR@
 HAVE_WMEMCMP = @HAVE_WMEMCMP@
@@ -723,6 +886,8 @@ INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 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@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
@@ -768,6 +933,7 @@ 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_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
 NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
 NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H = @NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H@
@@ -777,6 +943,8 @@ 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_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_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@
@@ -787,6 +955,7 @@ 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_INTTYPES_H = @NEXT_INTTYPES_H@
 NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_LOCALE_H = @NEXT_LOCALE_H@
 NEXT_SELINUX_SELINUX_H = @NEXT_SELINUX_SELINUX_H@
@@ -796,6 +965,8 @@ NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
 NEXT_STRING_H = @NEXT_STRING_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_WAIT_H = @NEXT_SYS_WAIT_H@
 NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
@@ -822,6 +993,8 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 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@
@@ -838,6 +1011,7 @@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
 REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
@@ -849,6 +1023,7 @@ REPLACE_FSTAT = @REPLACE_FSTAT@
 REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
 REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
 REPLACE_GETDELIM = @REPLACE_GETDELIM@
@@ -857,11 +1032,15 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISATTY = @REPLACE_ISATTY@
 REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ITOLD = @REPLACE_ITOLD@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
 REPLACE_LINK = @REPLACE_LINK@
 REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALECONV = @REPLACE_LOCALECONV@
 REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
@@ -890,8 +1069,11 @@ REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
 REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
 REPLACE_REALLOC = @REPLACE_REALLOC@
 REPLACE_REALPATH = @REPLACE_REALPATH@
@@ -905,9 +1087,11 @@ REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
 REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
 REPLACE_STPNCPY = @REPLACE_STPNCPY@
 REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
 REPLACE_STRDUP = @REPLACE_STRDUP@
 REPLACE_STRERROR = @REPLACE_STRERROR@
 REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
@@ -917,10 +1101,14 @@ REPLACE_STRNLEN = @REPLACE_STRNLEN@
 REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
 REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
 REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
+REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
 REPLACE_SYMLINK = @REPLACE_SYMLINK@
 REPLACE_TIMEGM = @REPLACE_TIMEGM@
 REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
 REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
 REPLACE_UNLINK = @REPLACE_UNLINK@
 REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
@@ -953,6 +1141,8 @@ STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+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_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
@@ -960,6 +1150,8 @@ VERSION = @VERSION@
 VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@
 WARN_CFLAGS = @WARN_CFLAGS@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 YACC = @YACC@
 YFLAGS = @YFLAGS@
@@ -1023,7 +1215,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 GNULIB = ../gnulib/lib/libgnu.la
-GNULIB_CFLAGS = -I $(top_srcdir)/gnulib/lib
+GNULIB_CFLAGS = -I $(top_builddir)/gnulib/lib -I $(top_srcdir)/gnulib/lib
 AM_CFLAGS = @AUGEAS_CFLAGS@ @WARN_CFLAGS@ $(GNULIB_CFLAGS) $(LIBXML_CFLAGS)
 AM_YFLAGS = -d -p spec_
 EXTRA_DIST = try augeas_sym.version fa_sym.version
@@ -1082,6 +1274,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
            echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
            cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
        esac;
+$(top_srcdir)/Makefile.inc:
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -1091,9 +1284,9 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
+
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
        @$(NORMAL_INSTALL)
-       test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
        @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
        list2=; for p in $$list; do \
          if test -f $$p; then \
@@ -1101,6 +1294,8 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIES)
          else :; fi; \
        done; \
        test -z "$$list2" || { \
+         echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
          echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
          $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
        }
@@ -1116,42 +1311,52 @@ uninstall-libLTLIBRARIES:
 
 clean-libLTLIBRARIES:
        -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-       @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
-         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-         test "$$dir" != "$$p" || dir=.; \
-         echo "rm -f \"$${dir}/so_locations\""; \
-         rm -f "$${dir}/so_locations"; \
-       done
+       @list='$(lib_LTLIBRARIES)'; \
+       locs=`for p in $$list; do echo $$p; done | \
+             sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+             sort -u`; \
+       test -z "$$locs" || { \
+         echo rm -f $${locs}; \
+         rm -f $${locs}; \
+       }
 
 clean-noinstLTLIBRARIES:
        -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
-       @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
-         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-         test "$$dir" != "$$p" || dir=.; \
-         echo "rm -f \"$${dir}/so_locations\""; \
-         rm -f "$${dir}/so_locations"; \
-       done
+       @list='$(noinst_LTLIBRARIES)'; \
+       locs=`for p in $$list; do echo $$p; done | \
+             sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+             sort -u`; \
+       test -z "$$locs" || { \
+         echo rm -f $${locs}; \
+         rm -f $${locs}; \
+       }
 parser.h: parser.c
-       @if test ! -f $@; then \
-         rm -f parser.c; \
-         $(MAKE) $(AM_MAKEFLAGS) parser.c; \
-       else :; fi
-libaugeas.la: $(libaugeas_la_OBJECTS) $(libaugeas_la_DEPENDENCIES) 
+       @if test ! -f $@; then rm -f parser.c; else :; fi
+       @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) parser.c; else :; fi
+
+libaugeas.la: $(libaugeas_la_OBJECTS) $(libaugeas_la_DEPENDENCIES) $(EXTRA_libaugeas_la_DEPENDENCIES) 
        $(AM_V_CCLD)$(libaugeas_la_LINK) -rpath $(libdir) $(libaugeas_la_OBJECTS) $(libaugeas_la_LIBADD) $(LIBS)
-libfa.la: $(libfa_la_OBJECTS) $(libfa_la_DEPENDENCIES) 
+
+libfa.la: $(libfa_la_OBJECTS) $(libfa_la_DEPENDENCIES) $(EXTRA_libfa_la_DEPENDENCIES) 
        $(AM_V_CCLD)$(libfa_la_LINK) -rpath $(libdir) $(libfa_la_OBJECTS) $(libfa_la_LIBADD) $(LIBS)
-liblexer.la: $(liblexer_la_OBJECTS) $(liblexer_la_DEPENDENCIES) 
+
+liblexer.la: $(liblexer_la_OBJECTS) $(liblexer_la_DEPENDENCIES) $(EXTRA_liblexer_la_DEPENDENCIES) 
        $(AM_V_CCLD)$(liblexer_la_LINK)  $(liblexer_la_OBJECTS) $(liblexer_la_LIBADD) $(LIBS)
 install-binPROGRAMS: $(bin_PROGRAMS)
        @$(NORMAL_INSTALL)
-       test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
        @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+       fi; \
        for p in $$list; do echo "$$p $$p"; done | \
        sed 's/$(EXEEXT)$$//' | \
-       while read p p1; do if test -f $$p || test -f $$p1; \
-         then echo "$$p"; echo "$$p"; else :; fi; \
+       while read p p1; do if test -f $$p \
+        || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
        done | \
-       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
            -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
        sed 'N;N;N;s,\n, ,g' | \
        $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
@@ -1172,7 +1377,8 @@ uninstall-binPROGRAMS:
        @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
        files=`for p in $$list; do echo "$$p"; done | \
          sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-             -e 's/$$/$(EXEEXT)/' `; \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
        test -n "$$list" || exit 0; \
        echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(bindir)" && rm -f $$files
@@ -1185,10 +1391,12 @@ clean-binPROGRAMS:
        list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
        echo " rm -f" $$list; \
        rm -f $$list
-augparse$(EXEEXT): $(augparse_OBJECTS) $(augparse_DEPENDENCIES) 
+
+augparse$(EXEEXT): $(augparse_OBJECTS) $(augparse_DEPENDENCIES) $(EXTRA_augparse_DEPENDENCIES) 
        @rm -f augparse$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(augparse_OBJECTS) $(augparse_LDADD) $(LIBS)
-augtool$(EXEEXT): $(augtool_OBJECTS) $(augtool_DEPENDENCIES) 
+
+augtool$(EXEEXT): $(augtool_OBJECTS) $(augtool_DEPENDENCIES) $(EXTRA_augtool_DEPENDENCIES) 
        @rm -f augtool$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(augtool_OBJECTS) $(augtool_LDADD) $(LIBS)
 
@@ -1225,40 +1433,36 @@ distclean-compile:
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
 
 .c.obj:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
 
 liblexer_la-lexer.lo: lexer.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblexer_la_CFLAGS) $(CFLAGS) -MT liblexer_la-lexer.lo -MD -MP -MF $(DEPDIR)/liblexer_la-lexer.Tpo -c -o liblexer_la-lexer.lo `test -f 'lexer.c' || echo '$(srcdir)/'`lexer.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/liblexer_la-lexer.Tpo $(DEPDIR)/liblexer_la-lexer.Plo
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lexer.c' object='liblexer_la-lexer.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='lexer.c' object='liblexer_la-lexer.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblexer_la_CFLAGS) $(CFLAGS) -c -o liblexer_la-lexer.lo `test -f 'lexer.c' || echo '$(srcdir)/'`lexer.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblexer_la_CFLAGS) $(CFLAGS) -c -o liblexer_la-lexer.lo `test -f 'lexer.c' || echo '$(srcdir)/'`lexer.c
 
 .l.c:
        $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE)
 
 .y.c:
-       $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE)
+       $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE)
 
 mostlyclean-libtool:
        -rm -f *.lo
@@ -1267,8 +1471,11 @@ clean-libtool:
        -rm -rf .libs _libs
 install-includeHEADERS: $(include_HEADERS)
        @$(NORMAL_INSTALL)
-       test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
        @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
+       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
@@ -1282,30 +1489,17 @@ uninstall-includeHEADERS:
        @$(NORMAL_UNINSTALL)
        @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(includedir)" && rm -f $$files
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+       dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -1317,15 +1511,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -1334,6 +1524,21 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
 
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -1389,10 +1594,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
 mostlyclean-generic:
 
 clean-generic:
@@ -1483,20 +1693,21 @@ uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \
 
 .MAKE: all check install install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-       clean-generic clean-libLTLIBRARIES clean-libtool \
-       clean-noinstLTLIBRARIES ctags distclean distclean-compile \
-       distclean-generic distclean-libtool distclean-tags distdir dvi \
-       dvi-am html html-am info info-am install install-am \
-       install-binPROGRAMS install-data install-data-am install-dvi \
-       install-dvi-am install-exec install-exec-am install-html \
-       install-html-am install-includeHEADERS install-info \
-       install-info-am install-libLTLIBRARIES install-man install-pdf \
-       install-pdf-am install-ps install-ps-am install-strip \
-       installcheck installcheck-am installdirs maintainer-clean \
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+       clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
+       clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
+       ctags-am distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-binPROGRAMS \
+       install-data install-data-am install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-includeHEADERS install-info install-info-am \
+       install-libLTLIBRARIES 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-libtool pdf pdf-am ps ps-am \
-       tags uninstall uninstall-am uninstall-binPROGRAMS \
+       tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \
        uninstall-includeHEADERS uninstall-libLTLIBRARIES
 
 
@@ -1529,7 +1740,7 @@ internal.h: datadir.h
 
 FORCE-datadir.h: Makefile
        echo '#define DATADIR "$(datadir)"' > datadir.h1
-       $(top_srcdir)/build/aux/move-if-change datadir.h1 datadir.h
+       $(top_srcdir)/build/ac-aux/move-if-change datadir.h1 datadir.h
 
 datadir.h: FORCE-datadir.h
 
index 3b786c9..9eb2047 100644 (file)
@@ -43,6 +43,9 @@ static const char *const s_pathx  = "pathx";
 static const char *const s_error  = "error";
 static const char *const s_pos    = "pos";
 static const char *const s_vars   = "variables";
+static const char *const s_lens   = "lens";
+static const char *const s_excl   = "excl";
+static const char *const s_incl   = "incl";
 
 #define TREE_HIDDEN(tree) ((tree)->label == NULL)
 
@@ -78,7 +81,9 @@ static const char *const errcodes[] = {
     "Node has no span info",                            /* AUG_ENOSPAN */
     "Cannot move node into its descendant",             /* AUG_EMVDESC */
     "Failed to execute command",                        /* AUG_ECMDRUN */
-    "Invalid argument in function call"                 /* AUG_EBADARG */
+    "Invalid argument in function call",                /* AUG_EBADARG */
+    "Invalid label",                                    /* AUG_ELABEL */
+    "Cannot copy node into its descendant"              /* AUG_ECPDESC */
 };
 
 static void tree_mark_dirty(struct tree *tree) {
@@ -136,6 +141,44 @@ struct tree *tree_path_cr(struct tree *tree, int n, ...) {
     return tree;
 }
 
+static struct tree *tree_fpath_int(struct augeas *aug, const char *fpath,
+                                   bool create) {
+    int r;
+    char *steps = NULL, *step = NULL;
+    size_t nsteps = 0;
+    struct tree *result = NULL;
+
+    r = argz_create_sep(fpath, '/', &steps, &nsteps);
+    ERR_NOMEM(r < 0, aug);
+    result = aug->origin;
+    while ((step = argz_next(steps, nsteps, step))) {
+        if (create) {
+            result = tree_child_cr(result, step);
+            ERR_THROW(result == NULL, aug, AUG_ENOMEM,
+                      "while searching %s: can not create %s", fpath, step);
+        } else {
+            /* Lookup only */
+            result = tree_child(result, step);
+            if (result == NULL)
+                goto done;
+        }
+    }
+ done:
+    free(steps);
+    return result;
+ error:
+    result = NULL;
+    goto done;
+}
+
+struct tree *tree_fpath(struct augeas *aug, const char *fpath) {
+    return tree_fpath_int(aug, fpath, false);
+}
+
+struct tree *tree_fpath_cr(struct augeas *aug, const char *fpath) {
+    return tree_fpath_int(aug, fpath, true);
+}
+
 struct tree *tree_find(struct augeas *aug, const char *path) {
     struct pathx *p = NULL;
     struct tree *result = NULL;
@@ -276,10 +319,19 @@ struct tree *tree_root_ctx(const struct augeas *aug) {
     p = pathx_aug_parse(aug, aug->origin, NULL, ctx_path, true);
     ERR_BAIL(aug);
 
-    r = pathx_find_one(p, &match);
-    ERR_THROW(r > 1, aug, AUG_EMMATCH,
-              "There are %d nodes matching the context %s, expecting one",
-              r, ctx_path);
+    if (pathx_first(p) == NULL) {
+        r = pathx_expand_tree(p, &match);
+        if (r < 0)
+            goto done;
+        r = tree_set_value(match, NULL);
+        if (r < 0)
+            goto done;
+    } else {
+        r = pathx_find_one(p, &match);
+        ERR_THROW(r > 1, aug, AUG_EMMATCH,
+                  "There are %d nodes matching the context %s, expecting one",
+                  r, ctx_path);
+    }
 
  done:
     free_pathx(p);
@@ -300,10 +352,13 @@ struct tree *tree_append(struct tree *parent,
 static struct tree *tree_append_s(struct tree *parent,
                                   const char *l0, char *v) {
     struct tree *result;
-    char *l = strdup(l0);
+    char *l;
 
-    if (l == NULL)
+    if (l0 == NULL) {
         return NULL;
+    } else {
+      l = strdup(l0);
+    }
     result = tree_append(parent, l, v);
     if (result == NULL)
         free(l);
@@ -332,12 +387,12 @@ static struct tree *tree_from_transform(struct augeas *aug,
     r = asprintf(&v, "@%s", modname);
     ERR_NOMEM(r < 0, aug);
 
-    t = tree_append_s(txfm, "lens", v);
+    t = tree_append_s(txfm, s_lens, v);
     ERR_NOMEM(t == NULL, aug);
     v = NULL;
 
     list_for_each(f, xfm->filter) {
-        const char *l = f->include ? strdup("incl") : strdup("excl");
+        const char *l = f->include ? s_incl : s_excl;
         v = strdup(f->glob->str);
         ERR_NOMEM(v == NULL, aug);
         t = tree_append_s(txfm, l, v);
@@ -346,7 +401,7 @@ static struct tree *tree_from_transform(struct augeas *aug,
     return txfm;
  error:
     free(v);
-    tree_unlink(txfm);
+    tree_unlink(aug, txfm);
     return NULL;
 }
 
@@ -585,6 +640,37 @@ struct augeas *aug_init(const char *root, const char *loadpath,
     return result;
 }
 
+/* Free one tree node */
+static void free_tree_node(struct tree *tree) {
+    if (tree == NULL)
+        return;
+
+    if (tree->span != NULL)
+        free_span(tree->span);
+    free(tree->label);
+    free(tree->value);
+    free(tree);
+}
+
+/* Only unlink; assume we know TREE is not in the symtab */
+static int tree_unlink_raw(struct tree *tree) {
+    int result = 0;
+
+    assert (tree->parent != NULL);
+    list_remove(tree, tree->parent->children);
+    tree_mark_dirty(tree->parent);
+    result = free_tree(tree->children) + 1;
+    free_tree_node(tree);
+    return result;
+}
+
+int tree_unlink(struct augeas *aug, struct tree *tree) {
+    if (tree == NULL)
+        return 0;
+    pathx_symtab_remove_descendants(aug->symtab, tree);
+    return tree_unlink_raw(tree);
+}
+
 void tree_unlink_children(struct augeas *aug, struct tree *tree) {
     if (tree == NULL)
         return;
@@ -592,7 +678,7 @@ void tree_unlink_children(struct augeas *aug, struct tree *tree) {
     pathx_symtab_remove_descendants(aug->symtab, tree);
 
     while (tree->children != NULL)
-        tree_unlink(tree->children);
+        tree_unlink_raw(tree->children);
 }
 
 static void tree_mark_files(struct tree *tree) {
@@ -612,8 +698,8 @@ static void tree_rm_dirty_files(struct augeas *aug, struct tree *tree) {
         return;
 
     if ((p = tree_child(tree, "path")) != NULL) {
-        aug_rm(aug, p->value);
-        tree_unlink(tree);
+        tree_unlink(aug, tree_fpath(aug, p->value));
+        tree_unlink(aug, tree);
     } else {
         struct tree *c = tree->children;
         while (c != NULL) {
@@ -637,7 +723,7 @@ static void tree_rm_dirty_leaves(struct augeas *aug, struct tree *tree,
     }
 
     if (tree != protect && tree->children == NULL)
-        tree_unlink(tree);
+        tree_unlink(aug, tree);
 }
 
 int aug_load(struct augeas *aug) {
@@ -753,15 +839,43 @@ int aug_get(const struct augeas *aug, const char *path, const char **value) {
     return -1;
 }
 
+int aug_label(const struct augeas *aug, const char *path, const char **label) {
+    struct pathx *p = NULL;
+    struct tree *match;
+    int r;
+
+    api_entry(aug);
+
+    p = pathx_aug_parse(aug, aug->origin, tree_root_ctx(aug), path, true);
+    ERR_BAIL(aug);
+
+    if (label != NULL)
+        *label = NULL;
+
+    r = pathx_find_one(p, &match);
+    ERR_BAIL(aug);
+    ERR_THROW(r > 1, aug, AUG_EMMATCH, "There are %d nodes matching %s",
+              r, path);
+
+    if (r == 1 && label != NULL)
+        *label = match->label;
+    free_pathx(p);
+
+    api_exit(aug);
+    return r;
+ error:
+    free_pathx(p);
+    api_exit(aug);
+    return -1;
+}
+
 static void record_var_meta(struct augeas *aug, const char *name,
                             const char *expr) {
     /* Record the definition of the variable */
     struct tree *tree = tree_path_cr(aug->origin, 2, s_augeas, s_vars);
     ERR_NOMEM(tree == NULL, aug);
     if (expr == NULL) {
-        tree = tree_child(tree, name);
-        if (tree != NULL)
-            tree_unlink(tree);
+        tree_unlink(aug, tree_child(tree, name));
     } else {
         tree = tree_child_cr(tree, name);
         ERR_NOMEM(tree == NULL, aug);
@@ -1009,18 +1123,6 @@ struct tree *make_tree_origin(struct tree *root) {
     return origin;
 }
 
-/* Free one tree node */
-static void free_tree_node(struct tree *tree) {
-    if (tree == NULL)
-        return;
-
-    if (tree->span != NULL)
-        free_span(tree->span);
-    free(tree->label);
-    free(tree->value);
-    free(tree);
-}
-
 /* Recursively free the whole tree TREE and all its siblings */
 int free_tree(struct tree *tree) {
     int cnt = 0;
@@ -1036,17 +1138,6 @@ int free_tree(struct tree *tree) {
     return cnt;
 }
 
-int tree_unlink(struct tree *tree) {
-    int result = 0;
-
-    assert (tree->parent != NULL);
-    list_remove(tree, tree->parent->children);
-    tree_mark_dirty(tree->parent);
-    result = free_tree(tree->children) + 1;
-    free_tree_node(tree);
-    return result;
-}
-
 int tree_rm(struct pathx *p) {
     struct tree *tree, **del;
     int cnt = 0, ndel = 0, i;
@@ -1073,7 +1164,7 @@ int tree_rm(struct pathx *p) {
     }
 
     for (i = 0; i < ndel; i++)
-        cnt += tree_unlink(del[i]);
+        cnt += tree_unlink_raw(del[i]);
     free(del);
 
     return cnt;
@@ -1156,33 +1247,6 @@ int aug_span(struct augeas *aug, const char *path, char **filename,
     return result;
 }
 
-int tree_replace(struct augeas *aug, const char *path, struct tree *sub) {
-    struct tree *parent;
-    struct pathx *p = NULL;
-    int r;
-
-    p = pathx_aug_parse(aug, aug->origin, tree_root_ctx(aug), path, true);
-    ERR_BAIL(aug);
-
-    r = tree_rm(p);
-    if (r == -1)
-        goto error;
-
-    parent = tree_set(p, NULL);
-    if (parent == NULL)
-        goto error;
-
-    list_append(parent->children, sub);
-    list_for_each(s, sub) {
-        s->parent = parent;
-    }
-    free_pathx(p);
-    return 0;
- error:
-    free_pathx(p);
-    return -1;
-}
-
 int aug_mv(struct augeas *aug, const char *src, const char *dst) {
     struct pathx *s = NULL, *d = NULL;
     struct tree *ts, *td, *t;
@@ -1225,7 +1289,62 @@ int aug_mv(struct augeas *aug, const char *src, const char *dst) {
     ts->value = NULL;
     ts->children = NULL;
 
-    tree_unlink(ts);
+    tree_unlink(aug, ts);
+    tree_mark_dirty(td);
+
+    ret = 0;
+ error:
+    free_pathx(s);
+    free_pathx(d);
+    api_exit(aug);
+    return ret;
+}
+
+static void tree_copy_rec(struct tree *src, struct tree *dst) {
+  struct tree *n;
+  char *value;
+
+  list_for_each(c, src->children) {
+    value = c->value == NULL ? NULL : strdup(c->value);
+    n = tree_append_s(dst, c->label, value);
+    tree_copy_rec(c, n);
+  }
+}
+
+int aug_cp(struct augeas *aug, const char *src, const char *dst) {
+    struct pathx *s = NULL, *d = NULL;
+    struct tree *ts, *td, *t;
+    int r, ret;
+
+    api_entry(aug);
+
+    ret = -1;
+    s = pathx_aug_parse(aug, aug->origin, tree_root_ctx(aug), src, true);
+    ERR_BAIL(aug);
+
+    d = pathx_aug_parse(aug, aug->origin, tree_root_ctx(aug), dst, true);
+    ERR_BAIL(aug);
+
+    r = find_one_node(s, &ts);
+    if (r < 0)
+        goto error;
+
+    r = pathx_expand_tree(d, &td);
+    if (r == -1)
+        goto error;
+
+    /* Don't copy SRC into its own descendent */
+    t = td;
+    do {
+        ERR_THROW(t == ts, aug, AUG_ECPDESC,
+                  "destination %s is a descendant of %s", dst, src);
+        t = t->parent;
+    } while (t != aug->origin);
+
+    tree_set_value(td, ts->value);
+    free_tree(td->children);
+    td->children = NULL;
+    tree_copy_rec(ts, td);
     tree_mark_dirty(td);
 
     ret = 0;
@@ -1236,6 +1355,37 @@ int aug_mv(struct augeas *aug, const char *src, const char *dst) {
     return ret;
 }
 
+int aug_rename(struct augeas *aug, const char *src, const char *lbl) {
+    struct pathx *s = NULL;
+    struct tree *ts;
+    int ret;
+    int count = 0;
+
+    api_entry(aug);
+
+    ret = -1;
+    ERR_THROW(strchr(lbl, '/') != NULL, aug, AUG_ELABEL,
+              "Label %s contains a /", lbl);
+
+    s = pathx_aug_parse(aug, aug->origin, tree_root_ctx(aug), src, true);
+    ERR_BAIL(aug);
+
+    for (ts = pathx_first(s); ts != NULL; ts = pathx_next(s)) {
+        free(ts->label);
+        ts->label = strdup(lbl);
+        tree_mark_dirty(ts);
+        count ++;
+    }
+
+    free_pathx(s);
+    api_exit(aug);
+    return count;
+ error:
+    free_pathx(s);
+    api_exit(aug);
+    return ret;
+}
+
 int aug_match(const struct augeas *aug, const char *pathin, char ***matches) {
     struct pathx *p = NULL;
     struct tree *tree;
@@ -1397,7 +1547,8 @@ static int unlink_removed_files(struct augeas *aug,
             for (struct tree *t = pathx_first(px);
                  t != NULL;
                  t = pathx_next(px)) {
-                remove_file(aug, t);
+                if (remove_file(aug, t) < 0)
+                    result = -1;
             }
             free_pathx(px);
         } else if (tf->dirty && ! tree_child(tm, "path")) {
@@ -1430,10 +1581,9 @@ int aug_save(struct augeas *aug) {
         transform_validate(aug, xfm);
 
     if (files->dirty) {
-        list_for_each(t, files->children) {
-            if (tree_save(aug, t, AUGEAS_FILES_TREE) == -1)
-                ret = -1;
-        }
+        if (tree_save(aug, files->children, AUGEAS_FILES_TREE) == -1)
+            ret = -1;
+
         /* Remove files whose entire subtree was removed. */
         if (meta_files != NULL) {
             if (unlink_removed_files(aug, files, meta_files) < 0)
@@ -1538,20 +1688,72 @@ int dump_tree(FILE *out, struct tree *tree) {
     return result;
 }
 
+static int to_xml_span(xmlNodePtr elem, const char *pfor, int start, int end) {
+    int r;
+    char *buf;
+    xmlAttrPtr prop;
+    xmlNodePtr span_elem;
+
+    span_elem = xmlNewChild(elem, NULL, BAD_CAST "span", NULL);
+    if (span_elem == NULL)
+        return -1;
+
+    prop = xmlSetProp(span_elem, BAD_CAST "for", BAD_CAST pfor);
+    if (prop == NULL)
+        return -1;
+
+    /* Format and set the start property */
+    r = xasprintf(&buf, "%d", start);
+    if (r < 0)
+        return -1;
+
+    prop = xmlSetProp(span_elem, BAD_CAST "start", BAD_CAST buf);
+    FREE(buf);
+    if (prop == NULL)
+        return -1;
+
+    /* Format and set the end property */
+    r = xasprintf(&buf, "%d", end);
+    if (r < 0)
+        return -1;
+
+    prop = xmlSetProp(span_elem, BAD_CAST "end", BAD_CAST buf);
+    FREE(buf);
+    if (prop == NULL)
+        return -1;
+
+    return 0;
+}
+
 static int to_xml_one(xmlNodePtr elem, const struct tree *tree,
                       const char *pathin) {
     xmlNodePtr value;
     xmlAttrPtr prop;
+    int r;
 
     prop = xmlSetProp(elem, BAD_CAST "label", BAD_CAST tree->label);
     if (prop == NULL)
         goto error;
 
     if (tree->span) {
+        struct span *span = tree->span;
+
         prop = xmlSetProp(elem, BAD_CAST "file",
-                          BAD_CAST tree->span->filename->str);
+                          BAD_CAST span->filename->str);
         if (prop == NULL)
             goto error;
+
+        r = to_xml_span(elem, "label", span->label_start, span->label_end);
+        if (r < 0)
+            goto error;
+
+        r = to_xml_span(elem, "value", span->value_start, span->value_end);
+        if (r < 0)
+            goto error;
+
+        r = to_xml_span(elem, "node", span->span_start, span->span_end);
+        if (r < 0)
+            goto error;
     }
 
     if (pathin != NULL) {
@@ -1627,6 +1829,71 @@ static int tree_to_xml(struct pathx *p, xmlNode **xml, const char *pathin) {
     return -1;
 }
 
+int aug_text_store(augeas *aug, const char *lens, const char *node,
+                   const char *path) {
+
+    struct pathx *p;
+    const char *src;
+    int result = -1, r;
+
+    api_entry(aug);
+
+    /* Validate PATH is syntactically correct */
+    p = pathx_aug_parse(aug, aug->origin, tree_root_ctx(aug), path, true);
+    ERR_BAIL(aug);
+    free_pathx(p);
+
+    r = aug_get(aug, node, &src);
+    ERR_BAIL(aug);
+    ERR_THROW(r == 0, aug, AUG_ENOMATCH,
+              "Source node %s does not exist", node);
+    ERR_THROW(src == NULL, aug, AUG_ENOMATCH,
+              "Source node %s has a NULL value", node);
+
+    result = text_store(aug, lens, path, src);
+ error:
+    api_exit(aug);
+    return result;
+}
+
+int aug_text_retrieve(struct augeas *aug, const char *lens,
+                      const char *node_in, const char *path,
+                      const char *node_out) {
+    struct tree *tree = NULL;
+    const char *src;
+    char *out = NULL;
+    struct tree *tree_out;
+    int r;
+
+    api_entry(aug);
+
+    tree = tree_find(aug, path);
+    ERR_BAIL(aug);
+
+    r = aug_get(aug, node_in, &src);
+    ERR_BAIL(aug);
+    ERR_THROW(r == 0, aug, AUG_ENOMATCH,
+              "Source node %s does not exist", node_in);
+    ERR_THROW(src == NULL, aug, AUG_ENOMATCH,
+              "Source node %s has a NULL value", node_in);
+
+    r = text_retrieve(aug, lens, path, tree, src, &out);
+    if (r < 0)
+        goto error;
+
+    tree_out = tree_find_cr(aug, node_out);
+    ERR_BAIL(aug);
+
+    tree_store_value(tree_out, &out);
+
+    api_exit(aug);
+    return 0;
+ error:
+    free(out);
+    api_exit(aug);
+    return -1;
+}
+
 int aug_to_xml(const struct augeas *aug, const char *pathin,
                xmlNode **xmldoc, unsigned int flags) {
     struct pathx *p;
@@ -1637,7 +1904,7 @@ int aug_to_xml(const struct augeas *aug, const char *pathin,
     ARG_CHECK(flags != 0, aug, "aug_to_xml: FLAGS must be 0");
     ARG_CHECK(xmldoc == NULL, aug, "aug_to_xml: XMLDOC must be non-NULL");
 
-    if (pathin == NULL || strlen(pathin) == 1) {
+    if (pathin == NULL || strlen(pathin) == 0 || strcmp(pathin, "/") == 0) {
         pathin = "/*";
     }
 
@@ -1656,6 +1923,68 @@ int aug_to_xml(const struct augeas *aug, const char *pathin,
     return -1;
 }
 
+int aug_transform(struct augeas *aug, const char *lens,
+                  const char *file, int excl) {
+    struct tree *meta = tree_child_cr(aug->origin, s_augeas);
+    struct tree *load = tree_child_cr(meta, s_load);
+
+    int r = 0, result = -1;
+    struct tree *xfm = NULL, *lns = NULL, *t = NULL;
+    const char *filter = NULL;
+    char *p;
+    int exists;
+    char *lensname = NULL, *xfmname = NULL;
+
+    api_entry(aug);
+
+    ERR_NOMEM(meta == NULL || load == NULL, aug);
+
+    ARG_CHECK(STREQ("", lens), aug, "aug_transform: LENS must not be empty");
+    ARG_CHECK(STREQ("", file), aug, "aug_transform: FILE must not be empty");
+
+    if ((p = strrchr(lens, '.'))) {
+        lensname = strdup(lens);
+        xfmname = strndup(lens, p - lens);
+        ERR_NOMEM(lensname == NULL || xfmname == NULL, aug);
+    } else {
+        r = xasprintf(&lensname, "%s.lns", lens);
+        xfmname = strdup(lens);
+        ERR_NOMEM(r < 0 || xfmname == NULL, aug);
+    }
+
+    xfm = tree_child_cr(load, xfmname);
+    ERR_NOMEM(xfm == NULL, aug);
+
+    lns = tree_child_cr(xfm, s_lens);
+    ERR_NOMEM(lns == NULL, aug);
+
+    tree_store_value(lns, &lensname);
+
+    exists = 0;
+
+    filter = excl ? s_excl : s_incl;
+    list_for_each(c, xfm->children) {
+        if (c->value != NULL && STREQ(c->value, file)
+            && streqv(c->label, filter)) {
+            exists = 1;
+            break;
+        }
+    }
+    if (! exists) {
+        t = tree_append_s(xfm, filter, NULL);
+        ERR_NOMEM(t == NULL, aug);
+        r = tree_set_value(t, file);
+        ERR_NOMEM(r < 0, aug);
+    }
+
+    result = 0;
+ error:
+    free(lensname);
+    free(xfmname);
+    api_exit(aug);
+    return result;
+}
+
 int aug_print(const struct augeas *aug, FILE *out, const char *pathin) {
     struct pathx *p;
     int result;
@@ -1686,6 +2015,11 @@ void aug_close(struct augeas *aug) {
     /* There's no point in bothering with api_entry/api_exit here */
     free_tree(aug->origin);
     unref(aug->modules, module);
+    if (aug->error->exn != NULL) {
+        aug->error->exn->ref = 0;
+        free_value(aug->error->exn);
+        aug->error->exn = NULL;
+    }
     free((void *) aug->root);
     free(aug->modpathz);
     free_symtab(aug->symtab);
index ce8f015..b4d6003 100644 (file)
@@ -50,10 +50,15 @@ enum aug_flags {
     AUG_NO_LOAD      = (1 << 5),  /* Do not load the tree from AUG_INIT */
     AUG_NO_MODL_AUTOLOAD = (1 << 6),
     AUG_ENABLE_SPAN  = (1 << 7),  /* Track the span in the input of nodes */
-    AUG_NO_ERR_CLOSE = (1 << 8)   /* Do not close automatically when
+    AUG_NO_ERR_CLOSE = (1 << 8),  /* Do not close automatically when
                                      encountering error during aug_init */
+    AUG_TRACE_MODULE_LOADING = (1 << 9) /* For use by augparse -t */
 };
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Function: aug_init
  *
  * Initialize the library.
@@ -138,6 +143,23 @@ int aug_defnode(augeas *aug, const char *name, const char *expr,
  */
 int aug_get(const augeas *aug, const char *path, const char **value);
 
+/* Function: aug_label
+ *
+ * Lookup the label associated with PATH. LABEL can be NULL, in which case
+ * it is ignored. If LABEL is not NULL, it is used to return a pointer to
+ * the value associated with PATH if PATH matches exactly one node. If PATH
+ * matches no nodes or more than one node, *LABEL is set to NULL.
+ *
+ * The string *LABEL must not be freed by the caller, and is valid as long
+ * as its node remains unchanged.
+ *
+ * Returns:
+ * 1 if there is exactly one node matching PATH, 0 if there is none,
+ * and a negative value if there is more than one node matching PATH, or if
+ * PATH is not a legal path expression.
+ */
+int aug_label(const augeas *aug, const char *path, const char **label);
+
 /* Function: aug_set
  *
  * Set the value associated with PATH to VALUE. VALUE is copied into the
@@ -221,6 +243,28 @@ int aug_rm(augeas *aug, const char *path);
  */
 int aug_mv(augeas *aug, const char *src, const char *dst);
 
+/* Function: aug_cp
+ *
+ * Copy the node SRC to DST. SRC must match exactly one node in the
+ * tree. DST must either match exactly one node in the tree, or may not
+ * exist yet. If DST exists already, it and all its descendants are
+ * deleted. If DST does not exist yet, it and all its missing ancestors are
+ * created.
+ *
+ * Returns:
+ * 0 on success and -1 on failure.
+ */
+int aug_cp(augeas *aug, const char *src, const char *dst);
+
+/* Function: aug_rename
+ *
+ * Rename the label of all nodes matching SRC to LBL.
+ *
+ * Returns:
+ * The number of nodes renamed on success and -1 on failure.
+ */
+int aug_rename(augeas *aug, const char *src, const char *lbl);
+
 /* Function: aug_match
  *
  * Returns:
@@ -301,6 +345,31 @@ int aug_save(augeas *aug);
  */
 int aug_load(augeas *aug);
 
+/* Function: aug_text_store
+ *
+ * Use the value of node NODE as a string and transform it into a tree
+ * using the lens LENS and store it in the tree at PATH, which will be
+ * overwritten. PATH and NODE are path expressions.
+ *
+ * Returns:
+ * 0 on success, or a negative value on failure
+ */
+int aug_text_store(augeas *aug, const char *lens, const char *node,
+                   const char *path);
+
+/* Function: aug_text_retrieve
+ *
+ * Transform the tree at PATH into a string using lens LENS and store it in
+ * the node NODE_OUT, assuming the tree was initially generated using the
+ * value of node NODE_IN. PATH, NODE_IN, and NODE_OUT are path expressions.
+ *
+ * Returns:
+ * 0 on success, or a negative value on failure
+ */
+int aug_text_retrieve(struct augeas *aug, const char *lens,
+                      const char *node_in, const char *path,
+                      const char *node_out);
+
 /* Function: aug_print
  *
  * Print each node matching PATH and its descendants to OUT.
@@ -324,6 +393,20 @@ int aug_to_xml(const augeas *aug, const char *path, xmlNode **xmldoc,
                unsigned int flags);
 
 /*
+ * Function: aug_transform
+ *
+ * Add a transform for FILE using LENS.
+ * EXCL specifies if this the file is to be included (0)
+ * or excluded (1) from the LENS.
+ * The LENS maybe be a module name or a full lens name.
+ * If a module name is given, then lns will be the lens assumed.
+ *
+ * Returns:
+ * 1 on success, -1 on failure
+ */
+int aug_transform(augeas *aug, const char *lens, const char *file, int excl);
+
+/*
  * Function: aug_srun
  *
  * Run one or more newline-separated commands. The output of the commands
@@ -362,7 +445,9 @@ typedef enum {
     AUG_ENOSPAN,        /* No span for this node */
     AUG_EMVDESC,        /* Cannot move node into its descendant */
     AUG_ECMDRUN,        /* Failed to execute command */
-    AUG_EBADARG         /* Invalid argument in funcion call */
+    AUG_EBADARG,        /* Invalid argument in funcion call */
+    AUG_ELABEL,         /* Invalid label */
+    AUG_ECPDESC         /* Cannot copy node into its descendant */
 } aug_errcode_t;
 
 /* Return the error code from the last API call */
@@ -381,6 +466,12 @@ const char *aug_error_minor_message(augeas *aug);
  * occurred. The returned value can only be used until the next API call
  */
 const char *aug_error_details(augeas *aug);
+
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 
 
index 5c29ab7..3740f67 100644 (file)
@@ -51,3 +51,17 @@ AUGEAS_0.15.0 {
     global:
       aug_to_xml;
 } AUGEAS_0.14.0;
+
+AUGEAS_0.16.0 {
+    global:
+      aug_text_store;
+      aug_text_retrieve;
+      aug_rename;
+      aug_transform;
+      aug_label;
+} AUGEAS_0.15.0;
+
+AUGEAS_0.18.0 {
+    global:
+      aug_cp;
+} AUGEAS_0.16.0;
index 01c2be4..863b1e4 100644 (file)
@@ -38,6 +38,7 @@ static void usage(void) {
     fprintf(stderr, "Evaluate MODULE. Generally, MODULE should contain unit tests.\n");
     fprintf(stderr, "\nOptions:\n\n");
     fprintf(stderr, "  -I, --include DIR  search DIR for modules; can be given mutiple times\n");
+    fprintf(stderr, "  -t, --trace        trace module loading\n");
     fprintf(stderr, "  --nostdinc         do not search the builtin default directories for modules\n");
     fprintf(stderr, "  --notypecheck      do not typecheck lenses\n");
     fprintf(stderr, "  --version          print version information and exit\n");
@@ -78,6 +79,7 @@ int main(int argc, char **argv) {
     struct option options[] = {
         { "help",      0, 0, 'h' },
         { "include",   1, 0, 'I' },
+        { "trace",     0, 0, 't' },
         { "nostdinc",  0, 0, VAL_NO_STDINC },
         { "notypecheck",  0, 0, VAL_NO_TYPECHECK },
         { "version",  0, 0, VAL_VERSION },
@@ -88,11 +90,14 @@ int main(int argc, char **argv) {
     progname = argv[0];
 
     setlocale(LC_ALL, "");
-    while ((opt = getopt_long(argc, argv, "hI:", options, &idx)) != -1) {
+    while ((opt = getopt_long(argc, argv, "hI:t", options, &idx)) != -1) {
         switch(opt) {
         case 'I':
             argz_add(&loadpath, &loadpathlen, optarg);
             break;
+        case 't':
+            flags |= AUG_TRACE_MODULE_LOADING;
+            break;
         case 'h':
             usage();
             break;
index 1170335..9e1d46f 100644 (file)
@@ -60,14 +60,13 @@ typedef void (*cmd_handler)(struct command*);
 
 struct command_def {
     const char                   *name;
+    const char                   *category;
     const struct command_opt_def *opts;
     cmd_handler                   handler;
     const char                   *synopsis;
     const char                   *help;
 };
 
-static const struct command_def const *commands[];
-
 static const struct command_def cmd_def_last =
     { .name = NULL, .opts = NULL, .handler = NULL,
       .synopsis = NULL, .help = NULL };
@@ -78,13 +77,15 @@ struct command_opt {
     char                         *value;
 };
 
-static const struct command_def *lookup_cmd_def(const char *name) {
-    for (int i = 0; commands[i]->name != NULL; i++) {
-        if (STREQ(name, commands[i]->name))
-            return commands[i];
-    }
-    return NULL;
-}
+struct command_grp_def {
+    const char                     *name;
+    const struct command_def const *commands[];
+};
+
+static const struct command_grp_def cmd_grp_def_last =
+    { .name = NULL, .commands = { } };
+
+static const struct command_def *lookup_cmd_def(const char *name);
 
 static const struct command_opt_def *
 find_def(const struct command *cmd, const char *name) {
@@ -120,30 +121,38 @@ static char *nexttoken(struct command *cmd, char **line, bool path) {
     char quot = '\0';
     int nbracket = 0;
     int nescaped = 0;
+    bool copy;
 
     s = *line;
 
     while (*s && isblank(*s)) s+= 1;
-    if (*s == '\'' || *s == '"') {
-        quot = *s;
-        s += 1;
-    }
     r = s;
     w = s;
     while (*s) {
+        copy = true;
         if (*s == '\\') {
             switch (*(s+1)) {
                 case '[':
                 case ']':  /* pass both literally */
                     nescaped = 2;
                     break;
+                case 't':  /* insert tab */
+                    *(s+1) = '\t';
+                    nescaped = 1;
+                    s += 1;
+                    break;
+                case 'n':  /* insert newline */
+                    *(s+1) = '\n';
+                    nescaped = 1;
+                    s += 1;
+                    break;
                 case ' ':
-                case '\t':
+                case '\t': /* pass both through if quoted, else fall */
                     if (quot) break;
                 case '\'':
-                case '"':
+                case '"':  /* pass both through if opposite quote, else fall */
                     if (quot && quot != *(s+1)) break;
-                case '\\':
+                case '\\': /* pass next character through */
                     nescaped = 1;
                     s += 1;
                     break;
@@ -160,21 +169,37 @@ static char *nexttoken(struct command *cmd, char **line, bool path) {
                 ERR_REPORT(cmd, AUG_ECMDRUN, "unmatched [");
                 return NULL;
             }
-            if ((quot && *s == quot)
-                || (!quot && isblank(*s) && (!path || nbracket == 0)))
-                break;
+
+            if (!path || nbracket == 0) {
+                if (!quot && (*s == '\'' || *s == '"')) {
+                    quot = *s;
+                    copy = false;
+                } else if (quot && *s == quot) {
+                    quot = '\0';
+                    copy = false;
+                }
+
+                if (!quot && isblank(*s))
+                    break;
+            }
         } else {
             nescaped -= 1;
         }
 
-        *w = *s;
+        if (copy) {
+            *w = *s;
+            w += 1;
+        }
         s += 1;
-        w += 1;
     }
     if (*s == '\0' && path && nbracket > 0) {
         ERR_REPORT(cmd, AUG_ECMDRUN, "unmatched [");
         return NULL;
     }
+    if (*s == '\0' && quot) {
+        ERR_REPORT(cmd, AUG_ECMDRUN, "unmatched %c", quot);
+        return NULL;
+    }
     while (*w && w <= s)
         *w++ = '\0';
     *line = w;
@@ -211,8 +236,6 @@ static int parseline(struct command *cmd, char *line) {
     int narg = 0, nopt = 0;
     const struct command_opt_def *def;
 
-    free_command_opts(cmd);
-
     tok = nexttoken(cmd, &line, false);
     if (tok == NULL)
         return -1;
@@ -295,51 +318,7 @@ static void format_defname(char *buf, const struct command_opt_def *def,
     *p = '\0';
 }
 
-static void cmd_help(struct command *cmd) {
-    const char *name = arg_value(cmd, "command");
-    char buf[100];
-
-    if (name == NULL) {
-        fprintf(cmd->out, "Commands:\n\n");
-        for (int i=0; commands[i]->name != NULL; i++) {
-            const struct command_def *def = commands[i];
-            fprintf(cmd->out, "    %-10s - %s\n", def->name, def->synopsis);
-        }
-        fprintf(cmd->out,
-           "\nType 'help <command>' for more information on a command\n\n");
-    } else {
-        const struct command_def *def = lookup_cmd_def(name);
-        const struct command_opt_def *odef = NULL;
-
-        ERR_THROW(def == NULL, cmd->aug, AUG_ECMDRUN,
-                  "unknown command %s\n", name);
-        fprintf(cmd->out, "  COMMAND\n");
-        fprintf(cmd->out, "    %s - %s\n\n", name, def->synopsis);
-        fprintf(cmd->out, "  SYNOPSIS\n");
-        fprintf(cmd->out, "    %s", name);
-
-        for (odef = def->opts; odef->name != NULL; odef++) {
-            format_defname(buf, odef, true);
-            fprintf(cmd->out, "%s", buf);
-        }
-        fprintf(cmd->out, "\n\n");
-        fprintf(cmd->out, "  DESCRIPTION\n");
-        format_desc(def->help);
-        if (def->opts->name != NULL) {
-            fprintf(cmd->out, "  OPTIONS\n");
-            for (odef = def->opts; odef->name != NULL; odef++) {
-                const char *help = odef->help;
-                if (help == NULL)
-                    help = "";
-                format_defname(buf, odef, false);
-                fprintf(cmd->out, "    %-10s %s\n", buf, help);
-            }
-        }
-        fprintf(cmd->out, "\n");
-    }
- error:
-    return;
-}
+static void cmd_help(struct command *cmd);
 
 static const struct command_opt_def cmd_help_opts[] = {
     { .type = CMD_STR, .name = "command", .optional = true,
@@ -558,6 +537,80 @@ static const struct command_def cmd_move_def = {
     .help = cmd_mv_help
 };
 
+static void cmd_cp(struct command *cmd) {
+    const char *src = arg_value(cmd, "src");
+    const char *dst = arg_value(cmd, "dst");
+    int r;
+
+    r = aug_cp(cmd->aug, src, dst);
+    if (r < 0)
+        ERR_REPORT(cmd, AUG_ECMDRUN,
+                   "Copying %s to %s failed", src, dst);
+}
+
+static const struct command_opt_def cmd_cp_opts[] = {
+    { .type = CMD_PATH, .name = "src", .optional = false,
+      .help = "the tree to copy" },
+    { .type = CMD_PATH, .name = "dst", .optional = false,
+      .help = "where to copy the source tree" },
+    CMD_OPT_DEF_LAST
+};
+
+static const char const cmd_cp_help[] =
+    "Copy node  SRC to DST.  SRC must match  exactly one node in  "
+    "the tree.\n DST  must either  match  exactly one  node  in the  tree,  "
+    "or may  not\n exist  yet. If  DST exists  already, it  and all  its  "
+    "descendants are\n deleted.  If  DST  does  not   exist  yet,  it  and  "
+    "all  its  missing\n ancestors are created.";
+
+static const struct command_def cmd_cp_def = {
+    .name = "cp",
+    .opts = cmd_cp_opts,
+    .handler = cmd_cp,
+    .synopsis = "copy a subtree",
+    .help = cmd_cp_help
+};
+
+static const struct command_def cmd_copy_def = {
+    .name = "copy",
+    .opts = cmd_cp_opts,
+    .handler = cmd_cp,
+    .synopsis = "copy a subtree (alias of 'cp')",
+    .help = cmd_cp_help
+};
+
+static void cmd_rename(struct command *cmd) {
+    const char *src = arg_value(cmd, "src");
+    const char *lbl = arg_value(cmd, "lbl");
+    int cnt;
+
+    cnt = aug_rename(cmd->aug, src, lbl);
+    if (cnt < 0)
+        ERR_REPORT(cmd, AUG_ECMDRUN,
+                   "Renaming %s to %s failed", src, lbl);
+    if (! HAS_ERR(cmd))
+        fprintf(cmd->out, "rename : %s to %s %d\n", src, lbl, cnt);
+}
+
+static const struct command_opt_def cmd_rename_opts[] = {
+    { .type = CMD_PATH, .name = "src", .optional = false,
+      .help = "the tree to rename" },
+    { .type = CMD_STR, .name = "lbl", .optional = false,
+      .help = "the new label" },
+    CMD_OPT_DEF_LAST
+};
+
+static const char const cmd_rename_help[] =
+    "Rename the label of all nodes matching SRC to LBL.";
+
+static const struct command_def cmd_rename_def = {
+    .name = "rename",
+    .opts = cmd_rename_opts,
+    .handler = cmd_rename,
+    .synopsis = "rename a subtree label",
+    .help = cmd_rename_help
+};
+
 static void cmd_set(struct command *cmd) {
     const char *path = arg_value(cmd, "path");
     const char *val = arg_value(cmd, "value");
@@ -571,7 +624,7 @@ static void cmd_set(struct command *cmd) {
 static const struct command_opt_def cmd_set_opts[] = {
     { .type = CMD_PATH, .name = "path", .optional = false,
       .help = "set the value of this node" },
-    { .type = CMD_STR, .name = "value", .optional = false,
+    { .type = CMD_STR, .name = "value", .optional = true,
       .help = "the new value for the node" },
     CMD_OPT_DEF_LAST
 };
@@ -599,7 +652,7 @@ static const struct command_opt_def cmd_setm_opts[] = {
       .help = "the base node" },
     { .type = CMD_PATH, .name = "sub", .optional = false,
       .help = "the subtree relative to the base" },
-    { .type = CMD_STR, .name = "value", .optional = false,
+    { .type = CMD_STR, .name = "value", .optional = true,
       .help = "the value for the nodes" },
     CMD_OPT_DEF_LAST
 };
@@ -685,7 +738,7 @@ static const struct command_def cmd_span_def = {
     .name = "span",
     .opts = cmd_span_opts,
     .handler = cmd_span,
-    .synopsis = "Print information get the filename, label and value position in the text of this node",
+    .synopsis = "print position in input file corresponding to tree",
     .help = "Print the name of the file from which the node PATH was generated, as\n well as information about the positions in the file  corresponding to\n the label, the value, and the  entire  node. PATH must match  exactly\n one node.\n\n You need to run 'set /augeas/span enable' prior to  loading files to\n enable recording of span information. It is disabled by default."
 };
 
@@ -720,8 +773,7 @@ static void cmd_defnode(struct command *cmd) {
     const char *path = arg_value(cmd, "expr");
     const char *value = arg_value(cmd, "value");
 
-    /* Our simple minded line parser treats non-existant and empty values
-     * the same. We choose to take the empty string to mean NULL */
+    /* Make 'defnode foo ""' mean the same as 'defnode foo' */
     if (value != NULL && strlen(value) == 0)
         value = NULL;
     aug_defnode(cmd->aug, name, path, value, NULL);
@@ -742,7 +794,7 @@ static const struct command_def cmd_defnode_def = {
     .opts = cmd_defnode_opts,
     .handler = cmd_defnode,
     .synopsis = "set a variable, possibly creating a new node",
-    .help = "Define the variable NAME to the result of evalutating EXPR, "
+    .help = "Define the variable NAME to the result of evaluating EXPR, "
     " which must\n be a nodeset.  If no node matching EXPR exists yet,  one "
     "is created and\n NAME will refer to it.   When a node is created and "
     "VALUE is given, the\n new node's value is set to VALUE."
@@ -773,6 +825,34 @@ static const struct command_def cmd_clear_def = {
     "will appear\n last amongst their siblings"
 };
 
+static void cmd_touch(struct command *cmd) {
+    const char *path = arg_value(cmd, "path");
+    int r;
+
+    r = aug_match(cmd->aug, path, NULL);
+    if (r == 0) {
+        r = aug_set(cmd->aug, path, NULL);
+        if (r < 0)
+            ERR_REPORT(cmd, AUG_ECMDRUN, "Touching %s failed", path);
+    }
+}
+
+static const struct command_opt_def cmd_touch_opts[] = {
+    { .type = CMD_PATH, .name = "path", .optional = false,
+      .help = "touch this node" },
+    CMD_OPT_DEF_LAST
+};
+
+static const struct command_def cmd_touch_def = {
+    .name = "touch",
+    .opts = cmd_touch_opts,
+    .handler = cmd_touch,
+    .synopsis = "create a new node",
+    .help = "Create PATH with the value NULL if it is not in the tree yet.  "
+    "All its\n ancestors will also be created.  These new tree entries will "
+    "appear\n last amongst their siblings."
+};
+
 static void cmd_get(struct command *cmd) {
     const char *path = arg_value(cmd, "path");
     const char *val;
@@ -804,6 +884,37 @@ static const struct command_def cmd_get_def = {
     .help = "Get and print the value associated with PATH"
 };
 
+static void cmd_label(struct command *cmd) {
+    const char *path = arg_value(cmd, "path");
+    const char *lbl;
+    int r;
+
+    r = aug_label(cmd->aug, path, &lbl);
+    ERR_RET(cmd);
+    fprintf(cmd->out, "%s", path);
+    if (r == 0) {
+        fprintf(cmd->out, " (o)\n");
+    } else if (lbl == NULL) {
+        fprintf(cmd->out, " (none)\n");
+    } else {
+        fprintf(cmd->out, " = %s\n", lbl);
+    }
+}
+
+static const struct command_opt_def cmd_label_opts[] = {
+    { .type = CMD_PATH, .name = "path", .optional = false,
+      .help = "get the label of this node" },
+    CMD_OPT_DEF_LAST
+};
+
+static const struct command_def cmd_label_def = {
+    .name = "label",
+    .opts = cmd_label_opts,
+    .handler = cmd_label,
+    .synopsis = "get the label of a node",
+    .help = "Get and print the label associated with PATH"
+};
+
 static void cmd_print(struct command *cmd) {
     const char *path = arg_value(cmd, "path");
 
@@ -826,30 +937,23 @@ static const struct command_def cmd_print_def = {
 
 static void cmd_dump_xml(struct command *cmd) {
     const char *path = arg_value(cmd, "path");
-    const char *filename = arg_value(cmd, "filename");
     xmlNodePtr xmldoc;
     int r;
 
     r = aug_to_xml(cmd->aug, path, &xmldoc, 0);
     if (r < 0)
         ERR_REPORT(cmd, AUG_ECMDRUN,
-                   "XML export of path %s to file %s failed", path, filename);
+                   "XML export of path %s failed", path);
 
     xmlElemDump(stdout, NULL, xmldoc);
     printf("\n");
 
-    if (filename != NULL) {
-        printf("Saving to %s\n", filename);
-    }
-
     xmlFreeNode(xmldoc);
 }
 
 static const struct command_opt_def cmd_dump_xml_opts[] = {
     { .type = CMD_PATH, .name = "path", .optional = true,
       .help = "print this subtree" },
-    { .type = CMD_NONE, .name = "filename", .optional = true,
-      .help = "save to this file" },
     CMD_OPT_DEF_LAST
 };
 
@@ -858,7 +962,52 @@ static const struct command_def cmd_dump_xml_def = {
     .opts = cmd_dump_xml_opts,
     .handler = cmd_dump_xml,
     .synopsis = "print a subtree as XML",
-    .help = "Export entries in the tree as XML. If PATH is given, printing starts there,\n otherwise the whole tree is printed. If FILENAME is given, the XML is saved\n to the given file."
+    .help = "Export entries in the tree as XML. If PATH is given, printing starts there,\n otherwise the whole tree is printed."
+};
+
+static void cmd_transform(struct command *cmd) {
+    const char *lens = arg_value(cmd, "lens");
+    const char *filter = arg_value(cmd, "filter");
+    const char *file = arg_value(cmd, "file");
+    int r, excl = 0;
+
+    if (STREQ("excl", filter))
+        excl = 1;
+    else if (STREQ("incl", filter))
+        excl = 0;
+    else
+        ERR_REPORT(cmd, AUG_ECMDRUN,
+                   "FILTER must be \"incl\" or \"excl\"");
+
+    r = aug_transform(cmd->aug, lens, file, excl);
+    if (r < 0)
+        ERR_REPORT(cmd, AUG_ECMDRUN,
+                   "Adding transform for %s on lens %s failed", lens, file);
+}
+
+static const struct command_opt_def cmd_transform_opts[] = {
+    { .type = CMD_PATH, .name = "lens", .optional = false,
+      .help = "the lens to use" },
+    { .type = CMD_PATH, .name = "filter", .optional = false,
+      .help = "the type of filter, either \"incl\" or \"excl\"" },
+    { .type = CMD_PATH, .name = "file", .optional = false,
+      .help = "the file to associate to the lens" },
+    CMD_OPT_DEF_LAST
+};
+
+static const char const cmd_transform_help[] =
+    "Add a transform for FILE using LENS. The LENS may be a module name or a\n"
+    " full lens name.  If a module name is given, then \"lns\" will be the lens\n"
+    " assumed.  The FILTER must be either \"incl\" or \"excl\".  If the filter is\n"
+    " \"incl\",  the FILE will be parsed by the LENS.  If the filter is \"excl\",\n"
+    " the FILE will be excluded from the LENS. FILE may contain wildcards." ;
+
+static const struct command_def cmd_transform_def = {
+    .name = "transform",
+    .opts = cmd_transform_opts,
+    .handler = cmd_transform,
+    .synopsis = "add a file transform",
+    .help = cmd_transform_help
 };
 
 static void cmd_save(struct command *cmd) {
@@ -963,31 +1112,196 @@ static const struct command_def cmd_insert_def = {
     .help = cmd_ins_help
 };
 
-static const struct command_def const *commands[] = {
-    &cmd_quit_def,
-    &cmd_clear_def,
-    &cmd_defnode_def,
-    &cmd_defvar_def,
-    &cmd_get_def,
-    &cmd_ins_def,
-    &cmd_insert_def,
-    &cmd_load_def,
-    &cmd_ls_def,
-    &cmd_match_def,
-    &cmd_mv_def,
-    &cmd_move_def,
-    &cmd_print_def,
-    &cmd_dump_xml_def,
-    &cmd_rm_def,
-    &cmd_save_def,
-    &cmd_set_def,
-    &cmd_setm_def,
-    &cmd_clearm_def,
-    &cmd_span_def,
-    &cmd_help_def,
-    &cmd_def_last
+static void cmd_store(struct command *cmd) {
+    const char *lens = arg_value(cmd, "lens");
+    const char *path = arg_value(cmd, "path");
+    const char *node = arg_value(cmd, "node");
+
+    aug_text_store(cmd->aug, lens, node, path);
+}
+
+static const struct command_opt_def cmd_store_opts[] = {
+    { .type = CMD_STR, .name = "lens", .optional = false,
+      .help = "the name of the lens" },
+    { .type = CMD_PATH, .name = "node", .optional = false,
+      .help = "where to find the input text" },
+    { .type = CMD_PATH, .name = "path", .optional = false,
+      .help = "where to store parsed text" },
+    CMD_OPT_DEF_LAST
+};
+
+static const char const cmd_store_help[] =
+    "Parse NODE using LENS and store the resulting tree at PATH.";
+
+static const struct command_def cmd_store_def = {
+    .name = "store",
+    .opts = cmd_store_opts,
+    .handler = cmd_store,
+    .synopsis = "parse text into tree",
+    .help = cmd_store_help
 };
 
+static void cmd_retrieve(struct command *cmd) {
+    const char *lens = arg_value(cmd, "lens");
+    const char *node_in = arg_value(cmd, "node_in");
+    const char *path = arg_value(cmd, "path");
+    const char *node_out = arg_value(cmd, "node_out");
+
+    aug_text_retrieve(cmd->aug, lens, node_in, path, node_out);
+}
+
+static const struct command_opt_def cmd_retrieve_opts[] = {
+    { .type = CMD_STR, .name = "lens", .optional = false,
+      .help = "the name of the lens" },
+    { .type = CMD_PATH, .name = "node_in", .optional = false,
+      .help = "the node containing the initial text (path expression)" },
+    { .type = CMD_PATH, .name = "path", .optional = false,
+      .help = "the tree to transform (path expression)" },
+    { .type = CMD_PATH, .name = "node_out", .optional = false,
+      .help = "where to store the resulting text (path expression)" },
+    CMD_OPT_DEF_LAST
+};
+
+static const char const cmd_retrieve_help[] =
+    "Transform tree at PATH back into text using lens LENS and store the\n"
+    " resulting string at NODE_OUT. Assume that the tree was initially read in\n"
+    " with the same lens and the string stored at NODE_IN as input.";
+
+static const struct command_def cmd_retrieve_def = {
+    .name = "retrieve",
+    .opts = cmd_retrieve_opts,
+    .handler = cmd_retrieve,
+    .synopsis = "transform tree into text",
+    .help = cmd_retrieve_help
+};
+
+/* Groups of commands */
+static const struct command_grp_def cmd_grp_admin_def = {
+    .name = "Admin",
+    .commands = {
+        &cmd_help_def,
+        &cmd_load_def,
+        &cmd_quit_def,
+        &cmd_retrieve_def,
+        &cmd_save_def,
+        &cmd_store_def,
+        &cmd_transform_def,
+        &cmd_def_last
+    }
+};
+
+static const struct command_grp_def cmd_grp_read_def = {
+    .name = "Read",
+    .commands = {
+        &cmd_dump_xml_def,
+        &cmd_get_def,
+        &cmd_label_def,
+        &cmd_ls_def,
+        &cmd_match_def,
+        &cmd_print_def,
+        &cmd_span_def,
+        &cmd_def_last
+    }
+};
+
+static const struct command_grp_def cmd_grp_write_def = {
+    .name = "Write",
+    .commands = {
+        &cmd_clear_def,
+        &cmd_clearm_def,
+        &cmd_ins_def,
+        &cmd_insert_def,
+        &cmd_mv_def,
+        &cmd_move_def,
+        &cmd_cp_def,
+        &cmd_copy_def,
+        &cmd_rename_def,
+        &cmd_rm_def,
+        &cmd_set_def,
+        &cmd_setm_def,
+        &cmd_touch_def,
+        &cmd_def_last
+    }
+};
+
+static const struct command_grp_def cmd_grp_pathx_def = {
+    .name = "Path expression",
+    .commands = {
+        &cmd_defnode_def,
+        &cmd_defvar_def,
+        &cmd_def_last
+    }
+};
+
+static const struct command_grp_def const *cmd_groups[] = {
+    &cmd_grp_admin_def,
+    &cmd_grp_read_def,
+    &cmd_grp_write_def,
+    &cmd_grp_pathx_def,
+    &cmd_grp_def_last
+};
+
+static const struct command_def *lookup_cmd_def(const char *name) {
+    for (int i = 0; cmd_groups[i]->name != NULL; i++) {
+        for (int j = 0; cmd_groups[i]->commands[j]->name != NULL; j++) {
+            if (STREQ(name, cmd_groups[i]->commands[j]->name))
+                return cmd_groups[i]->commands[j];
+        }
+    }
+    return NULL;
+}
+
+static void cmd_help(struct command *cmd) {
+    const char *name = arg_value(cmd, "command");
+    char buf[100];
+
+    if (name == NULL) {
+        //fprintf(cmd->out, "Commands:\n\n");
+        fprintf(cmd->out, "\n");
+        for (int i=0; cmd_groups[i]->name != NULL; i++) {
+            fprintf(cmd->out, "%s commands:\n", cmd_groups[i]->name);
+            for (int j=0; cmd_groups[i]->commands[j]->name != NULL; j++) {
+                const struct command_def *def = cmd_groups[i]->commands[j];
+                fprintf(cmd->out, "  %-10s - %s\n", def->name, def->synopsis);
+            }
+            fprintf(cmd->out, "\n");
+        }
+        fprintf(cmd->out,
+           "Type 'help <command>' for more information on a command\n\n");
+    } else {
+        const struct command_def *def = lookup_cmd_def(name);
+        const struct command_opt_def *odef = NULL;
+
+        ERR_THROW(def == NULL, cmd->aug, AUG_ECMDRUN,
+                  "unknown command %s\n", name);
+        fprintf(cmd->out, "  COMMAND\n");
+        fprintf(cmd->out, "    %s - %s\n\n", name, def->synopsis);
+        fprintf(cmd->out, "  SYNOPSIS\n");
+        fprintf(cmd->out, "    %s", name);
+
+        for (odef = def->opts; odef->name != NULL; odef++) {
+            format_defname(buf, odef, true);
+            fprintf(cmd->out, "%s", buf);
+        }
+        fprintf(cmd->out, "\n\n");
+        fprintf(cmd->out, "  DESCRIPTION\n");
+        format_desc(def->help);
+        if (def->opts->name != NULL) {
+            fprintf(cmd->out, "  OPTIONS\n");
+            for (odef = def->opts; odef->name != NULL; odef++) {
+                const char *help = odef->help;
+                if (help == NULL)
+                    help = "";
+                format_defname(buf, odef, false);
+                fprintf(cmd->out, "    %-10s %s\n", buf, help);
+            }
+        }
+        fprintf(cmd->out, "\n");
+    }
+ error:
+    return;
+}
+
 int aug_srun(augeas *aug, FILE *out, const char *text) {
     char *line = NULL;
     const char *eol;
@@ -1029,6 +1343,8 @@ int aug_srun(augeas *aug, FILE *out, const char *text) {
             result = -2;
             goto done;
         }
+
+        free_command_opts(&cmd);
         FREE(line);
         text = (*eol == '\0') ? eol : eol + 1;
     }
index e9c1422..c7be484 100644 (file)
@@ -44,8 +44,10 @@ static const char *const progname = "augtool";
 static unsigned int flags = AUG_NONE;
 const char *root = NULL;
 char *loadpath = NULL;
+char *transforms = NULL;
+size_t transformslen = 0;
 const char *inputfile = NULL;
-int echo = 0;         /* Gets also changed in main_loop */
+int echo_commands = 0;         /* Gets also changed in main_loop */
 bool print_version = false;
 bool auto_save = false;
 bool interactive = false;
@@ -166,9 +168,10 @@ static char *readline_command_generator(const char *text, int state) {
     // FIXME: expose somewhere under /augeas
     static const char *const commands[] = {
         "quit", "clear", "defnode", "defvar",
-        "get", "ins", "load", "ls", "match",
-        "mv", "print", "dump-xml", "rm", "save", "set", "setm",
-        "clearm", "span", "help", NULL };
+        "get", "label", "ins", "load", "ls", "match",
+        "mv", "cp", "rename", "print", "dump-xml", "rm", "save", "set", "setm",
+        "clearm", "span", "store", "retrieve", "transform",
+        "help", "touch", "insert", "move", "copy", NULL };
 
     static int current = 0;
     const char *name;
@@ -266,22 +269,26 @@ static void usage(void) {
     fprintf(stderr, "Run '%s help' to get a list of possible commands.\n",
             progname);
     fprintf(stderr, "\nOptions:\n\n");
-    fprintf(stderr, "  -c, --typecheck    typecheck lenses\n");
-    fprintf(stderr, "  -b, --backup       preserve originals of modified files with\n"
-                    "                     extension '.augsave'\n");
-    fprintf(stderr, "  -n, --new          save changes in files with extension '.augnew',\n"
-                    "                     leave original unchanged\n");
-    fprintf(stderr, "  -r, --root ROOT    use ROOT as the root of the filesystem\n");
-    fprintf(stderr, "  -I, --include DIR  search DIR for modules; can be given mutiple times\n");
-    fprintf(stderr, "  -e, --echo         echo commands when reading from a file\n");
-    fprintf(stderr, "  -f, --file FILE    read commands from FILE\n");
-    fprintf(stderr, "  -s, --autosave     automatically save at the end of instructions\n");
-    fprintf(stderr, "  -i, --interactive  run an interactive shell after evaluating the commands in STDIN and FILE\n");
-    fprintf(stderr, "  -S, --nostdinc     do not search the builtin default directories for modules\n");
-    fprintf(stderr, "  -L, --noload       do not load any files into the tree on startup\n");
-    fprintf(stderr, "  -A, --noautoload   do not autoload modules from the search path\n");
-    fprintf(stderr, "  --span             load span positions for nodes related to a file\n");
-    fprintf(stderr, "  --version          print version information and exit.\n");
+    fprintf(stderr, "  -c, --typecheck      typecheck lenses\n");
+    fprintf(stderr, "  -b, --backup         preserve originals of modified files with\n"
+                    "                       extension '.augsave'\n");
+    fprintf(stderr, "  -n, --new            save changes in files with extension '.augnew',\n"
+                    "                       leave original unchanged\n");
+    fprintf(stderr, "  -r, --root ROOT      use ROOT as the root of the filesystem\n");
+    fprintf(stderr, "  -I, --include DIR    search DIR for modules; can be given multiple times\n");
+    fprintf(stderr, "  -t, --transform XFM  add a file transform; uses the 'transform' command\n"
+                    "                       syntax, e.g. -t 'Fstab incl /etc/fstab.bak'\n");
+    fprintf(stderr, "  -e, --echo           echo commands when reading from a file\n");
+    fprintf(stderr, "  -f, --file FILE      read commands from FILE\n");
+    fprintf(stderr, "  -s, --autosave       automatically save at the end of instructions\n");
+    fprintf(stderr, "  -i, --interactive    run an interactive shell after evaluating\n"
+                    "                       the commands in STDIN and FILE\n");
+    fprintf(stderr, "  -S, --nostdinc       do not search the builtin default directories\n"
+                    "                       for modules\n");
+    fprintf(stderr, "  -L, --noload         do not load any files into the tree on startup\n");
+    fprintf(stderr, "  -A, --noautoload     do not autoload modules from the search path\n");
+    fprintf(stderr, "  --span               load span positions for nodes related to a file\n");
+    fprintf(stderr, "  --version            print version information and exit.\n");
 
     exit(EXIT_FAILURE);
 }
@@ -294,26 +301,27 @@ static void parse_opts(int argc, char **argv) {
         VAL_SPAN = VAL_VERSION + 1
     };
     struct option options[] = {
-        { "help",      0, 0, 'h' },
-        { "typecheck", 0, 0, 'c' },
-        { "backup",    0, 0, 'b' },
-        { "new",       0, 0, 'n' },
-        { "root",      1, 0, 'r' },
-        { "include",   1, 0, 'I' },
-        { "echo",      0, 0, 'e' },
-        { "file",      1, 0, 'f' },
-        { "autosave",  0, 0, 's' },
-        { "interactive",  0, 0, 'i' },
-        { "nostdinc",  0, 0, 'S' },
-        { "noload",    0, 0, 'L' },
-        { "noautoload", 0, 0, 'A' },
-        { "span",      0, 0, VAL_SPAN },
-        { "version",   0, 0, VAL_VERSION },
+        { "help",        0, 0, 'h' },
+        { "typecheck",   0, 0, 'c' },
+        { "backup",      0, 0, 'b' },
+        { "new",         0, 0, 'n' },
+        { "root",        1, 0, 'r' },
+        { "include",     1, 0, 'I' },
+        { "transform",   1, 0, 't' },
+        { "echo",        0, 0, 'e' },
+        { "file",        1, 0, 'f' },
+        { "autosave",    0, 0, 's' },
+        { "interactive", 0, 0, 'i' },
+        { "nostdinc",    0, 0, 'S' },
+        { "noload",      0, 0, 'L' },
+        { "noautoload",  0, 0, 'A' },
+        { "span",        0, 0, VAL_SPAN },
+        { "version",     0, 0, VAL_VERSION },
         { 0, 0, 0, 0}
     };
     int idx;
 
-    while ((opt = getopt_long(argc, argv, "hnbcr:I:ef:siSLA", options, &idx)) != -1) {
+    while ((opt = getopt_long(argc, argv, "hnbcr:I:t:ef:siSLA", options, &idx)) != -1) {
         switch(opt) {
         case 'c':
             flags |= AUG_TYPE_CHECK;
@@ -333,8 +341,11 @@ static void parse_opts(int argc, char **argv) {
         case 'I':
             argz_add(&loadpath, &loadpathlen, optarg);
             break;
+        case 't':
+            argz_add(&transforms, &transformslen, optarg);
+            break;
         case 'e':
-            echo = 1;
+            echo_commands = 1;
             break;
         case 'f':
             inputfile = optarg;
@@ -423,8 +434,6 @@ static int main_loop(void) {
     bool end_reached = false;
     bool get_line = true;
     bool in_interactive = false;
-    // make readline silent by default
-    rl_outstream = fopen("/dev/null", "w");
 
     if (inputfile) {
         if (freopen(inputfile, "r", stdin) == NULL) {
@@ -437,10 +446,12 @@ static int main_loop(void) {
         }
     }
 
-    echo = echo || isatty(fileno(stdin));
-
-    if (echo)
+    // make readline silent by default
+    echo_commands = echo_commands || isatty(fileno(stdin));
+    if (echo_commands)
         rl_outstream = NULL;
+    else
+        rl_outstream = fopen("/dev/null", "w");
 
     while(1) {
         if (get_line) {
@@ -451,28 +462,37 @@ static int main_loop(void) {
 
         if (line == NULL) {
             if (!isatty(fileno(stdin)) && interactive && !in_interactive) {
-               in_interactive = true;
-               echo = true;
-               // reopen in and out streams
-               if ((rl_instream = fopen("/dev/tty", "r")) == NULL) {
-                   perror("Failed to open terminal for reading");
-                   return -1;
-               }
-               if (rl_outstream != NULL) {
-                   fclose(rl_outstream);
-                   rl_outstream = NULL;
-               }
-               if ((rl_outstream = fopen("/dev/stdout", "w")) == NULL) {
-                   perror("Failed to reopen stdout");
-                   return -1;
-               }
-               continue;
+                in_interactive = true;
+                if (echo_commands)
+                    printf("\n");
+                echo_commands = true;
+
+                // reopen in stream
+                if ((rl_instream = fopen("/dev/tty", "r")) == NULL) {
+                    perror("Failed to open terminal for reading");
+                    return -1;
+                }
+
+                // reopen stdout and stream to a tty if originally silenced or
+                // not connected to a tty, for full interactive mode
+                if (rl_outstream == NULL || !isatty(fileno(rl_outstream))) {
+                    if (rl_outstream != NULL) {
+                        fclose(rl_outstream);
+                        rl_outstream = NULL;
+                    }
+                    if (freopen("/dev/tty", "w", stdout) == NULL) {
+                        perror("Failed to reopen stdout");
+                        return -1;
+                    }
+                    rl_outstream = stdout;
+                }
+                continue;
             }
 
             if (auto_save) {
                 strncpy(inputline, "save", sizeof(inputline));
                 line = inputline;
-                if (echo)
+                if (echo_commands)
                     printf("%s\n", line);
                 auto_save = false;
             } else {
@@ -482,21 +502,29 @@ static int main_loop(void) {
         }
 
         if (end_reached) {
-            if (echo)
+            if (echo_commands)
                 printf("\n");
             return ret;
         }
 
-        if (*line == '\0' || *line == '#')
+        if (*line == '\0' || *line == '#') {
+            free(line);
             continue;
+        }
 
         code = run_command(line);
-        if (code == -2)
+        if (code == -2) {
+            free(line);
             return ret;
+        }
+
         if (code < 0) {
             ret = -1;
             print_aug_error();
         }
+
+        if (line != inputline)
+            free(line);
     }
 }
 
@@ -513,11 +541,46 @@ static int run_args(int argc, char **argv) {
         strcat(line, argv[i]);
         strcat(line, " ");
     }
+    if (echo_commands)
+        printf("%s%s\n", AUGTOOL_PROMPT, line);
     code = run_command(line);
     free(line);
     if (code >= 0 && auto_save)
+        if (echo_commands)
+            printf("%ssave\n", AUGTOOL_PROMPT);
         code = run_command("save");
-    return (code == 0 || code == -2) ? 0 : -1;
+
+    if (code < 0) {
+        code = -1;
+        print_aug_error();
+    }
+    return (code >= 0 || code == -2) ? 0 : -1;
+}
+
+static void add_transforms(char *ts, size_t tslen) {
+    char *command;
+    int r;
+    char *t = NULL;
+    bool added_transform = false;
+
+    while ((t = argz_next(ts, tslen, t))) {
+        r = xasprintf(&command, "transform %s", t);
+        if (r < 0)
+            fprintf(stderr, "error: Failed to add transform %s: could not allocate memory\n", t);
+
+        r = aug_srun(aug, stdout, command);
+        if (r < 0)
+            fprintf(stderr, "error: Failed to add transform %s: %s\n", t, aug_error_message(aug));
+
+        free(command);
+        added_transform = true;
+    }
+
+    if (added_transform) {
+        r = aug_load(aug);
+        if (r < 0)
+            fprintf(stderr, "error: Failed to load with new transforms: %s\n", aug_error_message(aug));
+    }
 }
 
 int main(int argc, char **argv) {
@@ -534,6 +597,7 @@ int main(int argc, char **argv) {
             print_aug_error();
         exit(EXIT_FAILURE);
     }
+    add_transforms(transforms, transformslen);
     if (print_version) {
         print_version_info();
         return EXIT_SUCCESS;
index 4964405..2da7bbb 100644 (file)
@@ -86,14 +86,15 @@ static struct value *lns_counter(struct info *info, struct value *str) {
     return lns_make_prim(L_COUNTER, ref(info), NULL, ref(str->string));
 }
 
-/* V_REGEXP -> V_LENS -> V_LENS */
-static struct value *lns_square(struct info *info, struct value *rxp,
-                                struct value *lns) {
-    assert(rxp->tag == V_REGEXP);
-    assert(lns->tag == V_LENS);
+/* V_LENS -> V_LENS -> V_LENS -> V_LENS */
+static struct value *lns_square(struct info *info, struct value *l1,
+                                struct value *l2, struct value *l3) {
+    assert(l1->tag == V_LENS);
+    assert(l2->tag == V_LENS);
+    assert(l3->tag == V_LENS);
     int check = info->error->aug->flags & AUG_TYPE_CHECK;
 
-    return lns_make_square(ref(info), ref(rxp->regexp), ref(lns->lens), check);
+    return lns_make_square(ref(info), ref(l1->lens), ref(l2->lens), ref(l3->lens), check);
 }
 
 static struct value *make_exn_lns_error(struct info *info,
@@ -102,7 +103,7 @@ static struct value *make_exn_lns_error(struct info *info,
     struct value *v;
 
     if (HAS_ERR(info))
-        return exn_error();
+        return info->error->exn;
 
     v = make_exn_value(ref(info), "%s", err->message);
     if (err->lens != NULL) {
@@ -486,6 +487,13 @@ static struct value *pr_endline(struct info *info, struct value *s) {
     return make_unit(ref(info));
 }
 
+/* V_TREE -> V_TREE */
+static struct value *pr_tree(ATTRIBUTE_UNUSED struct info *info,
+                             struct value *t) {
+    print_tree_braces(stdout, 0, t->origin);
+    return ref(t);
+}
+
 /*
  * Lens inspection
  */
@@ -527,7 +535,7 @@ static struct value *lns_fmt_atype(struct info *info, struct value *l) {
 
     r = lns_format_atype(l->lens, &s);
     if (r < 0)
-        return exn_error();
+        return info->error->exn;
     result = make_value(V_STRING, ref(info));
     result->string = make_string(s);
     return result;
@@ -555,7 +563,7 @@ static struct value *rx_match(struct info *info,
             match = strndup(str + regs.start[0], regs.end[0] - regs.start[0]);
         }
         if (match == NULL) {
-            result = exn_error();
+            result = info->error->exn;
         } else {
             result = make_value(V_STRING, ref(info));
             result->string = make_string(match);
@@ -582,7 +590,7 @@ struct module *builtin_init(struct error *error) {
     DEFINE_NATIVE(modl, "label",   1, lns_label, T_STRING, T_LENS);
     DEFINE_NATIVE(modl, "seq",     1, lns_seq, T_STRING, T_LENS);
     DEFINE_NATIVE(modl, "counter", 1, lns_counter, T_STRING, T_LENS);
-    DEFINE_NATIVE(modl, "square",  2, lns_square, T_REGEXP, T_LENS, T_LENS);
+    DEFINE_NATIVE(modl, "square",  3, lns_square, T_LENS, T_LENS, T_LENS, T_LENS);
     /* Applying lenses (mostly for tests) */
     DEFINE_NATIVE(modl, "get",     2, lens_get, T_LENS, T_STRING, T_TREE);
     DEFINE_NATIVE(modl, "put",     3, lens_put, T_LENS, T_TREE, T_STRING,
@@ -608,6 +616,7 @@ struct module *builtin_init(struct error *error) {
     DEFINE_NATIVE(modl, "print_string", 1, pr_string, T_STRING, T_UNIT);
     DEFINE_NATIVE(modl, "print_regexp", 1, pr_regexp, T_REGEXP, T_UNIT);
     DEFINE_NATIVE(modl, "print_endline", 1, pr_endline, T_STRING, T_UNIT);
+    DEFINE_NATIVE(modl, "print_tree", 1, pr_tree, T_TREE, T_TREE);
 
     /* Lens inspection */
     DEFINE_NATIVE(modl, "lens_ctype", 1, lns_ctype, T_LENS, T_REGEXP);
index af2938f..dda412f 100644 (file)
@@ -44,6 +44,10 @@ struct error {
      * gives a convenient way to get at the overall state
      */
     const struct augeas *aug;
+    /* A preallocated exception so that we can throw something, even
+     * under OOM conditions
+     */
+    struct value *exn;
 };
 
 void report_error(struct error *err, aug_errcode_t errcode,
index 8a385de..9d5e4e8 100644 (file)
--- a/src/fa.c
+++ b/src/fa.c
@@ -81,6 +81,7 @@ struct state {
     unsigned int  accept : 1;
     unsigned int  live : 1;
     unsigned int  reachable : 1;
+    unsigned int  visited : 1;   /* Used in various places to track progress */
     /* Array of transitions. The TUSED first entries are used, the array
        has allocated room for TSIZE */
     size_t        tused;
@@ -2659,6 +2660,87 @@ int fa_example(struct fa *fa, char **example, size_t *example_len) {
     return -1;
 }
 
+struct enum_intl {
+    int       limit;
+    int       nwords;
+    char    **words;
+    char     *buf;
+    size_t    bsize;
+};
+
+static int fa_enumerate_intl(struct state *s, struct enum_intl *ei, int pos) {
+    int result = -1;
+
+    if (ei->bsize <= pos + 1) {
+        ei->bsize *= 2;
+        F(REALLOC_N(ei->buf, ei->bsize));
+    }
+
+    ei->buf[pos] = '\0';
+    for_each_trans(t, s) {
+        if (t->to->visited)
+            return -2;
+        t->to->visited = 1;
+        for (int i=t->min; i <= t->max; i++) {
+            ei->buf[pos] = i;
+            if (t->to->accept) {
+                if (ei->nwords >= ei->limit)
+                    return -2;
+                ei->words[ei->nwords] = strdup(ei->buf);
+                E(ei->words[ei->nwords] == NULL);
+                ei->nwords += 1;
+            }
+            result = fa_enumerate_intl(t->to, ei, pos+1);
+            E(result < 0);
+        }
+        t->to->visited = 0;
+    }
+    ei->buf[pos] = '\0';
+    result = 0;
+ error:
+    return result;
+}
+
+int fa_enumerate(struct fa *fa, int limit, char ***words) {
+    struct enum_intl ei;
+    int result = -1;
+
+    *words = NULL;
+    MEMZERO(&ei, 1);
+    ei.bsize = 8;                    /* Arbitrary initial size */
+    ei.limit = limit;
+    F(ALLOC_N(ei.words, limit));
+    F(ALLOC_N(ei.buf, ei.bsize));
+
+    /* We use the visited bit to track which states we already visited
+     * during the construction of a word to detect loops */
+    list_for_each(s, fa->initial)
+        s->visited = 0;
+    fa->initial->visited = 1;
+    if (fa->initial->accept) {
+        if (ei.nwords >= limit)
+            return -2;
+        ei.words[0] = strdup("");
+        E(ei.words[0] == NULL);
+        ei.nwords = 1;
+    }
+    result = fa_enumerate_intl(fa->initial, &ei, 0);
+    E(result < 0);
+
+    result = ei.nwords;
+    *words = ei.words;
+    ei.words = NULL;
+ done:
+    free(ei.buf);
+    return result;
+
+ error:
+    for (int i=0; i < ei.nwords; i++)
+        free(ei.words[i]);
+    free(ei.words);
+    goto done;
+}
+
 /* Expand the automaton FA by replacing every transition s(c) -> p from
  * state s to p on character c by two transitions s(X) -> r, r(c) -> p via
  * a new state r.
index a061872..6f72eff 100644 (file)
--- a/src/fa.h
+++ b/src/fa.h
@@ -254,6 +254,19 @@ int fa_is_nocase(struct fa *fa);
  */
 int fa_expand_nocase(const char *regexp, size_t regexp_len,
                      char **newregexp, size_t *newregexp_len);
+
+/* Generate up to LIMIT words from the language of FA, which is assumed to
+ * be finite. The words are returned in WORDS, which is allocated by this
+ * function and must be freed by the caller.
+ *
+ * If FA accepts the empty word, the empty string will be included in
+ * WORDS.
+ *
+ * Return the number of generated words on success, -1 if we run out of
+ * memory, and -2 if FA has more than LIMIT words.
+ */
+int fa_enumerate(struct fa *fa, int limit, char ***words);
+
 #endif
 
 
index 5d513e9..8d04cbf 100644 (file)
@@ -29,3 +29,7 @@ FA_1.2.0 {
       fa_is_nocase;
       fa_expand_nocase;
 } FA_1.0.0;
+
+FA_1.4.0 {
+      fa_enumerate;
+} FA_1.2.0;
index 3aeb277..a7ee565 100644 (file)
--- a/src/get.c
+++ b/src/get.c
@@ -50,7 +50,6 @@ struct state {
     struct seq       *seqs;
     char             *key;
     char             *value;     /* GET_STORE leaves a value here */
-    char             *square;    /* last L_DEL from L_SQUARE */
     struct lns_error *error;
     /* We use the registers from a regular expression match to keep track
      * of the substring we are currently looking at. REGS are the registers
@@ -73,7 +72,6 @@ struct state {
 struct frame {
     struct lens     *lens;
     char            *key;
-    char            *square;
     struct span     *span;
     union {
         struct { /* MGET */
@@ -90,6 +88,17 @@ struct frame {
 /* Used by recursive lenses in get_rec and parse_rec */
 enum mode_t { M_GET, M_PARSE };
 
+/* Abstract Syntax Tree for recursive parse */
+struct ast {
+    struct ast         *parent;
+    struct ast        **children;
+    uint                nchildren;
+    uint                capacity;
+    struct lens        *lens;
+    uint                start;
+    uint                end;
+};
+
 struct rec_state {
     enum mode_t          mode;
     struct state        *state;
@@ -98,6 +107,7 @@ struct rec_state {
     struct frame        *frames;
     size_t               start;
     uint                 lvl;  /* Debug only */
+    struct ast          *ast;
 };
 
 #define REG_START(state) ((state)->regs->start[(state)->nreg])
@@ -109,6 +119,101 @@ struct rec_state {
 #define REG_MATCHED(state) (REG_VALID(state)                            \
                             && (state)->regs->start[(state)->nreg] >= 0)
 
+/*
+ * AST utils
+ */
+static struct ast *make_ast(struct lens *lens) {
+    struct ast *ast = NULL;
+
+    if (ALLOC(ast) < 0)
+        return NULL;
+    ast->lens = lens;
+    ast->capacity = 4;
+    if (ALLOC_N(ast->children, ast->capacity) < 0) {
+        FREE(ast);
+        return NULL;
+    }
+    return ast;
+}
+
+/* recursively free the node and all it's descendants */
+static void free_ast(struct ast *ast) {
+    int i;
+    if (ast == NULL)
+        return;
+    for (i = 0; i < ast->nchildren; i++) {
+        free_ast(ast->children[i]);
+    }
+    if (ast->children != NULL)
+        FREE(ast->children);
+    FREE(ast);
+}
+
+static struct ast *ast_root(struct ast *ast) {
+    struct ast *root = ast;
+    while(root != NULL && root->parent != NULL)
+        root = root->parent;
+    return root;
+}
+
+static void ast_set(struct ast *ast, uint start, uint end) {
+    if (ast == NULL)
+        return;
+    ast->start = start;
+    ast->end = end;
+}
+
+/* append a child to the parent ast */
+static struct ast *ast_append(struct rec_state *rec_state, struct lens *lens,
+                           uint start, uint end) {
+    int ret;
+    struct ast *child, *parent;
+    struct state *state = rec_state->state;
+
+    parent = rec_state->ast;
+    if (parent == NULL)
+       return NULL;
+
+    child = make_ast(lens);
+    ERR_NOMEM(child == NULL, state->info);
+
+    ast_set(child, start, end);
+    if (parent->nchildren >= parent->capacity) {
+       ret = REALLOC_N(parent->children, parent->capacity * 2);
+       ERR_NOMEM(ret < 0, state->info);
+       parent->capacity = parent->capacity * 2;
+    }
+    parent->children[parent->nchildren++] = child;
+    child->parent = parent;
+
+    return child;
+ error:
+    free_ast(child);
+    return NULL;
+}
+
+/* pop the ast from one level, fail the parent is NULL */
+static void ast_pop(struct rec_state *rec_state) {
+    ensure(rec_state->ast != NULL && rec_state->ast->parent != NULL, rec_state->state->info);
+    rec_state->ast = rec_state->ast->parent;
+ error:
+    return;
+}
+
+static void print_ast(const struct ast *ast, int lvl) {
+    int i;
+    char *lns;
+    if (ast == NULL)
+        return;
+    for (i = 0; i < lvl; i++) fputs(" ", stdout);
+    lns = format_lens(ast->lens);
+    printf("%d..%d %s\n", ast->start, ast->end, lns);
+    free(lns);
+    for (i = 0; i < ast->nchildren; i++) {
+        print_ast(ast->children[i], lvl + 1);
+    }
+}
+
 static void get_error(struct state *state, struct lens *lens,
                       const char *format, ...)
     ATTRIBUTE_FORMAT(printf, 3, 4);
@@ -257,6 +362,10 @@ static char *token(struct state *state) {
     return strndup(REG_POS(state), REG_SIZE(state));
 }
 
+static char *token_range(const char *text, uint start, uint end) {
+    return strndup(text + start, end - start);
+}
+
 static void regexp_match_error(struct state *state, struct lens *lens,
                                int count, struct regexp *r) {
     char *text = NULL;
@@ -393,9 +502,6 @@ static struct tree *get_del(struct lens *lens, struct state *state) {
         get_error(state, lens, "no match for del /%s/", pat);
         free(pat);
     }
-    if (lens->string == NULL) {
-        state->square = token(state);
-    }
     update_span(state->span, REG_START(state), REG_END(state));
     return NULL;
 }
@@ -723,39 +829,110 @@ static struct skel *parse_subtree(struct lens *lens, struct state *state,
     return make_skel(lens);
 }
 
+/* Check if left and right strings matches according to the square lens
+ * definition.
+ *
+ * Returns 1 if strings matches, 0 otherwise
+ */
+static int square_match(struct lens *lens, char *left, char *right) {
+    int cmp = 0;
+    struct lens *concat = NULL;
+
+    // if one of the argument is NULL, returns no match
+    if (left == NULL || right == NULL || lens == NULL)
+        return cmp;
+
+    concat = lens->child;
+    /* If either right or left lens is nocase, then ignore case */
+    if (child_first(concat)->ctype->nocase ||
+            child_last(concat)->ctype->nocase) {
+        cmp = STRCASEEQ(left, right);
+    } else {
+        cmp = STREQ(left, right);
+    }
+    return cmp;
+}
+
+/*
+ * This function applies only for non-recursive lens, handling of recursive
+ * square is done in visit_exit().
+ */
 static struct tree *get_square(struct lens *lens, struct state *state) {
     ensure0(lens->tag == L_SQUARE, state->info);
 
+    struct lens *concat = lens->child;
     struct tree *tree = NULL;
-    char *key = NULL, *square = NULL;
+    struct re_registers *old_regs = state->regs;
+    uint old_nreg = state->nreg;
+    uint end = REG_END(state);
+    uint start = REG_START(state);
+    char *rsqr = NULL, *lsqr = NULL;
+    int r;
+
+    r = match(state, lens->child, lens->child->ctype, end, start);
+    ERR_NOMEM(r < 0, state->info);
 
-    // get the child lens
-    tree = get_concat(lens->child, state);
+    tree = get_lens(lens->child, state);
 
-    key = state->key;
-    square = state->square;
-    ensure0(key != NULL, state->info);
-    ensure0(square != NULL, state->info);
+    /* retrieve left component */
+    state->nreg = 1;
+    start = REG_START(state);
+    end = REG_END(state);
+    lsqr = token_range(state->text, start, end);
 
-    if (strcmp(key, square) != 0) {
+    /* retrieve right component */
+    /* compute nreg for the last children */
+    for (int i = 0; i < concat->nchildren - 1; i++)
+        state->nreg += 1 + regexp_nsub(concat->children[i]->ctype);
+
+    start = REG_START(state);
+    end = REG_END(state);
+    rsqr = token_range(state->text, start, end);
+
+    if (!square_match(lens, lsqr, rsqr)) {
         get_error(state, lens, "%s \"%s\" %s \"%s\"",
-                "Parse error: mismatched key in square lens, expecting", key,
-                "but got", square);
+            "Parse error: mismatched in square lens, expecting", lsqr,
+            "but got", rsqr);
+        goto error;
     }
 
-    FREE(state->square);
+ done:
+    free_regs(state);
+    state->nreg = old_nreg;
+    state->regs = old_regs;
+    FREE(lsqr);
+    FREE(rsqr);
     return tree;
+
+ error:
+    free_tree(tree);
+    tree = NULL;
+    goto done;
 }
 
 static struct skel *parse_square(struct lens *lens, struct state *state,
                                  struct dict **dict) {
     ensure0(lens->tag == L_SQUARE, state->info);
-    struct skel *skel, *sk;
+    struct re_registers *old_regs = state->regs;
+    uint old_nreg = state->nreg;
+    uint end = REG_END(state);
+    uint start = REG_START(state);
+    struct skel *skel = NULL, *sk = NULL;
+    int r;
+
+    r = match(state, lens->child, lens->child->ctype, end, start);
+    ERR_NOMEM(r < 0, state->info);
 
-    skel = parse_concat(lens->child, state, dict);
+    skel = parse_lens(lens->child, state, dict);
+    if (skel == NULL)
+        return NULL;
     sk = make_skel(lens);
     sk->skels = skel;
 
+ error:
+    free_regs(state);
+    state->regs = old_regs;
+    state->nreg = old_nreg;
     return sk;
 }
 
@@ -768,7 +945,7 @@ static void print_frames(struct rec_state *state) {
     for (int j = state->fused - 1; j >=0; j--) {
         struct frame *f = state->frames + j;
         for (int i=0; i < state->lvl; i++) fputc(' ', stderr);
-        fprintf(stderr, "%2d %s %s %s", j, f->key, f->value, f->square);
+        fprintf(stderr, "%2d %s %s", j, f->key, f->value);
         if (f->tree == NULL) {
             fprintf(stderr, " - ");
         } else {
@@ -825,11 +1002,13 @@ static struct frame *pop_frame(struct rec_state *state) {
 
 static void dbg_visit(struct lens *lens, char action, size_t start, size_t end,
                       int fused, int lvl) {
-
+    char *lns;
     for (int i=0; i < lvl; i++)
         fputc(' ', stderr);
+    lns = format_lens(lens);
     fprintf(stderr, "%c %zd..%zd %d %s\n", action, start, end,
-            fused, format_lens(lens));
+            fused, lns);
+    free(lns);
 }
 
 static void get_terminal(struct frame *top, struct lens *lens,
@@ -837,10 +1016,8 @@ static void get_terminal(struct frame *top, struct lens *lens,
     top->tree = get_lens(lens, state);
     top->key = state->key;
     top->value = state->value;
-    top->square = state->square;
     state->key = NULL;
     state->value = NULL;
-    state->square = NULL;
 }
 
 static void parse_terminal(struct frame *top, struct lens *lens,
@@ -856,6 +1033,7 @@ static void visit_terminal(struct lens *lens, size_t start, size_t end,
     struct rec_state *rec_state = data;
     struct state *state = rec_state->state;
     struct re_registers *old_regs = state->regs;
+    struct ast *child;
     uint old_nreg = state->nreg;
 
     if (state->error != NULL)
@@ -869,6 +1047,9 @@ static void visit_terminal(struct lens *lens, size_t start, size_t end,
         get_terminal(top, lens, state);
     else
         parse_terminal(top, lens, state);
+    child = ast_append(rec_state, lens, start, end);
+    ERR_NOMEM(child == NULL, state->info);
+ error:
     free_regs(state);
     state->regs = old_regs;
     state->nreg = old_nreg;
@@ -880,6 +1061,7 @@ static void visit_enter(struct lens *lens,
                         void *data) {
     struct rec_state *rec_state = data;
     struct state *state = rec_state->state;
+    struct ast *child;
 
     if (state->error != NULL)
         return;
@@ -902,6 +1084,9 @@ static void visit_enter(struct lens *lens,
             ERR_NOMEM(state->span == NULL, state->info);
         }
     }
+    child = ast_append(rec_state, lens, start, end);
+    if (child != NULL)
+        rec_state->ast = child;
  error:
     return;
 }
@@ -909,7 +1094,7 @@ static void visit_enter(struct lens *lens,
 static void get_combine(struct rec_state *rec_state,
                         struct lens *lens, uint n) {
     struct tree *tree = NULL, *tail = NULL;
-    char *key = NULL, *value = NULL, *square = NULL;
+    char *key = NULL, *value = NULL;
     struct frame *top = NULL;
 
     if (n > 0)
@@ -929,16 +1114,11 @@ static void get_combine(struct rec_state *rec_state,
             ensure(value == NULL, rec_state->state->info);
             value = top->value;
         }
-        if (top->square != NULL) {
-            ensure(square == NULL, rec_state->state->info);
-            square = top->square;
-        }
     }
     top = push_frame(rec_state, lens);
     top->tree = tree;
     top->key = key;
     top->value = value;
-    top->square = square;
  error:
     return;
 }
@@ -1055,24 +1235,26 @@ static void visit_exit(struct lens *lens,
             parse_combine(rec_state, lens, n);
     } else if (lens->tag == L_SQUARE) {
         if (rec_state->mode == M_GET) {
-            char *key, *square;
-
-            key = top_frame(rec_state)->key;
-            square = top_frame(rec_state)->square;
-
-            ensure(key != NULL, state->info);
-            ensure(square != NULL, state->info);
-
-            // raise syntax error if they are not equals
-            if (strcmp(key, square) != 0){
+            struct ast *square, *concat, *right, *left;
+            char *rsqr, *lsqr;
+            int ret;
+
+            square = rec_state->ast;
+            concat = child_first(square);
+            right = child_first(concat);
+            left = child_last(concat);
+            lsqr = token_range(state->text, left->start, left->end);
+            rsqr = token_range(state->text, right->start, right->end);
+            ret = square_match(lens, lsqr, rsqr);
+            if (! ret) {
                 get_error(state, lens, "%s \"%s\" %s \"%s\"",
-                        "Parse error: mismatched key in square lens, expecting",
-                        key, "but got", square);
-                state->error->pos = end - strlen(square);
-                goto error;
+                        "Parse error: mismatched in square lens, expecting", lsqr,
+                        "but got", rsqr);
             }
-
-            FREE(square);
+            FREE(lsqr);
+            FREE(rsqr);
+            if (! ret)
+                goto error;
             get_combine(rec_state, lens, 1);
         } else {
             parse_combine(rec_state, lens, 1);
@@ -1080,6 +1262,7 @@ static void visit_exit(struct lens *lens,
     } else {
         top_frame(rec_state)->lens = lens;
     }
+    ast_pop(rec_state);
  error:
     return;
 }
@@ -1124,6 +1307,8 @@ static struct frame *rec_process(enum mode_t mode, struct lens *lens,
     rec_state.fused = 0;
     rec_state.lvl   = 0;
     rec_state.start = start;
+    rec_state.ast = make_ast(lens);
+    ERR_NOMEM(rec_state.ast == NULL, state->info);
 
     visitor.parse = jmt_parse(lens->jmt, state->text + start, end - start);
     ERR_BAIL(lens->info);
@@ -1148,17 +1333,21 @@ static struct frame *rec_process(enum mode_t mode, struct lens *lens,
         goto error;
     }
 
+    rec_state.ast = ast_root(rec_state.ast);
+    ensure(rec_state.ast->parent == NULL, state->info);
  done:
+    if (debugging("cf.get.ast"))
+        print_ast(ast_root(rec_state.ast), 0);
     state->regs = old_regs;
     state->nreg = old_nreg;
     jmt_free_parse(visitor.parse);
+    free_ast(ast_root(rec_state.ast));
     return rec_state.frames;
  error:
 
     for(i = 0; i < rec_state.fused; i++) {
         f = nth_frame(&rec_state, i);
         FREE(f->key);
-        FREE(f->square);
         if (mode == M_GET) {
             FREE(f->value);
             free_tree(f->tree);
@@ -1318,10 +1507,6 @@ struct tree *lns_get(struct info *info, struct lens *lens, const char *text,
         get_error(&state, lens, "get left unused value %s", state.value);
         free(state.value);
     }
-    if (state.square != NULL) {
-        get_error(&state, lens, "get left unused square %s", state.square);
-        free(state.square);
-    }
     if (partial && state.error == NULL) {
         get_error(&state, lens, "Get did not match entire input");
     }
index 566498d..b9e3eab 100644 (file)
@@ -125,8 +125,7 @@ fread_file_lim (FILE *stream, size_t max_len, size_t *length)
     return NULL;
 }
 
-char* xread_file(const char *path) {
-    FILE *fp = fopen(path, "r");
+char* xfread_file(FILE *fp) {
     char *result;
     size_t len;
 
@@ -134,7 +133,6 @@ char* xread_file(const char *path) {
         return NULL;
 
     result = fread_file_lim(fp, MAX_READ_LEN, &len);
-    fclose (fp);
 
     if (result != NULL
         && len <= MAX_READ_LEN
@@ -145,6 +143,20 @@ char* xread_file(const char *path) {
     return NULL;
 }
 
+char* xread_file(const char *path) {
+    FILE *fp;
+    char *result;
+
+    fp = fopen(path, "r");
+    if (!fp)
+        return NULL;
+
+    result = xfread_file(fp);
+    fclose(fp);
+
+    return result;
+}
+
 /*
  * Escape/unescape of string literals
  */
@@ -236,7 +248,7 @@ int print_chars(FILE *out, const char *text, int cnt) {
     if (cnt < 0)
         cnt = strlen(text);
 
-    esc = escape(text, cnt, NULL);
+    esc = escape(text, cnt, "\"");
     total = strlen(esc);
     if (out != NULL)
         fprintf(out, "%s", esc);
index 7317842..0b4d5ac 100644 (file)
  * Information about files */
 #define AUGEAS_META_FILES AUGEAS_META_TREE AUGEAS_FILES_TREE
 
+/* Define: AUGEAS_META_TEXT
+ * Information about text (see aug_text_store and aug_text_retrieve) */
+#define AUGEAS_META_TEXT AUGEAS_META_TREE "/text"
+
 /* Define: AUGEAS_META_ROOT
  * The root directory */
 #define AUGEAS_META_ROOT AUGEAS_META_TREE "/root"
@@ -283,6 +287,9 @@ char *format_pos(const char *text, int pos);
  */
 char* xread_file(const char *path);
 
+/* Like xread_file, but caller supplies a file pointer */
+char* xfread_file(FILE *fp);
+
 /* Get the error message for ERRNUM in a threadsafe way. Based on libvirt's
  * virStrError
  */
@@ -393,12 +400,11 @@ struct tree *make_tree(char *label, char *value,
  */
 struct tree  *make_tree_origin(struct tree *root);
 
-int tree_replace(struct augeas *aug, const char *path, struct tree *sub);
 /* Make a new tree node and append it to parent's children */
 struct tree *tree_append(struct tree *parent, char *label, char *value);
 
 int tree_rm(struct pathx *p);
-int tree_unlink(struct tree *tree);
+int tree_unlink(struct augeas *aug, struct tree *tree);
 struct tree *tree_set(struct pathx *p, const char *value);
 int tree_insert(struct pathx *p, const char *label, int before);
 int free_tree(struct tree *tree);
@@ -423,6 +429,15 @@ void tree_store_value(struct tree *tree, char **value);
 int tree_set_value(struct tree *tree, const char *value);
 /* Cleanly remove all children of TREE, but leave TREE itself unchanged */
 void tree_unlink_children(struct augeas *aug, struct tree *tree);
+/* Find a node in the tree at path FPATH; FPATH is a file path, i.e.
+ * not interpreted as a path expression. If no such node exists, return NULL
+ */
+struct tree *tree_fpath(struct augeas *aug, const char *fpath);
+/* Find a node in the tree at path FPATH; FPATH is a file path, i.e.
+ * not interpreted as a path expression. If no such node exists, create
+ * it and all its missing ancestors.
+ */
+struct tree *tree_fpath_cr(struct augeas *aug, const char *fpath);
 /* Find the node matching PATH.
  * Returns the node or NULL on error
  * Errors: EMMATCH - more than one node matches PATH
@@ -496,7 +511,8 @@ typedef enum {
     PATHX_ENOMATCH,
     PATHX_EARITY,
     PATHX_EREGEXP,
-    PATHX_EMMATCH
+    PATHX_EMMATCH,
+    PATHX_EREGEXPFLAG
 } pathx_errcode_t;
 
 struct pathx;
index 184e8b8..6fcde04 100644 (file)
--- a/src/jmt.c
+++ b/src/jmt.c
@@ -298,16 +298,16 @@ static ind_t parse_add_item(struct jmt_parse *parse, ind_t j,
                             ind_t from_item, ind_t to_item,
                             ind_t caller) {
 
-    ensure(from_item == EPS || from_item < parse->sets[from_set]->items.used,
-           parse);
-    ensure(to_item == EPS || to_item < parse->sets[j]->items.used,
-           parse);
-
     int r;
     struct item_set *set = parse->sets[j];
     struct item *item = NULL;
     ind_t result = IND_MAX;
 
+    ensure(from_item == EPS || from_item < parse->sets[from_set]->items.used,
+           parse);
+    ensure(to_item == EPS || to_item < parse->sets[j]->items.used,
+           parse);
+
     if (set == NULL) {
         r = ALLOC(parse->sets[j]);
         ERR_NOMEM(r < 0, parse);
index 49796c5..58256ed 100644 (file)
@@ -50,6 +50,8 @@ static struct value * typecheck_union(struct info *,
                                       struct lens *l1, struct lens *l2);
 static struct value *typecheck_concat(struct info *,
                                       struct lens *l1, struct lens *l2);
+static struct value *typecheck_square(struct info *,
+                                      struct lens *l1, struct lens *l2);
 static struct value *typecheck_iter(struct info *info, struct lens *l);
 static struct value *typecheck_maybe(struct info *info, struct lens *l);
 
@@ -134,7 +136,7 @@ static struct value *str_to_fa(struct info *info, const char *pattern,
  error:
     fa_free(*fa);
     *fa = NULL;
-    exn = exn_error();
+    exn = info->error->exn;
     goto done;
 }
 
@@ -398,35 +400,90 @@ struct value *lns_make_maybe(struct info *info, struct lens *l, int check) {
     return make_lens_value(lens);
 }
 
+/* The ctype of SQR is a regular approximation of the true ctype of SQR
+ * at this point. In some situations, for example in processing quoted
+ * strings this leads to false typecheck errors; to lower the chances
+ * of these, we try to construct the precise ctype of SQR if the
+ * language of L1 is finite (and has a small number of words)
+ */
+static void square_precise_type(struct info *info,
+                                struct regexp **sqr,
+                                struct regexp *left,
+                                struct regexp *body) {
+
+    char **words = NULL;
+    int nwords = 0, r;
+    struct fa *fa = NULL;
+    struct value *exn = NULL;
+    struct regexp **u = NULL, *c[3], *w = NULL;
+
+    exn = str_to_fa(info, left->pattern->str, &fa, left->nocase);
+    if (exn != NULL)
+        goto error;
+
+    nwords = fa_enumerate(fa, 10, &words); /* The limit of 10 is arbitrary */
+    if (nwords < 0)
+        goto error;
+
+    r = ALLOC_N(u, nwords);
+    ERR_NOMEM(r < 0, info);
+
+    c[1] = body;
+    for (int i=0; i < nwords; i++) {
+        w = make_regexp_literal(left->info, words[i]);
+        ERR_NOMEM(w == NULL, info);
+        w->nocase = left->nocase;
+
+        c[0] = c[2] = w;
+        u[i] = regexp_concat_n(info, 3, c);
+
+        unref(w, regexp);
+        ERR_NOMEM(u[i] == NULL, info);
+    }
+    w = regexp_union_n(info, nwords, u);
+    if (w != NULL) {
+        unref(*sqr, regexp);
+        *sqr = w;
+        w = NULL;
+    }
+
+ error:
+    unref(w, regexp);
+    for (int i=0; i < nwords; i++) {
+        free(words[i]);
+        if (u != NULL)
+            unref(u[i], regexp);
+    }
+    free(words);
+    free(u);
+    fa_free(fa);
+    unref(exn, value);
+}
+
 /* Build a square lens as
- *   key REG . lns . del REG MATCHED
- * where MATCHED is whatever the key lens matched (the inability to express
- * this with other lenses makes the square primitve necessary
+ *    left . body . right
+ * where left and right accepts the same language and
+ * captured strings must match. The inability to express this with other
+ * lenses makes the square primitive necessary.
  */
-struct value *lns_make_square(struct info *info,
-                              struct regexp *reg,
-                              struct lens *lns, int check) {
-    struct value *key = NULL, *del = NULL;
+struct value * lns_make_square(struct info *info, struct lens *l1,
+                               struct lens *l2, struct lens *l3, int check) {
     struct value *cnt1 = NULL, *cnt2 = NULL, *res = NULL;
     struct lens *sqr = NULL;
 
-    res = lns_make_prim(L_KEY, ref(info), ref(reg), NULL);
-    if (EXN(res))
-        goto error;
-    key = res;
+    /* supported types: L_KEY . body . L_DEL or L_DEL . body . L_DEL */
+    if (l3->tag != L_DEL || (l1->tag != L_DEL && l1->tag != L_KEY))
+        return make_exn_value(info, "Supported types: (key lns del) or (del lns del)");
 
-    res = lns_make_prim(L_DEL, ref(info), ref(reg), NULL);
-    if (EXN(res))
+    res = typecheck_square(info, l1, l3);
+    if (res != NULL)
         goto error;
-    del = res;
 
-    // typechecking is handled when concatenating lenses
-    res = lns_make_concat(ref(info), ref(key->lens), ref(lns), check);
+    res = lns_make_concat(ref(info), ref(l1), ref(l2), check);
     if (EXN(res))
         goto error;
     cnt1 = res;
-
-    res = lns_make_concat(ref(info), ref(cnt1->lens), ref(del->lens), check);
+    res = lns_make_concat(ref(info), ref(cnt1->lens), ref(l3), check);
     if (EXN(res))
         goto error;
     cnt2 = res;
@@ -436,6 +493,9 @@ struct value *lns_make_square(struct info *info,
 
     for (int t=0; t < ntypes; t++)
         ltype(sqr, t) = ref(ltype(cnt2->lens, t));
+
+    square_precise_type(info, &(sqr->ctype), l1->ctype, l2->ctype);
+
     sqr->recursive = cnt2->lens->recursive;
     sqr->rec_internal = cnt2->lens->rec_internal;
     sqr->consumes_value = cnt2->lens->consumes_value;
@@ -446,11 +506,9 @@ struct value *lns_make_square(struct info *info,
 
  error:
     unref(info, info);
-    unref(reg, regexp);
-    unref(lns, lens);
-
-    unref(key, value);
-    unref(del, value);
+    unref(l1, lens);
+    unref(l2, lens);
+    unref(l3, lens);
     unref(cnt1, value);
     unref(cnt2, value);
     unref(sqr, lens);
@@ -692,7 +750,7 @@ ambig_check(struct info *info, struct fa *fa1, struct fa *fa2,
             return exn;
         } else {
             ERR_REPORT(info, AUG_ENOMEM, NULL);
-            return exn_error();
+            return info->error->exn;
         }
     }
 
@@ -788,6 +846,74 @@ static struct value *typecheck_concat(struct info *info,
     return result;
 }
 
+static struct value *make_exn_square(struct info *info, struct lens *l1,
+                                     struct lens *l2, const char *msg) {
+
+    char *fi;
+    struct value *exn = make_exn_value(ref(info), "%s",
+            "Inconsistency in lens square");
+    exn_printf_line(exn, "%s", msg);
+    fi = format_info(l1->info);
+    exn_printf_line(exn, "Left lens: %s", fi);
+    free(fi);
+    fi = format_info(l2->info);
+    exn_printf_line(exn, "Right lens: %s", fi);
+    free(fi);
+    return exn;
+}
+
+static struct value *typecheck_square(struct info *info, struct lens *l1,
+                                      struct lens *l2) {
+    int r;
+    struct value *exn = NULL;
+    struct fa *fa1 = NULL, *fa2 = NULL;
+    struct regexp *r1 = ltype(l1, CTYPE);
+    struct regexp *r2 = ltype(l2, CTYPE);
+
+    if (r1 == NULL || r2 == NULL)
+        return NULL;
+
+    exn = regexp_to_fa(r1, &fa1);
+    if (exn != NULL)
+        goto done;
+
+    exn = regexp_to_fa(r2, &fa2);
+    if (exn != NULL)
+        goto done;
+
+    r = fa_equals(fa1, fa2);
+
+    if (r < 0) {
+        exn = make_exn_value(ref(info), "not enough memory");
+        if (exn != NULL) {
+            return exn;
+        } else {
+            ERR_REPORT(info, AUG_ENOMEM, NULL);
+            return info->error->exn;;
+        }
+    }
+
+    if (r == 0) {
+        exn = make_exn_square(info, l1, l2,
+                "Left and right lenses must accept the same language");
+        goto done;
+    }
+
+    /* check del create consistency */
+    if (l1->tag == L_DEL && l2->tag == L_DEL) {
+        if (!STREQ(l1->string->str, l2->string->str)) {
+            exn = make_exn_square(info, l1, l2,
+                    "Left and right lenses must have the same default value");
+            goto done;
+        }
+    }
+
+ done:
+    fa_free(fa1);
+    fa_free(fa2);
+    return exn;
+}
+
 static struct value *
 ambig_iter_check(struct info *info, const char *msg,
                  enum lens_type typ, struct lens *l) {
@@ -889,7 +1015,6 @@ void free_lens(struct lens *lens) {
     case L_REC:
         if (!lens->rec_internal) {
             unref(lens->body, lens);
-            jmt_free(lens->jmt);
         }
         break;
     default:
@@ -901,7 +1026,7 @@ void free_lens(struct lens *lens) {
         unref(ltype(lens, t), regexp);
 
     unref(lens->info, info);
-
+    jmt_free(lens->jmt);
     free(lens);
  error:
     return;
@@ -918,7 +1043,7 @@ void lens_release(struct lens *lens) {
         regexp_release(lens->regexp);
 
     if (lens->tag == L_SUBTREE || lens->tag == L_STAR
-        || lens->tag == L_MAYBE) {
+        || lens->tag == L_MAYBE || lens->tag == L_SQUARE) {
         lens_release(lens->child);
     }
 
@@ -928,10 +1053,8 @@ void lens_release(struct lens *lens) {
         }
     }
 
-    if (lens->tag == L_REC) {
-        jmt_free(lens->jmt);
-        lens->jmt = NULL;
-    }
+    jmt_free(lens->jmt);
+    lens->jmt = NULL;
 }
 
 /*
@@ -1539,6 +1662,10 @@ static void rtn_rules(struct rtn *rtn, struct lens *l) {
         rtn_rules(rtn, l->body);
         RTN_BAIL(rtn);
         break;
+    case L_SQUARE:
+        add_trans(rtn, start, prod->end, l->child);
+        RTN_BAIL(rtn);
+        break;
     default:
         BUG_LENS_TAG(l);
         break;
@@ -1695,7 +1822,7 @@ static void collapse_trans(struct rtn *rtn,
 
     return;
  error:
-    rtn->exn = exn_error();
+    rtn->exn = rtn->info->error->exn;
     return;
 }
 
@@ -2006,7 +2133,7 @@ static struct value *rtn_approx(struct lens *rec, enum lens_type lt) {
     return result;
  error:
     if (rtn->exn == NULL)
-        result = exn_error();
+        result = rec->info->error->exn;
     else
         result = ref(rtn->exn);
     goto done;
@@ -2164,7 +2291,7 @@ struct value *lns_check_rec(struct info *info,
     if (result != NULL && result->tag != V_EXN)
         unref(result, value);
     if (result == NULL)
-        result = exn_error();
+        result = info->error->exn;
     return result;
 }
 
index 902197d..b8cb202 100644 (file)
@@ -79,6 +79,7 @@ struct lens {
     struct regexp            *atype;
     struct regexp            *ktype;
     struct regexp            *vtype;
+    struct jmt               *jmt;    /* When recursive == 1, might have jmt */
     unsigned int              value : 1;
     unsigned int              key : 1;
     unsigned int              recursive : 1;
@@ -89,9 +90,6 @@ struct lens {
     union {
         /* Primitive lenses */
         struct {                   /* L_DEL uses both */
-            /* L_DEL string set to NULL means it belongs to parent L_SQUARE lens
-             * and the put and create copy the current key
-             */
             struct regexp *regexp; /* L_STORE, L_KEY */
             struct string *string; /* L_VALUE, L_LABEL, L_SEQ, L_COUNTER */
         };
@@ -119,7 +117,6 @@ struct lens {
              * lens.
              */
             struct lens *alias;
-            struct jmt  *jmt;
         };
     };
 };
@@ -143,8 +140,9 @@ struct value *lns_make_plus(struct info *, struct lens *,
                             int check);
 struct value *lns_make_maybe(struct info *, struct lens *,
                              int check);
-struct value *lns_make_square(struct info *, struct regexp *, struct lens *,
-                              int check);
+struct value *lns_make_square(struct info *, struct lens *, struct lens *,
+                              struct lens *lens, int check);
+
 
 /* Pretty-print a lens */
 char *format_lens(struct lens *l);
@@ -241,6 +239,10 @@ void free_lens(struct lens *lens);
 #define ENCLEN(s) ((s) == NULL ? strlen(ENC_NULL) : strlen(s))
 #define ENCSTR(s) ((s) == NULL ? ENC_NULL : s)
 
+/* helper to access first and last child */
+#define child_first(l) (l)->children[0]
+#define child_last(l) (l)->children[(l)->nchildren - 1]
+
 /* Format an encoded level as
  *    { key1 = value1 } { key2 = value2 } .. { keyN = valueN }
  */
index 5ec9ad5..3aa3ef7 100644 (file)
@@ -1,9 +1,8 @@
-/* A Bison parser, made by GNU Bison 2.4.3.  */
+/* A Bison parser, made by GNU Bison 2.5.  */
 
-/* Skeleton implementation for Bison's Yacc-like parsers in C
+/* Bison implementation for Yacc-like parsers in C
    
-      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-   2009, 2010 Free Software Foundation, Inc.
+      Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
    
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -45,7 +44,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "2.4.3"
+#define YYBISON_VERSION "2.5"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -74,7 +73,7 @@
 
 /* Copy the first part of user declarations.  */
 
-/* Line 189 of yacc.c  */
+/* Line 268 of yacc.c  */
 #line 1 "parser.y"
 
 
@@ -121,8 +120,8 @@ typedef struct info YYLTYPE;
   } while (0)
 
 
-/* Line 189 of yacc.c  */
-#line 126 "parser.c"
+/* Line 268 of yacc.c  */
+#line 125 "parser.c"
 
 /* Enabling traces.  */
 #ifndef YYDEBUG
@@ -196,7 +195,7 @@ typedef struct info YYLTYPE;
 typedef union YYSTYPE
 {
 
-/* Line 214 of yacc.c  */
+/* Line 293 of yacc.c  */
 #line 89 "parser.y"
 
   struct term    *term;
@@ -213,8 +212,8 @@ typedef union YYSTYPE
 
 
 
-/* Line 214 of yacc.c  */
-#line 218 "parser.c"
+/* Line 293 of yacc.c  */
+#line 217 "parser.c"
 } YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
@@ -236,7 +235,7 @@ typedef struct YYLTYPE
 
 /* "%code provides" blocks.  */
 
-/* Line 261 of yacc.c  */
+/* Line 340 of yacc.c  */
 #line 46 "parser.y"
 
 #include "info.h"
@@ -250,12 +249,12 @@ struct state {
 
 
 
-/* Line 261 of yacc.c  */
-#line 255 "parser.c"
+/* Line 340 of yacc.c  */
+#line 254 "parser.c"
 
 /* Copy the second part of user declarations.  */
 
-/* Line 264 of yacc.c  */
+/* Line 343 of yacc.c  */
 #line 114 "parser.y"
 
 /* Lexer */
@@ -320,8 +319,8 @@ static void augl_error(struct info *locp, struct term **term,
 
 
 
-/* Line 264 of yacc.c  */
-#line 325 "parser.c"
+/* Line 343 of yacc.c  */
+#line 324 "parser.c"
 
 #ifdef short
 # undef short
@@ -424,11 +423,11 @@ YYID (yyi)
 #    define alloca _alloca
 #   else
 #    define YYSTACK_ALLOC alloca
-#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#     ifndef _STDLIB_H
-#      define _STDLIB_H 1
+#     ifndef EXIT_SUCCESS
+#      define EXIT_SUCCESS 0
 #     endif
 #    endif
 #   endif
@@ -451,24 +450,24 @@ YYID (yyi)
 #  ifndef YYSTACK_ALLOC_MAXIMUM
 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
 #  endif
-#  if (defined __cplusplus && ! defined _STDLIB_H \
+#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
        && ! ((defined YYMALLOC || defined malloc) \
             && (defined YYFREE || defined free)))
 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#   ifndef _STDLIB_H
-#    define _STDLIB_H 1
+#   ifndef EXIT_SUCCESS
+#    define EXIT_SUCCESS 0
 #   endif
 #  endif
 #  ifndef YYMALLOC
 #   define YYMALLOC malloc
-#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+#   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
 #   endif
 #  endif
 #  ifndef YYFREE
 #   define YYFREE free
-#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+#   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 void free (void *); /* INFRINGES ON USER NAME SPACE */
 #   endif
@@ -499,23 +498,7 @@ union yyalloc
      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
       + 2 * YYSTACK_GAP_MAXIMUM)
 
-/* Copy COUNT objects from FROM to TO.  The source and destination do
-   not overlap.  */
-# ifndef YYCOPY
-#  if defined __GNUC__ && 1 < __GNUC__
-#   define YYCOPY(To, From, Count) \
-      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-#  else
-#   define YYCOPY(To, From, Count)             \
-      do                                       \
-       {                                       \
-         YYSIZE_T yyi;                         \
-         for (yyi = 0; yyi < (Count); yyi++)   \
-           (To)[yyi] = (From)[yyi];            \
-       }                                       \
-      while (YYID (0))
-#  endif
-# endif
+# define YYCOPY_NEEDED 1
 
 /* Relocate STACK from its old location to the new one.  The
    local variables YYSIZE and YYSTACKSIZE give the old and new number of
@@ -535,6 +518,26 @@ union yyalloc
 
 #endif
 
+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
+/* Copy COUNT objects from FROM to TO.  The source and destination do
+   not overlap.  */
+# ifndef YYCOPY
+#  if defined __GNUC__ && 1 < __GNUC__
+#   define YYCOPY(To, From, Count) \
+      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+#  else
+#   define YYCOPY(To, From, Count)             \
+      do                                       \
+       {                                       \
+         YYSIZE_T yyi;                         \
+         for (yyi = 0; yyi < (Count); yyi++)   \
+           (To)[yyi] = (From)[yyi];            \
+       }                                       \
+      while (YYID (0))
+#  endif
+# endif
+#endif /* !YYCOPY_NEEDED */
+
 /* YYFINAL -- State number of the termination state.  */
 #define YYFINAL  4
 /* YYLAST -- Last index in YYTABLE.  */
@@ -693,8 +696,8 @@ static const yytype_uint8 yyr2[] =
        1,     0
 };
 
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
-   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
+/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
+   Performed when YYTABLE doesn't specify something else to do.  Zero
    means the default is an error.  */
 static const yytype_uint8 yydefact[] =
 {
@@ -749,8 +752,7 @@ static const yytype_int8 yypgoto[] =
 
 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
    positive, shift that token.  If negative, reduce the rule which
-   number is the opposite.  If zero, do what YYDEFACT says.
-   If YYTABLE_NINF, syntax error.  */
+   number is the opposite.  If YYTABLE_NINF, syntax error.  */
 #define YYTABLE_NINF -1
 static const yytype_uint8 yytable[] =
 {
@@ -769,6 +771,12 @@ static const yytype_uint8 yytable[] =
       21,    32,    22,    85,     0,    83,     0,     0,     0,   106
 };
 
+#define yypact_value_is_default(yystate) \
+  ((yystate) == (-90))
+
+#define yytable_value_is_error(yytable_value) \
+  YYID (0)
+
 static const yytype_int8 yycheck[] =
 {
       22,    38,    11,    67,    93,    28,     5,    29,     9,    14,
@@ -837,7 +845,6 @@ do                                                          \
     {                                                          \
       yychar = (Token);                                                \
       yylval = (Value);                                                \
-      yytoken = YYTRANSLATE (yychar);                          \
       YYPOPSTACK (1);                                          \
       goto yybackup;                                           \
     }                                                          \
@@ -1097,7 +1104,6 @@ int yydebug;
 # define YYMAXDEPTH 10000
 #endif
 
-\f
 
 #if YYERROR_VERBOSE
 
@@ -1200,115 +1206,142 @@ yytnamerr (char *yyres, const char *yystr)
 }
 # endif
 
-/* Copy into YYRESULT an error message about the unexpected token
-   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
-   including the terminating null byte.  If YYRESULT is null, do not
-   copy anything; just return the number of bytes that would be
-   copied.  As a special case, return 0 if an ordinary "syntax error"
-   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
-   size calculation.  */
-static YYSIZE_T
-yysyntax_error (char *yyresult, int yystate, int yychar)
-{
-  int yyn = yypact[yystate];
+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
+   about the unexpected token YYTOKEN for the state stack whose top is
+   YYSSP.
 
-  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
-    return 0;
-  else
+   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
+   not large enough to hold the message.  In that case, also set
+   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
+   required number of bytes is too large to store.  */
+static int
+yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
+                yytype_int16 *yyssp, int yytoken)
+{
+  YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
+  YYSIZE_T yysize = yysize0;
+  YYSIZE_T yysize1;
+  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+  /* Internationalized format string. */
+  const char *yyformat = 0;
+  /* Arguments of yyformat. */
+  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+  /* Number of reported tokens (one for the "unexpected", one per
+     "expected"). */
+  int yycount = 0;
+
+  /* There are many possibilities here to consider:
+     - Assume YYFAIL is not used.  It's too flawed to consider.  See
+       <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
+       for details.  YYERROR is fine as it does not invoke this
+       function.
+     - If this state is a consistent state with a default action, then
+       the only way this function was invoked is if the default action
+       is an error action.  In that case, don't check for expected
+       tokens because there are none.
+     - The only way there can be no lookahead present (in yychar) is if
+       this state is a consistent state with a default action.  Thus,
+       detecting the absence of a lookahead is sufficient to determine
+       that there is no unexpected or expected token to report.  In that
+       case, just report a simple "syntax error".
+     - Don't assume there isn't a lookahead just because this state is a
+       consistent state with a default action.  There might have been a
+       previous inconsistent state, consistent state with a non-default
+       action, or user semantic action that manipulated yychar.
+     - Of course, the expected token list depends on states to have
+       correct lookahead information, and it depends on the parser not
+       to perform extra reductions after fetching a lookahead from the
+       scanner and before detecting a syntax error.  Thus, state merging
+       (from LALR or IELR) and default reductions corrupt the expected
+       token list.  However, the list is correct for canonical LR with
+       one exception: it will still contain any token that will not be
+       accepted due to an error action in a later state.
+  */
+  if (yytoken != YYEMPTY)
     {
-      int yytype = YYTRANSLATE (yychar);
-      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
-      YYSIZE_T yysize = yysize0;
-      YYSIZE_T yysize1;
-      int yysize_overflow = 0;
-      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
-      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
-      int yyx;
-
-# if 0
-      /* This is so xgettext sees the translatable formats that are
-        constructed on the fly.  */
-      YY_("syntax error, unexpected %s");
-      YY_("syntax error, unexpected %s, expecting %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
-      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-# endif
-      char *yyfmt;
-      char const *yyf;
-      static char const yyunexpected[] = "syntax error, unexpected %s";
-      static char const yyexpecting[] = ", expecting %s";
-      static char const yyor[] = " or %s";
-      char yyformat[sizeof yyunexpected
-                   + sizeof yyexpecting - 1
-                   + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
-                      * (sizeof yyor - 1))];
-      char const *yyprefix = yyexpecting;
-
-      /* Start YYX at -YYN if negative to avoid negative indexes in
-        YYCHECK.  */
-      int yyxbegin = yyn < 0 ? -yyn : 0;
-
-      /* Stay within bounds of both yycheck and yytname.  */
-      int yychecklim = YYLAST - yyn + 1;
-      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
-      int yycount = 1;
-
-      yyarg[0] = yytname[yytype];
-      yyfmt = yystpcpy (yyformat, yyunexpected);
-
-      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-       if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
-         {
-           if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
-             {
-               yycount = 1;
-               yysize = yysize0;
-               yyformat[sizeof yyunexpected - 1] = '\0';
-               break;
-             }
-           yyarg[yycount++] = yytname[yyx];
-           yysize1 = yysize + yytnamerr (0, yytname[yyx]);
-           yysize_overflow |= (yysize1 < yysize);
-           yysize = yysize1;
-           yyfmt = yystpcpy (yyfmt, yyprefix);
-           yyprefix = yyor;
-         }
+      int yyn = yypact[*yyssp];
+      yyarg[yycount++] = yytname[yytoken];
+      if (!yypact_value_is_default (yyn))
+        {
+          /* Start YYX at -YYN if negative to avoid negative indexes in
+             YYCHECK.  In other words, skip the first -YYN actions for
+             this state because they are default actions.  */
+          int yyxbegin = yyn < 0 ? -yyn : 0;
+          /* Stay within bounds of both yycheck and yytname.  */
+          int yychecklim = YYLAST - yyn + 1;
+          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+          int yyx;
+
+          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
+                && !yytable_value_is_error (yytable[yyx + yyn]))
+              {
+                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+                  {
+                    yycount = 1;
+                    yysize = yysize0;
+                    break;
+                  }
+                yyarg[yycount++] = yytname[yyx];
+                yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+                if (! (yysize <= yysize1
+                       && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+                  return 2;
+                yysize = yysize1;
+              }
+        }
+    }
 
-      yyf = YY_(yyformat);
-      yysize1 = yysize + yystrlen (yyf);
-      yysize_overflow |= (yysize1 < yysize);
-      yysize = yysize1;
+  switch (yycount)
+    {
+# define YYCASE_(N, S)                      \
+      case N:                               \
+        yyformat = S;                       \
+      break
+      YYCASE_(0, YY_("syntax error"));
+      YYCASE_(1, YY_("syntax error, unexpected %s"));
+      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
+      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
+      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
+      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
+# undef YYCASE_
+    }
 
-      if (yysize_overflow)
-       return YYSIZE_MAXIMUM;
+  yysize1 = yysize + yystrlen (yyformat);
+  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+    return 2;
+  yysize = yysize1;
 
-      if (yyresult)
-       {
-         /* Avoid sprintf, as that infringes on the user's name space.
-            Don't have undefined behavior even if the translation
-            produced a string with the wrong number of "%s"s.  */
-         char *yyp = yyresult;
-         int yyi = 0;
-         while ((*yyp = *yyf) != '\0')
-           {
-             if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
-               {
-                 yyp += yytnamerr (yyp, yyarg[yyi++]);
-                 yyf += 2;
-               }
-             else
-               {
-                 yyp++;
-                 yyf++;
-               }
-           }
-       }
-      return yysize;
+  if (*yymsg_alloc < yysize)
+    {
+      *yymsg_alloc = 2 * yysize;
+      if (! (yysize <= *yymsg_alloc
+             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
+        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
+      return 1;
     }
+
+  /* Avoid sprintf, as that infringes on the user's name space.
+     Don't have undefined behavior even if the translation
+     produced a string with the wrong number of "%s"s.  */
+  {
+    char *yyp = *yymsg;
+    int yyi = 0;
+    while ((*yyp = *yyformat) != '\0')
+      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
+        {
+          yyp += yytnamerr (yyp, yyarg[yyi++]);
+          yyformat += 2;
+        }
+      else
+        {
+          yyp++;
+          yyformat++;
+        }
+  }
+  return 0;
 }
 #endif /* YYERROR_VERBOSE */
-\f
 
 /*-----------------------------------------------.
 | Release the memory associated to this symbol.  |
@@ -1347,6 +1380,7 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, term, scanner)
     }
 }
 
+
 /* Prevent warnings from -Wmissing-prototypes.  */
 #ifdef YYPARSE_PARAM
 #if defined __STDC__ || defined __cplusplus
@@ -1363,12 +1397,9 @@ int yyparse ();
 #endif /* ! YYPARSE_PARAM */
 
 
-
-
-
-/*-------------------------.
-| yyparse or yypush_parse.  |
-`-------------------------*/
+/*----------.
+| yyparse.  |
+`----------*/
 
 #ifdef YYPARSE_PARAM
 #if (defined __STDC__ || defined __C99__FUNC__ \
@@ -1488,7 +1519,7 @@ YYLTYPE yylloc;
 
 /* User initialization code.  */
 
-/* Line 1251 of yacc.c  */
+/* Line 1590 of yacc.c  */
 #line 66 "parser.y"
 {
   yylloc.first_line   = 1;
@@ -1499,8 +1530,8 @@ YYLTYPE yylloc;
   yylloc.error        = augl_get_info(scanner)->error;
 }
 
-/* Line 1251 of yacc.c  */
-#line 1504 "parser.c"
+/* Line 1590 of yacc.c  */
+#line 1535 "parser.c"
   yylsp[0] = yylloc;
 
   goto yysetstate;
@@ -1599,7 +1630,7 @@ yybackup:
 
   /* First try to decide what to do without reference to lookahead token.  */
   yyn = yypact[yystate];
-  if (yyn == YYPACT_NINF)
+  if (yypact_value_is_default (yyn))
     goto yydefault;
 
   /* Not known => get a lookahead token if don't already have one.  */
@@ -1630,8 +1661,8 @@ yybackup:
   yyn = yytable[yyn];
   if (yyn <= 0)
     {
-      if (yyn == 0 || yyn == YYTABLE_NINF)
-       goto yyerrlab;
+      if (yytable_value_is_error (yyn))
+        goto yyerrlab;
       yyn = -yyn;
       goto yyreduce;
     }
@@ -1687,28 +1718,28 @@ yyreduce:
     {
         case 2:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 180 "parser.y"
     { (*term) = make_module((yyvsp[(2) - (5)].string), (yyvsp[(4) - (5)].string), (yyvsp[(5) - (5)].term), &(yylsp[(1) - (5)])); }
     break;
 
   case 3:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 183 "parser.y"
     { (yyval.string) = (yyvsp[(2) - (2)].string); }
     break;
 
   case 4:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 185 "parser.y"
     { (yyval.string) = NULL; }
     break;
 
   case 5:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 188 "parser.y"
     {
          LOC_MERGE((yylsp[(1) - (6)]), (yylsp[(1) - (6)]), (yylsp[(5) - (6)]));
@@ -1718,7 +1749,7 @@ yyreduce:
 
   case 6:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 193 "parser.y"
     {
          LOC_MERGE((yylsp[(1) - (5)]), (yylsp[(1) - (5)]), (yylsp[(4) - (5)]));
@@ -1728,7 +1759,7 @@ yyreduce:
 
   case 7:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 198 "parser.y"
     {
          LOC_MERGE((yylsp[(1) - (5)]), (yylsp[(1) - (5)]), (yylsp[(4) - (5)]));
@@ -1738,7 +1769,7 @@ yyreduce:
 
   case 8:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 203 "parser.y"
     {
          LOC_MERGE((yylsp[(1) - (5)]), (yylsp[(1) - (5)]), (yylsp[(4) - (5)]));
@@ -1748,42 +1779,42 @@ yyreduce:
 
   case 9:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 208 "parser.y"
     { (yyval.term) = NULL; }
     break;
 
   case 10:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 213 "parser.y"
     { (yyval.term) = make_get_test((yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), &(yyloc)); }
     break;
 
   case 11:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 215 "parser.y"
     { (yyval.term) = make_put_test((yyvsp[(1) - (5)].term), (yyvsp[(3) - (5)].term), (yyvsp[(5) - (5)].term), &(yyloc)); }
     break;
 
   case 12:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 218 "parser.y"
     { (yyval.intval) = TR_PRINT; }
     break;
 
   case 13:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 220 "parser.y"
     { (yyval.intval) = TR_EXN; }
     break;
 
   case 14:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 224 "parser.y"
     {
        LOC_MERGE((yylsp[(1) - (7)]), (yylsp[(1) - (7)]), (yylsp[(6) - (7)]));
@@ -1793,287 +1824,287 @@ yyreduce:
 
   case 16:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 231 "parser.y"
     { (yyval.term) = make_binop(A_COMPOSE, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), &(yyloc)); }
     break;
 
   case 17:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 233 "parser.y"
     { (yyval.term) = (yyvsp[(1) - (1)].term); }
     break;
 
   case 18:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 236 "parser.y"
     { (yyval.term) = make_binop(A_UNION, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), &(yyloc)); }
     break;
 
   case 19:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 238 "parser.y"
     { (yyval.term) = (yyvsp[(1) - (1)].term); }
     break;
 
   case 20:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 240 "parser.y"
     { (yyval.term) = make_tree_value((yyvsp[(1) - (1)].tree), &(yylsp[(1) - (1)])); }
     break;
 
   case 21:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 243 "parser.y"
     { (yyval.term) = make_binop(A_MINUS, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), &(yyloc)); }
     break;
 
   case 22:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 245 "parser.y"
     { (yyval.term) = (yyvsp[(1) - (1)].term); }
     break;
 
   case 23:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 248 "parser.y"
     { (yyval.term) = make_binop(A_CONCAT, (yyvsp[(1) - (3)].term), (yyvsp[(3) - (3)].term), &(yyloc)); }
     break;
 
   case 24:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 250 "parser.y"
     { (yyval.term) = (yyvsp[(1) - (1)].term); }
     break;
 
   case 25:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 253 "parser.y"
     { (yyval.term) = make_binop(A_APP, (yyvsp[(1) - (2)].term), (yyvsp[(2) - (2)].term), &(yyloc)); }
     break;
 
   case 26:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 255 "parser.y"
     { (yyval.term) = (yyvsp[(1) - (1)].term); }
     break;
 
   case 27:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 258 "parser.y"
     { (yyval.term) = make_ident((yyvsp[(1) - (1)].string), &(yylsp[(1) - (1)])); }
     break;
 
   case 28:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 260 "parser.y"
     { (yyval.term) = make_string_term((yyvsp[(1) - (1)].string), &(yylsp[(1) - (1)])); }
     break;
 
   case 29:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 262 "parser.y"
     { (yyval.term) = make_regexp_term((yyvsp[(1) - (1)].regexp).pattern, (yyvsp[(1) - (1)].regexp).nocase, &(yylsp[(1) - (1)])); }
     break;
 
   case 30:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 264 "parser.y"
     { (yyval.term) = (yyvsp[(2) - (3)].term); }
     break;
 
   case 31:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 266 "parser.y"
     { (yyval.term) = make_unop(A_BRACKET, (yyvsp[(2) - (3)].term), &(yyloc)); }
     break;
 
   case 32:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 268 "parser.y"
     { (yyval.term) = make_unit_term(&(yyloc)); }
     break;
 
   case 33:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 271 "parser.y"
     { (yyval.term) = make_rep((yyvsp[(1) - (2)].term), (yyvsp[(2) - (2)].quant), &(yyloc)); }
     break;
 
   case 34:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 273 "parser.y"
     { (yyval.term) = (yyvsp[(1) - (1)].term); }
     break;
 
   case 35:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 276 "parser.y"
     { (yyval.quant) = Q_STAR; }
     break;
 
   case 36:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 278 "parser.y"
     { (yyval.quant) = Q_PLUS; }
     break;
 
   case 37:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 280 "parser.y"
     { (yyval.quant) = Q_MAYBE; }
     break;
 
   case 38:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 283 "parser.y"
     { (yyval.string) = (yyvsp[(1) - (1)].string); }
     break;
 
   case 39:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 285 "parser.y"
     { (yyval.string) = (yyvsp[(1) - (1)].string); }
     break;
 
   case 40:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 287 "parser.y"
     { (yyval.string) = strdup("get"); }
     break;
 
   case 41:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 289 "parser.y"
     { (yyval.string) = strdup("put"); }
     break;
 
   case 42:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 292 "parser.y"
     { (yyval.term) = (yyvsp[(2) - (2)].term); list_cons((yyval.term), (yyvsp[(1) - (2)].term)); }
     break;
 
   case 43:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 294 "parser.y"
     { (yyval.term) = NULL; }
     break;
 
   case 44:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 297 "parser.y"
     { (yyval.term) = make_param((yyvsp[(2) - (5)].string), (yyvsp[(4) - (5)].type), clone_info(&(yylsp[(1) - (5)]))); }
     break;
 
   case 45:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 300 "parser.y"
     { (yyval.string) = (yyvsp[(1) - (1)].string); }
     break;
 
   case 46:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 302 "parser.y"
     { (yyval.string) = strdup("get"); }
     break;
 
   case 47:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 304 "parser.y"
     { (yyval.string) = strdup("put"); }
     break;
 
   case 48:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 307 "parser.y"
     { (yyval.type) = make_arrow_type((yyvsp[(1) - (3)].type), (yyvsp[(3) - (3)].type)); }
     break;
 
   case 49:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 309 "parser.y"
     { (yyval.type) = (yyvsp[(1) - (1)].type); }
     break;
 
   case 50:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 312 "parser.y"
     { (yyval.type) = make_base_type(T_STRING); }
     break;
 
   case 51:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 314 "parser.y"
     { (yyval.type) = make_base_type(T_REGEXP); }
     break;
 
   case 52:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 316 "parser.y"
     { (yyval.type) = make_base_type(T_LENS); }
     break;
 
   case 53:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 318 "parser.y"
     { (yyval.type) = (yyvsp[(2) - (3)].type); }
     break;
 
   case 54:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 321 "parser.y"
     { (yyval.tree) = tree_concat((yyvsp[(1) - (4)].tree), (yyvsp[(3) - (4)].tree)); }
     break;
 
   case 55:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 323 "parser.y"
     { (yyval.tree) = tree_concat((yyvsp[(2) - (3)].tree), NULL); }
     break;
 
   case 56:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 326 "parser.y"
     {
               (yyval.tree) = tree_concat((yyvsp[(1) - (4)].tree), (yyvsp[(3) - (4)].tree));
@@ -2082,14 +2113,14 @@ yyreduce:
 
   case 57:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 330 "parser.y"
     { (yyval.tree) = NULL; }
     break;
 
   case 58:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 333 "parser.y"
     {
                (yyval.tree) = make_tree((yyvsp[(1) - (2)].string), NULL, NULL, (yyvsp[(2) - (2)].tree));
@@ -2098,7 +2129,7 @@ yyreduce:
 
   case 59:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 337 "parser.y"
     {
                (yyval.tree) = make_tree((yyvsp[(1) - (4)].string), (yyvsp[(3) - (4)].string), NULL, (yyvsp[(4) - (4)].tree));
@@ -2107,17 +2138,28 @@ yyreduce:
 
   case 61:
 
-/* Line 1464 of yacc.c  */
+/* Line 1806 of yacc.c  */
 #line 342 "parser.y"
     { (yyval.string) = NULL; }
     break;
 
 
 
-/* Line 1464 of yacc.c  */
-#line 2119 "parser.c"
+/* Line 1806 of yacc.c  */
+#line 2150 "parser.c"
       default: break;
     }
+  /* User semantic actions sometimes alter yychar, and that requires
+     that yytoken be updated with the new translation.  We take the
+     approach of translating immediately before every use of yytoken.
+     One alternative is translating here after every semantic action,
+     but that translation would be missed if the semantic action invokes
+     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
+     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
+     incorrect destructor might then be invoked immediately.  In the
+     case of YYERROR or YYBACKUP, subsequent parser actions might lead
+     to an incorrect destructor call or verbose syntax error message
+     before the lookahead is translated.  */
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
 
   YYPOPSTACK (yylen);
@@ -2146,6 +2188,10 @@ yyreduce:
 | yyerrlab -- here on detecting error |
 `------------------------------------*/
 yyerrlab:
+  /* Make sure we have latest lookahead translation.  See comments at
+     user semantic actions for why this is necessary.  */
+  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
+
   /* If not already recovering from an error, report this error.  */
   if (!yyerrstatus)
     {
@@ -2153,37 +2199,36 @@ yyerrlab:
 #if ! YYERROR_VERBOSE
       yyerror (&yylloc, term, scanner, YY_("syntax error"));
 #else
+# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
+                                        yyssp, yytoken)
       {
-       YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
-       if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
-         {
-           YYSIZE_T yyalloc = 2 * yysize;
-           if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
-             yyalloc = YYSTACK_ALLOC_MAXIMUM;
-           if (yymsg != yymsgbuf)
-             YYSTACK_FREE (yymsg);
-           yymsg = (char *) YYSTACK_ALLOC (yyalloc);
-           if (yymsg)
-             yymsg_alloc = yyalloc;
-           else
-             {
-               yymsg = yymsgbuf;
-               yymsg_alloc = sizeof yymsgbuf;
-             }
-         }
-
-       if (0 < yysize && yysize <= yymsg_alloc)
-         {
-           (void) yysyntax_error (yymsg, yystate, yychar);
-           yyerror (&yylloc, term, scanner, yymsg);
-         }
-       else
-         {
-           yyerror (&yylloc, term, scanner, YY_("syntax error"));
-           if (yysize != 0)
-             goto yyexhaustedlab;
-         }
+        char const *yymsgp = YY_("syntax error");
+        int yysyntax_error_status;
+        yysyntax_error_status = YYSYNTAX_ERROR;
+        if (yysyntax_error_status == 0)
+          yymsgp = yymsg;
+        else if (yysyntax_error_status == 1)
+          {
+            if (yymsg != yymsgbuf)
+              YYSTACK_FREE (yymsg);
+            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
+            if (!yymsg)
+              {
+                yymsg = yymsgbuf;
+                yymsg_alloc = sizeof yymsgbuf;
+                yysyntax_error_status = 2;
+              }
+            else
+              {
+                yysyntax_error_status = YYSYNTAX_ERROR;
+                yymsgp = yymsg;
+              }
+          }
+        yyerror (&yylloc, term, scanner, yymsgp);
+        if (yysyntax_error_status == 2)
+          goto yyexhaustedlab;
       }
+# undef YYSYNTAX_ERROR
 #endif
     }
 
@@ -2243,7 +2288,7 @@ yyerrlab1:
   for (;;)
     {
       yyn = yypact[yystate];
-      if (yyn != YYPACT_NINF)
+      if (!yypact_value_is_default (yyn))
        {
          yyn += YYTERROR;
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
@@ -2307,8 +2352,13 @@ yyexhaustedlab:
 
 yyreturn:
   if (yychar != YYEMPTY)
-     yydestruct ("Cleanup: discarding lookahead",
-                yytoken, &yylval, &yylloc, term, scanner);
+    {
+      /* Make sure we have latest lookahead translation.  See comments at
+         user semantic actions for why this is necessary.  */
+      yytoken = YYTRANSLATE (yychar);
+      yydestruct ("Cleanup: discarding lookahead",
+                  yytoken, &yylval, &yylloc, term, scanner);
+    }
   /* Do not reclaim the symbols of the rule which action triggered
      this YYABORT or YYACCEPT.  */
   YYPOPSTACK (yylen);
@@ -2333,7 +2383,7 @@ yyreturn:
 
 
 
-/* Line 1684 of yacc.c  */
+/* Line 2067 of yacc.c  */
 #line 343 "parser.y"
 
 
index 11618cf..f681a36 100644 (file)
@@ -1,9 +1,8 @@
-/* A Bison parser, made by GNU Bison 2.4.3.  */
+/* A Bison parser, made by GNU Bison 2.5.  */
 
-/* Skeleton interface for Bison's Yacc-like parsers in C
+/* Bison interface for Yacc-like parsers in C
    
-      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-   2009, 2010 Free Software Foundation, Inc.
+      Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
    
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -85,7 +84,7 @@
 typedef union YYSTYPE
 {
 
-/* Line 1685 of yacc.c  */
+/* Line 2068 of yacc.c  */
 #line 89 "parser.y"
 
   struct term    *term;
@@ -102,8 +101,8 @@ typedef union YYSTYPE
 
 
 
-/* Line 1685 of yacc.c  */
-#line 107 "parser.h"
+/* Line 2068 of yacc.c  */
+#line 106 "parser.h"
 } YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
@@ -129,7 +128,7 @@ typedef struct YYLTYPE
 
 /* "%code provides" blocks.  */
 
-/* Line 1685 of yacc.c  */
+/* Line 2068 of yacc.c  */
 #line 46 "parser.y"
 
 #include "info.h"
@@ -143,5 +142,5 @@ struct state {
 
 
 
-/* Line 1685 of yacc.c  */
-#line 148 "parser.h"
+/* Line 2068 of yacc.c  */
+#line 147 "parser.h"
index c6aa4c4..467e5d7 100644 (file)
@@ -49,7 +49,8 @@ static const char *const errcodes[] = {
     "no match for path expression",               /* PATHX_ENOMATCH */
     "wrong number of arguments in function call", /* PATHX_EARITY */
     "invalid regular expression",                 /* PATHX_EREGEXP */
-    "too many matches"                            /* PATHX_EMMATCH */
+    "too many matches",                           /* PATHX_EMMATCH */
+    "wrong flag for regexp"                       /* PATHX_EREGEXPFLAG */
 };
 
 /*
@@ -268,7 +269,7 @@ static inline int streqx(const char *s1, const char *s2) {
 
 /* Functions */
 
-typedef void (*func_impl_t)(struct state *state);
+typedef void (*func_impl_t)(struct state *state, int nargs);
 
 struct func {
     const char      *name;
@@ -278,17 +279,20 @@ struct func {
     func_impl_t      impl;
 };
 
-static void func_last(struct state *state);
-static void func_position(struct state *state);
-static void func_count(struct state *state);
-static void func_label(struct state *state);
-static void func_regexp(struct state *state);
-static void func_glob(struct state *state);
-static void func_int(struct state *state);
+static void func_last(struct state *state, int nargs);
+static void func_position(struct state *state, int nargs);
+static void func_count(struct state *state, int nargs);
+static void func_label(struct state *state, int nargs);
+static void func_regexp(struct state *state, int nargs);
+static void func_regexp_flag(struct state *state, int nargs);
+static void func_glob(struct state *state, int nargs);
+static void func_int(struct state *state, int nargs);
 
 static const enum type const arg_types_nodeset[] = { T_NODESET };
 static const enum type const arg_types_string[] = { T_STRING };
 static const enum type const arg_types_bool[] = { T_BOOLEAN };
+static const enum type const arg_types_string_string[] = { T_STRING, T_STRING };
+static const enum type const arg_types_nodeset_string[] = { T_NODESET, T_STRING };
 
 static const struct func builtin_funcs[] = {
     { .name = "last", .arity = 0, .type = T_NUMBER, .arg_types = NULL,
@@ -306,6 +310,12 @@ static const struct func builtin_funcs[] = {
     { .name = "regexp", .arity = 1, .type = T_REGEXP,
       .arg_types = arg_types_nodeset,
       .impl = func_regexp },
+    { .name = "regexp", .arity = 2, .type = T_REGEXP,
+      .arg_types = arg_types_string_string,
+      .impl = func_regexp_flag },
+    { .name = "regexp", .arity = 2, .type = T_REGEXP,
+      .arg_types = arg_types_nodeset_string,
+      .impl = func_regexp_flag },
     { .name = "glob", .arity = 1, .type = T_REGEXP,
       .arg_types = arg_types_string,
       .impl = func_glob },
@@ -612,7 +622,15 @@ static struct value *expr_value(struct expr *expr, struct state *state) {
  ************************************************************************/
 static void eval_expr(struct expr *expr, struct state *state);
 
-static void func_last(struct state *state) {
+
+#define ensure_arity(min, max)                                          \
+    if (nargs < min || nargs > max) {                                   \
+        STATE_ERROR(state, PATHX_EINTERNAL);                            \
+        return;                                                         \
+    }
+
+static void func_last(struct state *state, int nargs) {
+    ensure_arity(0, 0);
     value_ind_t vind = make_value(T_NUMBER, state);
     RET_ON_ERROR;
 
@@ -620,7 +638,8 @@ static void func_last(struct state *state) {
     push_value(vind, state);
 }
 
-static void func_position(struct state *state) {
+static void func_position(struct state *state, int nargs) {
+    ensure_arity(0, 0);
     value_ind_t vind = make_value(T_NUMBER, state);
     RET_ON_ERROR;
 
@@ -628,7 +647,8 @@ static void func_position(struct state *state) {
     push_value(vind, state);
 }
 
-static void func_count(struct state *state) {
+static void func_count(struct state *state, int nargs) {
+    ensure_arity(1, 1);
     value_ind_t vind = make_value(T_NUMBER, state);
     RET_ON_ERROR;
 
@@ -637,7 +657,8 @@ static void func_count(struct state *state) {
     push_value(vind, state);
 }
 
-static void func_label(struct state *state) {
+static void func_label(struct state *state, int nargs) {
+    ensure_arity(0, 0);
     value_ind_t vind = make_value(T_STRING, state);
     char *s;
 
@@ -655,7 +676,8 @@ static void func_label(struct state *state) {
     push_value(vind, state);
 }
 
-static void func_int(struct state *state) {
+static void func_int(struct state *state, int nargs) {
+    ensure_arity(1, 1);
     value_ind_t vind = make_value(T_NUMBER, state);
     int64_t i = -1;
     RET_ON_ERROR;
@@ -689,7 +711,7 @@ static void func_int(struct state *state) {
 }
 
 static struct regexp *
-nodeset_as_regexp(struct info *info, struct nodeset *ns, int glob) {
+nodeset_as_regexp(struct info *info, struct nodeset *ns, int glob, int nocase) {
     struct regexp *result = NULL;
     struct regexp **rx = NULL;
     int used = 0;
@@ -702,7 +724,7 @@ nodeset_as_regexp(struct info *info, struct nodeset *ns, int glob) {
     if (used == 0) {
         /* If the nodeset is empty, make sure we produce a regexp
          * that never matches anything */
-        result = make_regexp_unescape(info, "[^\001-\7ff]", 0);
+        result = make_regexp_unescape(info, "[^\001-\7ff]", nocase);
     } else {
         if (ALLOC_N(rx, ns->used) < 0)
             goto error;
@@ -729,7 +751,7 @@ nodeset_as_regexp(struct info *info, struct nodeset *ns, int glob) {
     return result;
 }
 
-static void func_regexp_or_glob(struct state *state, int glob) {
+static void func_regexp_or_glob(struct state *state, int glob, int nocase) {
     value_ind_t vind = make_value(T_REGEXP, state);
     int r;
 
@@ -742,9 +764,9 @@ static void func_regexp_or_glob(struct state *state, int glob) {
         if (glob)
             rx = make_regexp_from_glob(state->error->info, v->string);
         else
-            rx = make_regexp_unescape(state->error->info, v->string, 0);
+            rx = make_regexp_unescape(state->error->info, v->string, nocase);
     } else if (v->tag == T_NODESET) {
-        rx = nodeset_as_regexp(state->error->info, v->nodeset, glob);
+        rx = nodeset_as_regexp(state->error->info, v->nodeset, glob, nocase);
     } else {
         assert(0);
     }
@@ -766,12 +788,27 @@ static void func_regexp_or_glob(struct state *state, int glob) {
     push_value(vind, state);
 }
 
-static void func_regexp(struct state *state) {
-    func_regexp_or_glob(state, 0);
+static void func_regexp(struct state *state, int nargs) {
+    ensure_arity(1, 1);
+    func_regexp_or_glob(state, 0, 0);
+}
+
+static void func_regexp_flag(struct state *state, int nargs) {
+    ensure_arity(2, 2);
+    int nocase = 0;
+    struct value *f = pop_value(state);
+
+    if (STREQ("i", f->string))
+        nocase = 1;
+    else
+        STATE_ERROR(state, PATHX_EREGEXPFLAG);
+
+    func_regexp_or_glob(state, 0, nocase);
 }
 
-static void func_glob(struct state *state) {
-    func_regexp_or_glob(state, 1);
+static void func_glob(struct state *state, int nargs) {
+    ensure_arity(1, 1);
+    func_regexp_or_glob(state, 1, 0);
 }
 
 static bool coerce_to_bool(struct value *v) {
@@ -1079,7 +1116,7 @@ static void eval_app(struct expr *expr, struct state *state) {
         eval_expr(expr->args[i], state);
         RET_ON_ERROR;
     }
-    expr->func->impl(state);
+    expr->func->impl(state, expr->func->arity);
 }
 
 static bool eval_pred(struct expr *expr, struct state *state) {
@@ -1347,6 +1384,8 @@ static void check_app(struct expr *expr, struct state *state) {
         const struct func *fn = builtin_funcs + f;
         if (STRNEQ(expr->func->name, fn->name))
             continue;
+        if (expr->func->arity != fn->arity)
+            continue;
 
         int match = 1;
         for (int i=0; i < expr->func->arity; i++) {
@@ -1574,7 +1613,7 @@ static void push_new_binary_op(enum binary_op op, struct state *state) {
  * Name ::= NameNoWS NameWS* NameNoWS | NameNoWS
  */
 static char *parse_name(struct state *state) {
-    static const char const follow[] = "][|/=()!";
+    static const char const follow[] = "][|/=()!,";
     const char *s = state->pos;
     char *result;
 
@@ -1920,11 +1959,13 @@ static void parse_literal(struct state *state) {
 static void parse_function_call(struct state *state) {
     const struct func *func = NULL;
     struct expr *expr = NULL;
-    int nargs = 0;
+    int nargs = 0, find = 0;
 
-    for (int i=0; i < ARRAY_CARDINALITY(builtin_funcs); i++) {
-        if (looking_at(state, builtin_funcs[i].name, "("))
-            func = builtin_funcs + i;
+    for (; find < ARRAY_CARDINALITY(builtin_funcs); find++) {
+        if (looking_at(state, builtin_funcs[find].name, "(")) {
+            func = builtin_funcs + find;
+            break;
+        }
     }
     if (func == NULL) {
         STATE_ERROR(state, PATHX_ENAME);
@@ -1944,7 +1985,18 @@ static void parse_function_call(struct state *state) {
         }
     }
 
-    if (nargs != func->arity) {
+    int found = 0; /* Whether there is a builtin matching in name and arity */
+    for (int i=find; i < ARRAY_CARDINALITY(builtin_funcs); i++) {
+        if (STRNEQ(func->name, builtin_funcs[i].name))
+            break;
+        if (builtin_funcs[i].arity == nargs) {
+            func = builtin_funcs + i;
+            found = 1;
+            break;
+        }
+    }
+
+    if (! found) {
         STATE_ERROR(state, PATHX_EARITY);
         return;
     }
index 56732d2..6888ef9 100644 (file)
--- a/src/put.c
+++ b/src/put.c
@@ -59,6 +59,7 @@ struct state {
     struct split     *split;
     const char       *key;
     const char       *value;
+    const char       *override;
     struct dict      *dict;
     struct skel      *skel;
     char             *path;   /* Position in the tree, for errors */
@@ -420,7 +421,8 @@ static int skel_instance_of(struct lens *lens, struct skel *skel) {
     case L_REC:
         return skel_instance_of(lens->body, skel);
     case L_SQUARE:
-        return skel->tag == L_SQUARE;
+        return skel->tag == L_SQUARE
+            && skel_instance_of(lens->child, skel->skels);
     default:
         BUG_ON(true, lens->info, "illegal lens tag %d", lens->tag);
         break;
@@ -468,11 +470,10 @@ static void put_del(ATTRIBUTE_UNUSED struct lens *lens, struct state *state) {
     assert(lens->tag == L_DEL);
     assert(state->skel != NULL);
     assert(state->skel->tag == L_DEL);
-    if (lens->string != NULL) {
-    fprintf(state->out, "%s", state->skel->text);
+    if (state->override != NULL) {
+        fprintf(state->out, "%s", state->override);
     } else {
-    /* L_DEL with NULL string: replicate the current key */
-        fprintf(state->out, "%s", state->key);
+        fprintf(state->out, "%s", state->skel->text);
     }
 }
 
@@ -598,9 +599,32 @@ static void put_rec(struct lens *lens, struct state *state) {
 }
 
 static void put_square(struct lens *lens, struct state *state) {
+    assert(lens->tag == L_SQUARE);
     struct skel *oldskel = state->skel;
-    state->skel = state->skel->skels;
-    put_lens(lens->child, state);
+    struct split *oldsplit = state->split;
+    struct lens *concat = lens->child;
+    struct lens *left = concat->children[0];
+    struct split *split = split_concat(state, concat);
+
+    /* skels of concat is one depth more */
+    state->skel = state->skel->skels->skels;
+    set_split(state, split);
+    for (int i=0; i < concat->nchildren; i++) {
+        if (state->split == NULL) {
+            put_error(state, concat, "Not enough components in square");
+            list_free(split);
+            return;
+        }
+        struct lens *curr = concat->children[i];
+        if (i == (concat->nchildren - 1) && left->tag == L_KEY)
+            state->override = state->key;
+        put_lens(curr, state);
+        state->override = NULL;
+        state->skel = state->skel->next;
+        next_split(state);
+    }
+    list_free(split);
+    set_split(state, oldsplit);
     state->skel = oldskel;
 }
 
@@ -661,13 +685,11 @@ static void create_subtree(struct lens *lens, struct state *state) {
 
 static void create_del(struct lens *lens, struct state *state) {
     assert(lens->tag == L_DEL);
-    if (lens->string != NULL) {
-        print_escaped_chars(state->out, lens->string->str);
+    if (state->override != NULL) {
+        print_escaped_chars(state->out, state->override);
     } else {
-        /* L_DEL with NULL string: replicate the current key */
-        print_escaped_chars(state->out, state->key);
+        print_escaped_chars(state->out, lens->string->str);
     }
-
 }
 
 static void create_union(struct lens *lens, struct state *state) {
@@ -703,6 +725,32 @@ static void create_concat(struct lens *lens, struct state *state) {
     set_split(state, oldsplit);
 }
 
+static void create_square(struct lens *lens, struct state *state) {
+    assert(lens->tag == L_SQUARE);
+    struct lens *concat = lens->child;
+
+    struct split *oldsplit = state->split;
+    struct split *split = split_concat(state, concat);
+    struct lens *left = concat->children[0];
+
+    set_split(state, split);
+    for (int i=0; i < concat->nchildren; i++) {
+        if (state->split == NULL) {
+            put_error(state, concat, "Not enough components in square");
+            list_free(split);
+            return;
+        }
+        struct lens *curr = concat->children[i];
+        if (i == (concat->nchildren - 1) && left->tag == L_KEY)
+            state->override = state->key;
+        create_lens(curr, state);
+        state->override = NULL;
+        next_split(state);
+    }
+    list_free(split);
+    set_split(state, oldsplit);
+}
+
 static void create_quant_star(struct lens *lens, struct state *state) {
     assert(lens->tag == L_STAR);
     struct split *oldsplit = state->split;
@@ -777,7 +825,7 @@ static void create_lens(struct lens *lens, struct state *state) {
         create_rec(lens, state);
         break;
     case L_SQUARE:
-        create_concat(lens->child, state);
+        create_square(lens, state);
         break;
     default:
         assert(0);
index cf0ea5d..55591b5 100644 (file)
@@ -50,7 +50,7 @@ char *regexp_escape(const struct regexp *r) {
     ret = fa_restrict_alphabet(r->pattern->str, strlen(r->pattern->str),
                                &nre, &nre_len, 2, 1);
     if (ret == 0) {
-        pat = escape(nre, nre_len);
+        pat = escape(nre, nre_len, RX_ESCAPES);
         free(nre);
     }
 #endif
@@ -237,10 +237,11 @@ regexp_union(struct info *info, struct regexp *r1, struct regexp *r2) {
 }
 
 char *regexp_expand_nocase(struct regexp *r) {
-    const char *p = r->pattern->str;
+    const char *p = r->pattern->str, *t;
     char *s = NULL;
     size_t len;
     int ret;
+    int psub = 0, rsub = 0;
 
     if (! r->nocase)
         return strdup(p);
@@ -248,16 +249,55 @@ char *regexp_expand_nocase(struct regexp *r) {
     ret = fa_expand_nocase(p, strlen(p), &s, &len);
     ERR_NOMEM(ret == REG_ESPACE, r->info);
     BUG_ON(ret != REG_NOERROR, r->info, NULL);
+
+    /* Make sure that r->pattern->str and ret have the same number
+     * of parentheses/groups, since our parser critically depends
+     * on the fact that the regexp for a union/concat and those
+     * of its children have groups that are in direct relation */
+    for (t = p; *t; t++) if (*t == '(') psub += 1;
+    for (t = s; *t; t++) if (*t == '(') rsub += 1;
+    BUG_ON(psub < rsub, r->info, NULL);
+    psub -= rsub;
+    if (psub > 0) {
+        char *adjusted = NULL, *a;
+        if (ALLOC_N(adjusted, strlen(s) + 2*psub + 1) < 0)
+            ERR_NOMEM(true, r->info);
+        a = adjusted;
+        for (int i=0; i < psub; i++) *a++ = '(';
+        a = stpcpy(a, s);
+        for (int i=0; i < psub; i++) *a++ = ')';
+        free(s);
+        s = adjusted;
+    }
  error:
     return s;
 }
 
+static char *append_expanded(struct regexp *r, char **pat, char *p,
+                             size_t *len) {
+    char *expanded = NULL;
+    size_t ofs = p - *pat;
+    int ret;
+
+    expanded = regexp_expand_nocase(r);
+    ERR_BAIL(r->info);
+
+    *len += strlen(expanded) - strlen(r->pattern->str);
+
+    ret = REALLOC_N(*pat, *len);
+    ERR_NOMEM(ret < 0, r->info);
+
+    p = stpcpy(*pat + ofs, expanded);
+ error:
+    FREE(expanded);
+    return p;
+}
+
 struct regexp *
 regexp_union_n(struct info *info, int n, struct regexp **r) {
     size_t len = 0;
     char *pat = NULL, *p, *expanded = NULL;
     int nnocase = 0, npresent = 0;
-    int ret;
 
     for (int i=0; i < n; i++)
         if (r[i] != NULL) {
@@ -284,14 +324,8 @@ regexp_union_n(struct info *info, int n, struct regexp **r) {
             *p++ = '|';
         *p++ = '(';
         if (mixedcase && r[i]->nocase) {
-            expanded = regexp_expand_nocase(r[i]);
+            p = append_expanded(r[i], &pat, p, &len);
             ERR_BAIL(r[i]->info);
-            len += strlen(expanded) - strlen(r[i]->pattern->str);
-            ret = REALLOC_N(pat, len);
-            ERR_NOMEM(ret < 0, info);
-            p = pat + strlen(pat);
-            p = stpcpy(p, expanded);
-            FREE(expanded);
         } else {
             p = stpcpy(p, r[i]->pattern->str);
         }
@@ -320,7 +354,6 @@ regexp_concat_n(struct info *info, int n, struct regexp **r) {
     size_t len = 0;
     char *pat = NULL, *p, *expanded = NULL;
     int nnocase = 0, npresent = 0;
-    int ret;
 
     for (int i=0; i < n; i++)
         if (r[i] != NULL) {
@@ -345,14 +378,8 @@ regexp_concat_n(struct info *info, int n, struct regexp **r) {
             continue;
         *p++ = '(';
         if (mixedcase && r[i]->nocase) {
-            expanded = regexp_expand_nocase(r[i]);
+            p = append_expanded(r[i], &pat, p, &len);
             ERR_BAIL(r[i]->info);
-            len += strlen(expanded) - strlen(r[i]->pattern->str);
-            ret = REALLOC_N(pat, len);
-            ERR_NOMEM(ret < 0, info);
-            p = pat + strlen(pat);
-            p = stpcpy(p, expanded);
-            FREE(expanded);
         } else {
             p = stpcpy(p, r[i]->pattern->str);
         }
index 320d588..6f76af8 100644 (file)
@@ -81,6 +81,20 @@ struct ctx {
     struct binding *local;
 };
 
+static int init_fatal_exn(struct error *error) {
+    if (error->exn != NULL)
+        return 0;
+    error->exn = make_exn_value(ref(error->info), "Error during evaluation");
+    if (error->exn == NULL)
+        return -1;
+    error->exn->exn->seen = 1;
+    error->exn->exn->error = 1;
+    error->exn->exn->lines = NULL;
+    error->exn->exn->nlines = 0;
+    error->exn->ref = REF_MAX;
+    return 0;
+}
+
 static void format_error(struct info *info, aug_errcode_t code,
                          const char *format, va_list ap) {
     struct error *error = info->error;
@@ -434,18 +448,6 @@ void exn_printf_line(struct value *exn, const char *format, ...) {
         exn_add_lines(exn, 1, line);
 }
 
-struct value *exn_error(void) {
-    static const struct exn exn = {
-        .info = NULL, .seen = 1, .error = 1,
-        .message = (char *) "Error during evaluation",
-        .nlines = 0, .lines = NULL };
-    static const struct value value = {
-        .ref = REF_MAX, /* Protect against being freed */
-        .info = NULL, .tag = V_EXN,
-        { .exn = (struct exn *) &exn } };
-    return (struct value *) &value;
-}
-
 /*
  * Modules
  */
@@ -651,7 +653,7 @@ static void dump_ctx(struct ctx *ctx) {
 /*
  * Values
  */
-static void print_tree(FILE *out, int indent, struct tree *tree) {
+void print_tree_braces(FILE *out, int indent, struct tree *tree) {
     if (tree == NULL) {
         fprintf(out, "(null tree)\n");
         return;
@@ -665,7 +667,7 @@ static void print_tree(FILE *out, int indent, struct tree *tree) {
             fprintf(out, " = \"%s\"", t->value);
         if (t->children != NULL) {
             fputc('\n', out);
-            print_tree(out, indent + 2, t->children);
+            print_tree_braces(out, indent + 2, t->children);
             for (int i=0; i < indent; i++) fputc(' ', out);
         } else {
             fputc(' ', out);
@@ -693,7 +695,7 @@ static void print_value(FILE *out, struct value *v) {
         fprintf(out, ">");
         break;
     case V_TREE:
-        print_tree(out, 0, v->origin);
+        print_tree_braces(out, 0, v->origin);
         break;
     case V_FILTER:
         fprintf(out, "<filter:");
@@ -1441,6 +1443,7 @@ static struct value *compile_minus(struct term *exp, struct ctx *ctx) {
             v->regexp = re;
         }
     } else {
+        v = NULL;
         fatal_error(info, "Tried to subtract a %s and a %s to yield a %s",
                     type_name(exp->left->type), type_name(exp->right->type),
                     type_name(t));
@@ -1462,18 +1465,19 @@ static struct value *compile_compose(struct term *exp, struct ctx *ctx) {
 
         /* Build lambda x: exp->right (exp->left x) as a closure */
         char *var = strdup("@0");
-        struct term *param = make_param(var, ref(exp->left->type->dom),
-                                        ref(info));
-        param->type = ref(exp->left->type);
+        struct term *func = make_param(var, ref(exp->left->type->dom),
+                                       ref(info));
+        func->type = make_arrow_type(exp->left->type->dom,
+                                     exp->right->type->img);
         struct term *ident = make_term(A_IDENT, ref(info));
-        ident->ident = ref(param->param->name);
-        ident->type = ref(param->type);
+        ident->ident = ref(func->param->name);
+        ident->type = ref(func->param->type);
         struct term *app = make_app_term(ref(exp->left), ident, ref(info));
         app->type = ref(app->left->type->img);
         app = make_app_term(ref(exp->right), app, ref(info));
-        app->type = ref(app->left->type->img);
+        app->type = ref(app->right->type->img);
 
-        struct term *func = build_func(param, app);
+        build_func(func, app);
 
         if (!type_equal(func->type, exp->type)) {
             char *f = type_string(func->type);
@@ -1483,7 +1487,7 @@ static struct value *compile_compose(struct term *exp, struct ctx *ctx) {
             free(f);
             free(e);
             unref(func, term);
-            return exn_error();
+            return info->error->exn;
         }
         v = make_closure(func, ctx->local);
         unref(func, term);
@@ -1547,6 +1551,7 @@ static struct value *compile_concat(struct term *exp, struct ctx *ctx) {
         struct lens *l2 = v2->lens;
         v = lns_make_concat(ref(info), ref(l1), ref(l2), LNS_TYPE_CHECK(ctx));
     } else {
+        v = NULL;
         fatal_error(info, "Tried to concat a %s and a %s to yield a %s",
                     type_name(exp->left->type), type_name(exp->right->type),
                     type_name(t));
@@ -1700,6 +1705,7 @@ static int compile_test(struct term *term, struct ctx *ctx) {
 
     if (term->tr_tag == TR_EXN) {
         if (!EXN(actual)) {
+            print_info(stdout, term->info);
             printf("Test run should have produced exception, but produced\n");
             print_value(stdout, actual);
             printf("\n");
@@ -1733,7 +1739,7 @@ static int compile_test(struct term *term, struct ctx *ctx) {
             print_info(stdout, term->info);
             printf("\n");
             if (actual->tag == V_TREE) {
-                print_tree(stdout, 2, actual->origin->children);
+                print_tree_braces(stdout, 2, actual->origin->children);
             } else {
                 print_value(stdout, actual);
             }
@@ -1770,7 +1776,7 @@ static int compile_decl(struct term *term, struct ctx *ctx) {
             free(error->details);
             error->details = ms.buf;
         }
-        result = ! EXN(v);
+        result = !(EXN(v) || HAS_ERR(ctx->aug));
         unref(v, value);
         return result;
     } else if (term->tag == A_TEST) {
@@ -1960,7 +1966,11 @@ int load_module_file(struct augeas *aug, const char *filename) {
     struct term *term = NULL;
     int result = -1;
 
+    if (aug->flags & AUG_TRACE_MODULE_LOADING)
+        printf("Module %s", filename);
     augl_parse_file(aug, filename, &term);
+    if (aug->flags & AUG_TRACE_MODULE_LOADING)
+        printf(HAS_ERR(aug) ? " failed\n" : " loaded\n");
     ERR_BAIL(aug);
 
     if (! typecheck(term, aug))
@@ -2002,8 +2012,11 @@ static int load_module(struct augeas *aug, const char *name) {
 int interpreter_init(struct augeas *aug) {
     int r;
 
-    aug->modules = builtin_init(aug->error);
+    r = init_fatal_exn(aug->error);
+    if (r < 0)
+        return -1;
 
+    aug->modules = builtin_init(aug->error);
     if (aug->flags & AUG_NO_MODL_AUTOLOAD)
         return 0;
 
index 4c517de..0ede43e 100644 (file)
@@ -172,9 +172,6 @@ struct value {
     };
 };
 
-/* Return an exception value with error == 1 (and seen == 1) */
-struct value *exn_error(void);
-
 /* All types except for T_ARROW (functions) are simple. Subtype relations
  * for the simple types:
  *   T_STRING <: T_REGEXP
@@ -232,6 +229,9 @@ struct term *make_app_term(struct term *func, struct term *arg,
                            struct info *info);
 struct term *make_app_ident(char *id, struct term *func, struct info *info);
 
+/* Print a tree in the braces style used in modules */
+void print_tree_braces(FILE *out, int indent, struct tree *tree);
+
 /* Make an EXN value
  * Receive ownership of INFO
  *
index b36b944..1026912 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <fcntl.h>
 #include <unistd.h>
 #include <selinux/selinux.h>
 #include <stdbool.h>
@@ -141,6 +142,33 @@ static char *mtime_as_string(struct augeas *aug, const char *fname) {
     return NULL;
 }
 
+/* fnmatch(3) which will match // in a pattern to a path, like glob(3) does */
+static int fnmatch_normalize(const char *pattern, const char *string, int flags) {
+    int i, j, r;
+    char *pattern_norm = NULL;
+
+    r = ALLOC_N(pattern_norm, strlen(pattern) + 1);
+    if (r < 0)
+        goto error;
+
+    for (i = 0, j = 0; i < strlen(pattern); i++) {
+        if (pattern[i] != '/' || pattern[i+1] != '/') {
+            pattern_norm[j] = pattern[i];
+            j++;
+        }
+    }
+    pattern_norm[j] = 0;
+
+    r = fnmatch(pattern_norm, string, flags);
+    FREE(pattern_norm);
+    return r;
+
+ error:
+    if (pattern_norm != NULL)
+        FREE(pattern_norm);
+    return -1;
+}
+
 static bool file_current(struct augeas *aug, const char *fname,
                          struct tree *finfo) {
     struct tree *mtime = tree_child(finfo, s_mtime);
@@ -169,7 +197,7 @@ static bool file_current(struct augeas *aug, const char *fname,
     if (path == NULL)
         return false;
 
-    file = tree_find(aug, path->value);
+    file = tree_fpath(aug, path->value);
     return (file != NULL && ! file->dirty);
 }
 
@@ -179,6 +207,9 @@ static int filter_generate(struct tree *xfm, const char *root,
     int gl_flags = glob_flags;
     int r;
     int ret = 0;
+    char **pathv = NULL;
+    int pathc = 0;
+    int root_prefix = strlen(root) - 1;
 
     *nmatches = 0;
     *matches = NULL;
@@ -192,21 +223,19 @@ static int filter_generate(struct tree *xfm, const char *root,
         r = glob(globpat, gl_flags, NULL, &globbuf);
         free(globpat);
 
-        if (r != 0 && r != GLOB_NOMATCH) {
-            ret = -1;
+        if (r != 0 && r != GLOB_NOMATCH)
             goto error;
-        }
         gl_flags |= GLOB_APPEND;
     }
 
-    char **pathv = NULL;
-    int pathc = globbuf.gl_pathc, pathind = 0;
+    pathc = globbuf.gl_pathc;
+    int pathind = 0;
 
     if (ALLOC_N(pathv, pathc) < 0)
         goto error;
 
     for (int i=0; i < pathc; i++) {
-        const char *path = globbuf.gl_pathv[i];
+        const char *path = globbuf.gl_pathv[i] + root_prefix;
         bool include = true;
 
         list_for_each(e, xfm->children) {
@@ -215,9 +244,12 @@ static int filter_generate(struct tree *xfm, const char *root,
 
             if (strchr(e->value, SEP) == NULL)
                 path = pathbase(path);
-            if ((r = fnmatch(e->value, path, fnm_flags)) == 0) {
+
+            r = fnmatch_normalize(e->value, path, fnm_flags);
+            if (r < 0)
+                goto error;
+            else if (r == 0)
                 include = false;
-            }
         }
 
         if (include)
@@ -252,7 +284,7 @@ static int filter_generate(struct tree *xfm, const char *root,
 static int filter_matches(struct tree *xfm, const char *path) {
     int found = 0;
     list_for_each(f, xfm->children) {
-        if (is_incl(f) && fnmatch(f->value, path, fnm_flags) == 0) {
+        if (is_incl(f) && fnmatch_normalize(f->value, path, fnm_flags) == 0) {
             found = 1;
             break;
         }
@@ -260,7 +292,7 @@ static int filter_matches(struct tree *xfm, const char *path) {
     if (! found)
         return 0;
     list_for_each(f, xfm->children) {
-        if (is_excl(f) && (fnmatch(f->value, path, fnm_flags) == 0))
+        if (is_excl(f) && (fnmatch_normalize(f->value, path, fnm_flags) == 0))
             return 0;
     }
     return 1;
@@ -322,8 +354,9 @@ static void err_set(struct augeas *aug,
 }
 
 /* Record an error in the tree. The error will show up underneath
- * /augeas/FILENAME/error. PATH is the path to the toplevel node in the
- * tree where the lens application happened. When STATUS is NULL, just
+ * /augeas/FILENAME/error if filename is not NULL, and underneath
+ * /augeas/text/PATH otherwise. PATH is the path to the toplevel node in
+ * the tree where the lens application happened. When STATUS is NULL, just
  * clear any error associated with FILENAME in the tree.
  */
 static int store_error(struct augeas *aug,
@@ -335,10 +368,14 @@ static int store_error(struct augeas *aug,
     int r;
     int result = -1;
 
-    r = pathjoin(&fip, 2, AUGEAS_META_FILES, filename);
+    if (filename != NULL) {
+        r = pathjoin(&fip, 2, AUGEAS_META_FILES, filename);
+    } else {
+        r = pathjoin(&fip, 2, AUGEAS_META_TEXT, path);
+    }
     ERR_NOMEM(r < 0, aug);
 
-    finfo = tree_find_cr(aug, fip);
+    finfo = tree_fpath_cr(aug, fip);
     ERR_BAIL(aug);
 
     if (status != NULL) {
@@ -378,11 +415,8 @@ static int store_error(struct augeas *aug,
     } else {
         /* No error, nuke the error node if it exists */
         err_info = tree_child(finfo, s_error);
-        if (err_info != NULL) {
-            tree_unlink_children(aug, err_info);
-            pathx_symtab_remove_descendants(aug->symtab, err_info);
-            tree_unlink(err_info);
-        }
+        if (err_info != NULL)
+            tree_unlink(aug, err_info);
     }
 
     tree_clean(finfo);
@@ -402,7 +436,7 @@ static int store_error(struct augeas *aug,
  */
 static int add_file_info(struct augeas *aug, const char *node,
                          struct lens *lens, const char *lens_name,
-                         const char *filename) {
+                         const char *filename, bool force_reload) {
     struct tree *file, *tree;
     char *tmp = NULL;
     int r;
@@ -415,7 +449,7 @@ static int add_file_info(struct augeas *aug, const char *node,
     r = pathjoin(&path, 2, AUGEAS_META_TREE, node);
     ERR_NOMEM(r < 0, aug);
 
-    file = tree_find_cr(aug, path);
+    file = tree_fpath_cr(aug, path);
     ERR_BAIL(aug);
 
     /* Set 'path' */
@@ -425,8 +459,13 @@ static int add_file_info(struct augeas *aug, const char *node,
     ERR_NOMEM(r < 0, aug);
 
     /* Set 'mtime' */
-    tmp = mtime_as_string(aug, filename);
-    ERR_BAIL(aug);
+    if (force_reload) {
+        tmp = strdup("0");
+        ERR_NOMEM(tmp == NULL, aug);
+    } else {
+        tmp = mtime_as_string(aug, filename);
+        ERR_BAIL(aug);
+    }
     tree = tree_child_cr(file, s_mtime);
     ERR_NOMEM(tree == NULL, aug);
     tree_store_value(tree, &tmp);
@@ -476,11 +515,25 @@ static char *file_name_path(struct augeas *aug, const char *fname) {
     return path;
 }
 
+/* Replace the subtree for FPATH with SUB */
+static void tree_freplace(struct augeas *aug, const char *fpath,
+                         struct tree *sub) {
+    struct tree *parent;
+
+    parent = tree_fpath_cr(aug, fpath);
+    ERR_RET(aug);
+
+    tree_unlink_children(aug, parent);
+    list_append(parent->children, sub);
+    list_for_each(s, sub) {
+        s->parent = parent;
+    }
+}
+
 static int load_file(struct augeas *aug, struct lens *lens,
                      const char *lens_name, char *filename) {
     char *text = NULL;
     const char *err_status = NULL;
-    struct aug_file *file = NULL;
     struct tree *tree = NULL;
     char *path = NULL;
     struct lns_error *err = NULL;
@@ -490,7 +543,7 @@ static int load_file(struct augeas *aug, struct lens *lens,
     path = file_name_path(aug, filename);
     ERR_NOMEM(path == NULL, aug);
 
-    r = add_file_info(aug, path, lens, lens_name, filename);
+    r = add_file_info(aug, path, lens, lens_name, filename, false);
     if (r < 0)
         goto done;
 
@@ -524,7 +577,8 @@ static int load_file(struct augeas *aug, struct lens *lens,
         goto done;
     }
 
-    tree_replace(aug, path, tree);
+    tree_freplace(aug, path, tree);
+    ERR_BAIL(aug);
 
     /* top level node span entire file length */
     if (span != NULL && tree != NULL) {
@@ -543,7 +597,6 @@ static int load_file(struct augeas *aug, struct lens *lens,
     free_lns_error(err);
     free(path);
     free_tree(tree);
-    free(file);
     free(text);
     return result;
 }
@@ -576,6 +629,53 @@ static struct lens *lens_from_name(struct augeas *aug, const char *name) {
     return NULL;
 }
 
+int text_store(struct augeas *aug, const char *lens_path,
+               const char *path, const char *text) {
+    struct info *info = NULL;
+    struct lns_error *err = NULL;
+    struct tree *tree = NULL;
+    struct span *span = NULL;
+    int result = -1;
+    const char *err_status = NULL;
+    struct lens *lens = NULL;
+
+    lens = lens_from_name(aug, lens_path);
+    ERR_BAIL(aug);
+
+    make_ref(info);
+    info->first_line = 1;
+    info->last_line = 1;
+    info->first_column = 1;
+    info->last_column = strlen(text);
+
+    tree = lns_get(info, lens, text, &err);
+    if (err != NULL) {
+        err_status = "parse_failed";
+        goto error;
+    }
+
+    unref(info, info);
+
+    tree_freplace(aug, path, tree);
+    ERR_BAIL(aug);
+
+    /* top level node span entire file length */
+    if (span != NULL && tree != NULL) {
+        tree->parent->span = span;
+        tree->parent->span->span_start = 0;
+        tree->parent->span->span_end = strlen(text);
+    }
+
+    tree = NULL;
+
+    result = 0;
+ error:
+    store_error(aug, NULL, path, err_status, errno, err, text);
+    free_tree(tree);
+    free_lns_error(err);
+    return result;
+}
+
 const char *xfm_lens_name(struct tree *xfm) {
     struct tree *l = tree_child(xfm, s_lens);
 
@@ -602,7 +702,7 @@ static struct lens *xfm_lens(struct augeas *aug,
 }
 
 static void xfm_error(struct tree *xfm, const char *msg) {
-    char *v = strdup(msg);
+    char *v = msg ? strdup(msg) : NULL;
     char *l = strdup("error");
 
     if (l == NULL || v == NULL)
@@ -616,7 +716,8 @@ int transform_validate(struct augeas *aug, struct tree *xfm) {
     for (struct tree *t = xfm->children; t != NULL; ) {
         if (streqv(t->label, "lens")) {
             l = t;
-        } else if ((is_incl(t) || is_excl(t)) && t->value[0] != SEP) {
+        } else if ((is_incl(t) || (is_excl(t) && strchr(t->value, SEP) != NULL))
+                       && t->value[0] != SEP) {
             /* Normalize relative paths to absolute ones */
             int r;
             r = REALLOC_N(t->value, strlen(t->value) + 2);
@@ -628,7 +729,7 @@ int transform_validate(struct augeas *aug, struct tree *xfm) {
         if (streqv(t->label, "error")) {
             struct tree *del = t;
             t = del->next;
-            tree_unlink(del);
+            tree_unlink(aug, del);
         } else {
             t = t->next;
         }
@@ -659,7 +760,7 @@ void transform_file_error(struct augeas *aug, const char *status,
     va_list ap;
     int r;
 
-    err = tree_find_cr(aug, ep);
+    err = tree_fpath_cr(aug, ep);
     if (err == NULL)
         return;
 
@@ -687,7 +788,7 @@ static struct tree *file_info(struct augeas *aug, const char *fname) {
     r = pathjoin(&path, 2, AUGEAS_META_FILES, fname);
     ERR_NOMEM(r < 0, aug);
 
-    result = tree_find(aug, path);
+    result = tree_fpath(aug, path);
     ERR_BAIL(aug);
  error:
     free(path);
@@ -739,35 +840,38 @@ int transform_applies(struct tree *xfm, const char *path) {
     return filter_matches(xfm, path + strlen(AUGEAS_FILES_TREE));
 }
 
-static int transfer_file_attrs(const char *from, const char *to,
+static int transfer_file_attrs(FILE *from, FILE *to,
                                const char **err_status) {
     struct stat st;
     int ret = 0;
     int selinux_enabled = (is_selinux_enabled() > 0);
     security_context_t con = NULL;
 
-    ret = lstat(from, &st);
+    int from_fd = fileno(from);
+    int to_fd = fileno(to);
+
+    ret = fstat(from_fd, &st);
     if (ret < 0) {
         *err_status = "replace_stat";
         return -1;
     }
     if (selinux_enabled) {
-        if (lgetfilecon(from, &con) < 0 && errno != ENOTSUP) {
+        if (fgetfilecon(from_fd, &con) < 0 && errno != ENOTSUP) {
             *err_status = "replace_getfilecon";
             return -1;
         }
     }
 
-    if (lchown(to, st.st_uid, st.st_gid) < 0) {
+    if (fchown(to_fd, st.st_uid, st.st_gid) < 0) {
         *err_status = "replace_chown";
         return -1;
     }
-    if (chmod(to, st.st_mode) < 0) {
+    if (fchmod(to_fd, st.st_mode) < 0) {
         *err_status = "replace_chmod";
         return -1;
     }
     if (selinux_enabled && con != NULL) {
-        if (lsetfilecon(to, con) < 0 && errno != ENOTSUP) {
+        if (fsetfilecon(to_fd, con) < 0 && errno != ENOTSUP) {
             *err_status = "replace_setfilecon";
             return -1;
         }
@@ -781,14 +885,21 @@ static int transfer_file_attrs(const char *from, const char *to,
  * means that FROM or TO is a bindmounted file), and COPY_IF_RENAME_FAILS
  * is true, copy the contents of FROM into TO and delete FROM.
  *
+ * If COPY_IF_RENAME_FAILS and UNLINK_IF_RENAME_FAILS are true, and the above
+ * copy mechanism is used, it will unlink the TO path and open with O_EXCL
+ * to ensure we only copy *from* a bind mount rather than into an attacker's
+ * mount placed at TO (e.g. for .augsave).
+ *
  * Return 0 on success (either rename succeeded or we copied the contents
  * over successfully), -1 on failure.
  */
 static int clone_file(const char *from, const char *to,
-                      const char **err_status, int copy_if_rename_fails) {
+                      const char **err_status, int copy_if_rename_fails,
+                      int unlink_if_rename_fails) {
     FILE *from_fp = NULL, *to_fp = NULL;
     char buf[BUFSIZ];
     size_t len;
+    int to_fd = -1, to_oflags, r;
     int result = -1;
 
     if (rename(from, to) == 0)
@@ -799,18 +910,30 @@ static int clone_file(const char *from, const char *to,
     }
 
     /* rename not possible, copy file contents */
-    from_fp = fopen(from, "r");
     if (!(from_fp = fopen(from, "r"))) {
         *err_status = "clone_open_src";
         goto done;
     }
 
-    if (!(to_fp = fopen(to, "w"))) {
+    if (unlink_if_rename_fails) {
+        r = unlink(to);
+        if (r < 0) {
+            *err_status = "clone_unlink_dst";
+            goto done;
+        }
+    }
+
+    to_oflags = unlink_if_rename_fails ? O_EXCL : O_TRUNC;
+    if ((to_fd = open(to, O_WRONLY|O_CREAT|to_oflags, S_IRUSR|S_IWUSR)) < 0) {
         *err_status = "clone_open_dst";
         goto done;
     }
+    if (!(to_fp = fdopen(to_fd, "w"))) {
+        *err_status = "clone_fdopen_dst";
+        goto done;
+    }
 
-    if (transfer_file_attrs(from, to, err_status) < 0)
+    if (transfer_file_attrs(from_fp, to_fp, err_status) < 0)
         goto done;
 
     while ((len = fread(buf, 1, BUFSIZ, from_fp)) > 0) {
@@ -835,8 +958,15 @@ static int clone_file(const char *from, const char *to,
  done:
     if (from_fp != NULL)
         fclose(from_fp);
-    if (to_fp != NULL && fclose(to_fp) != 0)
+    if (to_fp != NULL) {
+        if (fclose(to_fp) != 0) {
+            *err_status = "clone_fclose_dst";
+            result = -1;
+        }
+    } else if (to_fd >= 0 && close(to_fd) < 0) {
+        *err_status = "clone_close_dst";
         result = -1;
+    }
     if (result != 0)
         unlink(to);
     if (result == 0)
@@ -887,19 +1017,38 @@ static int file_saved_event(struct augeas *aug, const char *path) {
  * are noted in the /augeas/files hierarchy in AUG->ORIGIN under
  * PATH/error.
  *
- * Writing the file happens by first writing into PATH.augnew, transferring
- * all file attributes of PATH to PATH.augnew, and then renaming
- * PATH.augnew to PATH. If the rename fails, and the entry
- * AUGEAS_COPY_IF_FAILURE exists in AUG->ORIGIN, PATH is overwritten by
- * copying file contents
+ * Writing the file happens by first writing into a temp file, transferring all
+ * file attributes of PATH to the temp file, and then renaming the temp file
+ * back to PATH.
+ *
+ * Temp files are created alongside the destination file to enable the rename,
+ * which may be the canonical path (PATH_canon) if PATH is a symlink.
+ *
+ * If the AUG_SAVE_NEWFILE flag is set, instead rename to PATH.augnew rather
+ * than PATH.  If AUG_SAVE_BACKUP is set, move the original to PATH.augsave.
+ * (Always PATH.aug{new,save} irrespective of whether PATH is a symlink.)
+ *
+ * If the rename fails, and the entry AUGEAS_COPY_IF_FAILURE exists in
+ * AUG->ORIGIN, PATH is instead overwritten by copying file contents.
+ *
+ * The table below shows the locations for each permutation.
+ *
+ * PATH       save flag    temp file           dest file      backup?
+ * regular    -            PATH.XXXX           PATH           -
+ * regular    BACKUP       PATH.XXXX           PATH           PATH.augsave
+ * regular    NEWFILE      PATH.augnew.XXXX    PATH.augnew    -
+ * symlink    -            PATH_canon.XXXX     PATH_canon     -
+ * symlink    BACKUP       PATH_canon.XXXX     PATH_canon     PATH.augsave
+ * symlink    NEWFILE      PATH.augnew.XXXX    PATH.augnew    -
  *
  * Return 0 on success, -1 on failure.
  */
 int transform_save(struct augeas *aug, struct tree *xfm,
                    const char *path, struct tree *tree) {
-    FILE *fp = NULL;
-    char *augnew = NULL, *augorig = NULL, *augsave = NULL;
-    char *augorig_canon = NULL;
+    int   fd;
+    FILE *fp = NULL, *augorig_canon_fp = NULL;
+    char *augtemp = NULL, *augnew = NULL, *augorig = NULL, *augsave = NULL;
+    char *augorig_canon = NULL, *augdest = NULL;
     int   augorig_exists;
     int   copy_if_rename_fails = 0;
     char *text = NULL;
@@ -910,6 +1059,7 @@ int transform_save(struct augeas *aug, struct tree *xfm,
     const char *lens_name;
     struct lens *lens = xfm_lens(aug, xfm, &lens_name);
     int result = -1, r;
+    bool force_reload;
 
     errno = 0;
 
@@ -926,19 +1076,6 @@ int transform_save(struct augeas *aug, struct tree *xfm,
         goto done;
     }
 
-    if (access(augorig, R_OK) == 0) {
-        text = xread_file(augorig);
-    } else {
-        text = strdup("");
-    }
-
-    if (text == NULL) {
-        err_status = "put_read";
-        goto done;
-    }
-
-    text = append_newline(text, strlen(text));
-
     augorig_canon = canonicalize_file_name(augorig);
     augorig_exists = 1;
     if (augorig_canon == NULL) {
@@ -951,56 +1088,88 @@ int transform_save(struct augeas *aug, struct tree *xfm,
         }
     }
 
-    /* Figure out where to put the .augnew file. If we need to rename it
-       later on, put it next to augorig_canon */
+    if (access(augorig_canon, R_OK) == 0) {
+        augorig_canon_fp = fopen(augorig_canon, "r");
+        text = xfread_file(augorig_canon_fp);
+    } else {
+        text = strdup("");
+    }
+
+    if (text == NULL) {
+        err_status = "put_read";
+        goto done;
+    }
+
+    text = append_newline(text, strlen(text));
+
+    /* Figure out where to put the .augnew and temp file. If no .augnew file
+       then put the temp file next to augorig_canon, else next to .augnew. */
     if (aug->flags & AUG_SAVE_NEWFILE) {
         if (xasprintf(&augnew, "%s" EXT_AUGNEW, augorig) < 0) {
             err_status = "augnew_oom";
             goto done;
         }
+        augdest = augnew;
     } else {
-        if (xasprintf(&augnew, "%s" EXT_AUGNEW, augorig_canon) < 0) {
-            err_status = "augnew_oom";
-            goto done;
-        }
+        augdest = augorig_canon;
+    }
+
+    if (xasprintf(&augtemp, "%s.XXXXXX", augdest) < 0) {
+        err_status = "augtemp_oom";
+        goto done;
     }
 
     // FIXME: We might have to create intermediate directories
     // to be able to write augnew, but we have no idea what permissions
     // etc. they should get. Just the process default ?
-    fp = fopen(augnew, "w");
+    fd = mkstemp(augtemp);
+    if (fd < 0) {
+        err_status = "mk_augtemp";
+        goto done;
+    }
+    fp = fdopen(fd, "w");
     if (fp == NULL) {
-        err_status = "open_augnew";
+        err_status = "open_augtemp";
         goto done;
     }
 
     if (augorig_exists) {
-        if (transfer_file_attrs(augorig_canon, augnew, &err_status) != 0) {
+        if (transfer_file_attrs(augorig_canon_fp, fp, &err_status) != 0) {
             err_status = "xfer_attrs";
             goto done;
         }
+    } else {
+        /* Since mkstemp is used, the temp file will have secure permissions
+         * instead of those implied by umask, so change them for new files */
+        mode_t curumsk = umask(022);
+        umask(curumsk);
+
+        if (fchmod(fileno(fp), 0666 & ~curumsk) < 0) {
+            err_status = "create_chmod";
+            return -1;
+        }
     }
 
     if (tree != NULL)
         lns_put(fp, lens, tree->children, text, &err);
 
     if (ferror(fp)) {
-        err_status = "error_augnew";
+        err_status = "error_augtemp";
         goto done;
     }
 
     if (fflush(fp) != 0) {
-        err_status = "flush_augnew";
+        err_status = "flush_augtemp";
         goto done;
     }
 
     if (fsync(fileno(fp)) < 0) {
-        err_status = "sync_augnew";
+        err_status = "sync_augtemp";
         goto done;
     }
 
     if (fclose(fp) != 0) {
-        err_status = "close_augnew";
+        err_status = "close_augtemp";
         fp = NULL;
         goto done;
     }
@@ -1008,56 +1177,58 @@ int transform_save(struct augeas *aug, struct tree *xfm,
     fp = NULL;
 
     if (err != NULL) {
-        err_status = "put_failed";
-        unlink(augnew);
+        err_status = err->pos >= 0 ? "parse_skel_failed" : "put_failed";
+        unlink(augtemp);
         goto done;
     }
 
     {
-        char *new_text = xread_file(augnew);
+        char *new_text = xread_file(augtemp);
         int same = 0;
         if (new_text == NULL) {
-            err_status = "read_augnew";
+            err_status = "read_augtemp";
             goto done;
         }
         same = STREQ(text, new_text);
         FREE(new_text);
         if (same) {
             result = 0;
-            unlink(augnew);
+            unlink(augtemp);
             goto done;
         } else if (aug->flags & AUG_SAVE_NOOP) {
             result = 1;
-            unlink(augnew);
+            unlink(augtemp);
             goto done;
         }
     }
 
     if (!(aug->flags & AUG_SAVE_NEWFILE)) {
         if (augorig_exists && (aug->flags & AUG_SAVE_BACKUP)) {
-            r = asprintf(&augsave, "%s%s" EXT_AUGSAVE, aug->root, filename);
+            r = xasprintf(&augsave, "%s" EXT_AUGSAVE, augorig);
             if (r == -1) {
                 augsave = NULL;
                 goto done;
             }
 
-            r = clone_file(augorig_canon, augsave, &err_status, 1);
+            r = clone_file(augorig_canon, augsave, &err_status, 1, 1);
             if (r != 0) {
                 dyn_err_status = strappend(err_status, "_augsave");
                 goto done;
             }
         }
-        r = clone_file(augnew, augorig_canon, &err_status,
-                       copy_if_rename_fails);
-        if (r != 0) {
-            dyn_err_status = strappend(err_status, "_augnew");
-            goto done;
-        }
     }
+
+    r = clone_file(augtemp, augdest, &err_status, copy_if_rename_fails, 0);
+    if (r != 0) {
+        dyn_err_status = strappend(err_status, "_augtemp");
+        goto done;
+    }
+
     result = 1;
 
  done:
-    r = add_file_info(aug, path, lens, lens_name, augorig);
+    force_reload = aug->flags & AUG_SAVE_NEWFILE;
+    r = add_file_info(aug, path, lens, lens_name, augorig, force_reload);
     if (r < 0) {
         err_status = "file_info";
         result = -1;
@@ -1072,11 +1243,12 @@ int transform_save(struct augeas *aug, struct tree *xfm,
     {
         const char *emsg =
             dyn_err_status == NULL ? err_status : dyn_err_status;
-        store_error(aug, filename, path, emsg, errno, err, NULL);
+        store_error(aug, filename, path, emsg, errno, err, text);
     }
     free(dyn_err_status);
     lens_release(lens);
     free(text);
+    free(augtemp);
     free(augnew);
     if (augorig_canon != augorig)
         free(augorig_canon);
@@ -1086,6 +1258,74 @@ int transform_save(struct augeas *aug, struct tree *xfm,
 
     if (fp != NULL)
         fclose(fp);
+    if (augorig_canon_fp != NULL)
+        fclose(augorig_canon_fp);
+    return result;
+}
+
+int text_retrieve(struct augeas *aug, const char *lens_name,
+                  const char *path, struct tree *tree,
+                  const char *text_in, char **text_out) {
+    struct memstream ms;
+    bool ms_open = false;
+    const char *err_status = NULL;
+    char *dyn_err_status = NULL;
+    struct lns_error *err = NULL;
+    struct lens *lens = NULL;
+    int result = -1, r;
+
+    MEMZERO(&ms, 1);
+    errno = 0;
+
+    lens = lens_from_name(aug, lens_name);
+    if (lens == NULL) {
+        err_status = "lens_name";
+        goto done;
+    }
+
+    r = init_memstream(&ms);
+    if (r < 0) {
+        err_status = "init_memstream";
+        goto done;
+    }
+    ms_open = true;
+
+    if (tree != NULL)
+        lns_put(ms.stream, lens, tree->children, text_in, &err);
+
+    r = close_memstream(&ms);
+    ms_open = false;
+    if (r < 0) {
+        err_status = "close_memstream";
+        goto done;
+    }
+
+    *text_out = ms.buf;
+    ms.buf = NULL;
+
+    if (err != NULL) {
+        err_status = err->pos >= 0 ? "parse_skel_failed" : "put_failed";
+        goto done;
+    }
+
+    result = 0;
+
+ done:
+    {
+        const char *emsg =
+            dyn_err_status == NULL ? err_status : dyn_err_status;
+        store_error(aug, NULL, path, emsg, errno, err, text_in);
+    }
+    free(dyn_err_status);
+    lens_release(lens);
+    if (result < 0) {
+        free(*text_out);
+        *text_out = NULL;
+    }
+    free_lns_error(err);
+
+    if (ms_open)
+        close_memstream(&ms);
     return result;
 }
 
@@ -1136,7 +1376,7 @@ int remove_file(struct augeas *aug, struct tree *tree) {
                 goto error;
         }
 
-        r = clone_file(augorig_canon, augsave, &err_status, 1);
+        r = clone_file(augorig_canon, augsave, &err_status, 1, 1);
         if (r != 0) {
             dyn_err_status = strappend(err_status, "_augsave");
             goto error;
@@ -1149,7 +1389,7 @@ int remove_file(struct augeas *aug, struct tree *tree) {
             goto error;
         }
     }
-    tree_unlink(tree);
+    tree_unlink(aug, tree);
  done:
     free(path);
     free(augorig);
index 5bb1e7e..7f100f5 100644 (file)
@@ -80,6 +80,18 @@ int transform_applies(struct tree *xfm, const char *path);
 int transform_save(struct augeas *aug, struct tree *xfm,
                    const char *path, struct tree *tree);
 
+/* Transform TEXT into a tree and store it at PATH
+ */
+int text_store(struct augeas *aug, const char *lens_name,
+               const char *path, const char *text);
+
+/* Transform the tree at PATH back into TEXT_OUT, assuming TEXT_IN was
+ * used to initially generate the tree
+ */
+int text_retrieve(struct augeas *aug, const char *lens_name,
+                  const char *path, struct tree *tree,
+                  const char *text_in, char **text_out);
+
 /* Remove the file for TREE, either by moving it to a .augsave file or by
  * unlinking it, depending on aug->flags. TREE must be the node underneath
  * /augeas/files corresponding to the file to be removed.
diff --git a/src/try b/src/try
index 12ffb62..18a0123 100755 (executable)
--- a/src/try
+++ b/src/try
@@ -17,14 +17,16 @@ match /augeas/version
 EOF
 fi
 
-cat > $GDBCMDS <<EOF
-set annotate 3
+if [[ ! -f $GDBCMDS ]] ; then
+    cat > $GDBCMDS <<EOF
 run --nostdinc -I $AUGEAS_LENS_LIB -r $AUGEAS_ROOT < $AUGCMDS
 EOF
+fi
 
 cd $topdir/src
 if [[ "x$1" == "xgdb" ]] ; then
-    libtool --mode=execute gdb -x $GDBCMDS ./augtool
+    [[ -n "$EMACS" ]] && int="-i=mi"
+    exec libtool --mode=execute gdb $int -x $GDBCMDS ./augtool
 elif [[ "x$1" == "xstrace" ]] ; then
     libtool --mode=execute /usr/bin/strace ./augtool --nostdinc < $AUGCMDS
 elif [[ "x$1" == "xvalgrind" ]] ; then
index 817f368..079cd76 100644 (file)
@@ -4,29 +4,52 @@ GNULIB_CFLAGS= -I $(top_srcdir)/gnulib/lib
 AM_CFLAGS = $(AUGEAS_CFLAGS) $(WARN_CFLAGS) $(GNULIB_CFLAGS) \
         $(LIBXML_CFLAGS) -I $(top_builddir)/src
 
+VALGRIND=libtool --mode=execute valgrind --quiet --leak-check=full
 valgrind:
        make check \
-         VALGRIND="libtool --mode=execute valgrind --quiet --leak-check=full" \
+         VALGRIND="$(VALGRIND)" \
          AUGPARSE=$(abs_top_builddir)/src/augparse \
          AUGTOOL=$(abs_top_builddir)/src/augtool
-       libtool --mode=execute valgrind --quiet --leak-check=full ./fatest
+       $(VALGRIND) ./fatest
+
+valgrind-leak: leak
+       $(TESTS_ENVIRONMENT) $(VALGRIND) ./leak
 
 lens_tests =                   \
   lens-sudoers.sh              \
   lens-access.sh               \
+  lens-activemq_conf.sh                \
+  lens-activemq_xml.sh         \
   lens-aliases.sh              \
+  lens-anacron.sh              \
   lens-approx.sh               \
+  lens-apt_update_manager.sh           \
+  lens-aptcacherngsecurity.sh          \
   lens-aptpreferences.sh       \
   lens-aptconf.sh      \
   lens-aptsource.sh            \
+  lens-authorized_keys.sh      \
+  lens-automaster.sh   \
+  lens-automounter.sh  \
+  lens-avahi.sh        \
   lens-backuppchosts.sh                \
   lens-bbhosts.sh              \
+  lens-bootconf.sh             \
+  lens-build.sh                \
+  lens-cachefilesd.sh          \
+  lens-carbon.sh       \
   lens-cgconfig.sh             \
   lens-cgrules.sh              \
+  lens-channels.sh             \
+  lens-chrony.sh               \
   lens-cobblersettings.sh      \
   lens-cobblermodules.sh       \
+  lens-collectd.sh     \
+  lens-cpanel.sh       \
   lens-cron.sh                 \
   lens-crypttab.sh             \
+  lens-cyrus_imapd.sh          \
+  lens-cups.sh         \
   lens-darkice.sh              \
   lens-debctrl.sh              \
   lens-desktop.sh      \
@@ -34,50 +57,82 @@ lens_tests =                        \
   lens-dhclient.sh             \
   lens-dhcpd.sh                \
   lens-dnsmasq.sh              \
+  lens-dovecot.sh              \
   lens-dpkg.sh                 \
   lens-dput.sh                 \
+  lens-erlang.sh               \
   lens-ethers.sh               \
   lens-exports.sh              \
   lens-fai_diskconfig.sh       \
+  lens-fonts.sh        \
   lens-fstab.sh                        \
+  lens-fuse.sh                 \
   lens-gdm.sh                  \
   lens-group.sh                        \
+  lens-gshadow.sh                      \
+  lens-gtkbookmarks.sh                 \
   lens-json.sh          \
   lens-hostname.sh                     \
   lens-hosts.sh                        \
   lens-hosts_access.sh                 \
   lens-host_conf.sh                    \
+  lens-htpasswd.sh         \
   lens-httpd.sh         \
   lens-inetd.sh         \
   lens-inifile.sh              \
   lens-inittab.sh              \
+  lens-inputrc.sh              \
   lens-interfaces.sh           \
   lens-iptables.sh             \
+  lens-iproute2.sh             \
+  lens-jettyrealm.sh           \
+  lens-jmxaccess.sh            \
+  lens-jmxpassword.sh          \
   lens-kdump.sh                        \
   lens-keepalived.sh   \
+  lens-known_hosts.sh  \
+  lens-koji.sh                 \
   lens-krb5.sh                 \
+  lens-jaas.sh          \
   lens-ldap.sh                 \
+  lens-ldif.sh                 \
+  lens-ldso.sh                 \
+  lens-lightdm.sh              \
   lens-limits.sh               \
   lens-login_defs.sh   \
   lens-logrotate.sh            \
+  lens-logwatch.sh             \
   lens-lokkit.sh               \
+  lens-lvm.sh                  \
+  lens-mcollective.sh  \
   lens-mdadm_conf.sh   \
+  lens-memcached.sh            \
   lens-mke2fs.sh               \
   lens-modprobe.sh             \
   lens-modules.sh              \
   lens-modules_conf.sh \
+  lens-mongodbserver.sh                \
   lens-monit.sh                        \
   lens-multipath.sh     \
   lens-mysql.sh                        \
   lens-nagioscfg.sh     \
   lens-nagiosobjects.sh     \
+  lens-netmasks.sh     \
+  lens-networkmanager.sh     \
   lens-networks.sh     \
+  lens-nginx.sh     \
   lens-ntp.sh                  \
+  lens-ntpd.sh                 \
   lens-nrpe.sh          \
   lens-nsswitch.sh             \
   lens-odbc.sh          \
+  lens-openshift_config.sh     \
+  lens-openshift_http.sh       \
+  lens-openshift_quickstarts.sh        \
   lens-openvpn.sh              \
+  lens-pagekite.sh             \
   lens-pam.sh                  \
+  lens-pamconf.sh              \
   lens-passwd.sh               \
   lens-pbuilder.sh             \
   lens-pg_hba.sh               \
@@ -86,37 +141,67 @@ lens_tests =                       \
   lens-postfix_access.sh \
   lens-postfix_main.sh         \
   lens-postfix_master.sh       \
+  lens-postfix_transport.sh    \
+  lens-postfix_virtual.sh      \
+  lens-postgresql.sh \
   lens-properties.sh    \
+  lens-protocols.sh    \
   lens-puppet.sh               \
+  lens-puppet_auth.sh          \
   lens-puppetfileserver.sh             \
+  lens-pythonpaste.sh  \
+  lens-qpid.sh         \
+  lens-quote.sh                \
+  lens-rabbitmq.sh             \
+  lens-redis.sh                \
   lens-reprepro_uploaders.sh           \
   lens-resolv.sh               \
+  lens-rmt.sh                  \
   lens-rsyncd.sh               \
+  lens-rsyslog.sh              \
   lens-rx.sh                   \
   lens-samba.sh                        \
   lens-securetty.sh     \
   lens-services.sh             \
+  lens-shadow.sh               \
   lens-shells.sh               \
   lens-shellvars.sh            \
   lens-shellvars_list.sh       \
+  lens-simplelines.sh  \
+  lens-simplevars.sh   \
+  lens-sip_conf.sh         \
   lens-slapd.sh                        \
+  lens-smbusers.sh                     \
   lens-solaris_system.sh               \
   lens-soma.sh                 \
   lens-spacevars.sh            \
+  lens-splunk.sh               \
   lens-squid.sh                        \
   lens-ssh.sh                  \
   lens-sshd.sh                 \
+  lens-sssd.sh                 \
   lens-stunnel.sh                      \
+  lens-subversion.sh           \
   lens-sysconfig.sh            \
+  lens-sysconfig_route.sh              \
   lens-syslog.sh               \
   lens-sysctl.sh               \
+  lens-systemd.sh              \
+  lens-thttpd.sh               \
+  lens-tuned.sh                        \
+  lens-up2date.sh              \
+  lens-updatedb.sh             \
   lens-util.sh         \
+  lens-vfstab.sh               \
+  lens-vmware_config.sh                \
   lens-vsftpd.sh               \
   lens-webmin.sh               \
   lens-wine.sh                 \
   lens-xinetd.sh               \
   lens-xml.sh                  \
   lens-xorg.sh                 \
+  lens-xymon.sh                        \
+  lens-xymon_alerting.sh \
   lens-grub.sh                 \
   lens-schroot.sh                      \
   lens-xendconfsxp.sh  \
@@ -151,8 +236,10 @@ check_SCRIPTS = \
   test-interpreter.sh \
   $(lens_tests) \
   test-get.sh test-augtool.sh \
-  test-put-symlink.sh test-save-empty.sh \
-  test-bug-1.sh test-idempotent.sh test-preserve.sh \
+  test-put-symlink.sh test-put-symlink-augnew.sh \
+  test-put-symlink-augsave.sh test-put-symlink-augtemp.sh \
+  test-put-mount.sh test-put-mount-augnew.sh test-put-mount-augsave.sh \
+  test-save-empty.sh test-bug-1.sh test-idempotent.sh test-preserve.sh \
   test-events-saved.sh test-save-mode.sh test-unlink-error.sh \
   test-augtool-empty-line.sh test-augtool-modify-root.sh
 
@@ -162,6 +249,8 @@ EXTRA_DIST = \
 
 noinst_SCRIPTS = $(check_SCRIPTS)
 
+noinst_PROGRAMS = leak
+
 check_PROGRAMS = fatest test-xpath test-load test-save test-api test-run
 
 TESTS_ENVIRONMENT = \
@@ -175,9 +264,9 @@ TESTS = $(check_SCRIPTS) $(check_PROGRAMS)
 INCLUDES = -I$(top_srcdir)/src
 
 fatest_SOURCES = fatest.c cutest.c cutest.h $(top_srcdir)/src/memory.c $(top_srcdir)/src/memory.h
-fatest_LDADD = $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
+fatest_LDADD = $(top_builddir)/src/libfa.la $(LIBXML_LIBS) $(GNULIB)
 
-test_xpath_SOURCES = test-xpath.c $(top_srcdir)/src/memory.c
+test_xpath_SOURCES = test-xpath.c cutest.c cutest.h $(top_srcdir)/src/memory.c
 test_xpath_LDADD = $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
 
 test_load_SOURCES = test-load.c cutest.c cutest.h $(top_srcdir)/src/memory.c $(top_srcdir)/src/memory.h
@@ -192,6 +281,9 @@ test_api_LDADD = $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
 test_run_SOURCES = test-run.c cutest.c cutest.h $(top_srcdir)/src/memory.c $(top_srcdir)/src/memory.h
 test_run_LDADD = $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
 
+leak_SOURCES = leak.c
+leak_LDADD =  $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
+
 FAILMALLOC_START ?= 1
 FAILMALLOC_REP   ?= 20
 FAILMALLOC_PROG ?= ./fatest
index a78da2c..da69073 100644 (file)
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in 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.
 # FAILMALLOC_REP   - how often to repeat with increasing FAILMALLOC_INTERVAL
 # FAILMALLOC_PROG  - the program to run with linfailmalloc preloaded
 
+
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -42,11 +87,13 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
+noinst_PROGRAMS = leak$(EXEEXT)
 check_PROGRAMS = fatest$(EXEEXT) test-xpath$(EXEEXT) \
        test-load$(EXEEXT) test-save$(EXEEXT) test-api$(EXEEXT) \
        test-run$(EXEEXT)
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-       $(top_srcdir)/Makefile.inc
+DIST_COMMON = $(top_srcdir)/Makefile.inc $(srcdir)/Makefile.in \
+       $(srcdir)/Makefile.am $(top_srcdir)/build/ac-aux/depcomp \
+       $(top_srcdir)/build/ac-aux/test-driver
 subdir = tests
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
@@ -54,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/argz.m4 \
        $(top_srcdir)/gnulib/m4/btowc.m4 \
        $(top_srcdir)/gnulib/m4/canonicalize.m4 \
+       $(top_srcdir)/gnulib/m4/close.m4 \
        $(top_srcdir)/gnulib/m4/codeset.m4 \
        $(top_srcdir)/gnulib/m4/configmake.m4 \
        $(top_srcdir)/gnulib/m4/ctype.m4 \
@@ -62,24 +110,33 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/eealloc.m4 \
        $(top_srcdir)/gnulib/m4/environ.m4 \
        $(top_srcdir)/gnulib/m4/errno_h.m4 \
+       $(top_srcdir)/gnulib/m4/exponentd.m4 \
        $(top_srcdir)/gnulib/m4/extensions.m4 \
        $(top_srcdir)/gnulib/m4/fcntl-o.m4 \
        $(top_srcdir)/gnulib/m4/fcntl_h.m4 \
+       $(top_srcdir)/gnulib/m4/fdopen.m4 \
        $(top_srcdir)/gnulib/m4/float_h.m4 \
        $(top_srcdir)/gnulib/m4/fnmatch.m4 \
+       $(top_srcdir)/gnulib/m4/fpieee.m4 \
+       $(top_srcdir)/gnulib/m4/fstat.m4 \
+       $(top_srcdir)/gnulib/m4/getcwd.m4 \
        $(top_srcdir)/gnulib/m4/getdelim.m4 \
        $(top_srcdir)/gnulib/m4/getline.m4 \
        $(top_srcdir)/gnulib/m4/getopt.m4 \
        $(top_srcdir)/gnulib/m4/getpagesize.m4 \
+       $(top_srcdir)/gnulib/m4/gettimeofday.m4 \
        $(top_srcdir)/gnulib/m4/glibc21.m4 \
        $(top_srcdir)/gnulib/m4/gnulib-common.m4 \
        $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \
        $(top_srcdir)/gnulib/m4/include_next.m4 \
        $(top_srcdir)/gnulib/m4/intlmacosx.m4 \
        $(top_srcdir)/gnulib/m4/intmax_t.m4 \
+       $(top_srcdir)/gnulib/m4/inttypes-pri.m4 \
+       $(top_srcdir)/gnulib/m4/inttypes.m4 \
        $(top_srcdir)/gnulib/m4/inttypes_h.m4 \
        $(top_srcdir)/gnulib/m4/isblank.m4 \
        $(top_srcdir)/gnulib/m4/langinfo_h.m4 \
+       $(top_srcdir)/gnulib/m4/largefile.m4 \
        $(top_srcdir)/gnulib/m4/lcmessage.m4 \
        $(top_srcdir)/gnulib/m4/lib-ld.m4 \
        $(top_srcdir)/gnulib/m4/lib-link.m4 \
@@ -91,6 +148,7 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/locale-tr.m4 \
        $(top_srcdir)/gnulib/m4/locale-zh.m4 \
        $(top_srcdir)/gnulib/m4/locale_h.m4 \
+       $(top_srcdir)/gnulib/m4/localeconv.m4 \
        $(top_srcdir)/gnulib/m4/localename.m4 \
        $(top_srcdir)/gnulib/m4/lock.m4 \
        $(top_srcdir)/gnulib/m4/longlong.m4 \
@@ -108,15 +166,21 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/mbtowc.m4 \
        $(top_srcdir)/gnulib/m4/memchr.m4 \
        $(top_srcdir)/gnulib/m4/mempcpy.m4 \
+       $(top_srcdir)/gnulib/m4/mkstemp.m4 \
        $(top_srcdir)/gnulib/m4/mmap-anon.m4 \
        $(top_srcdir)/gnulib/m4/mode_t.m4 \
+       $(top_srcdir)/gnulib/m4/msvc-inval.m4 \
+       $(top_srcdir)/gnulib/m4/msvc-nothrow.m4 \
        $(top_srcdir)/gnulib/m4/multiarch.m4 \
        $(top_srcdir)/gnulib/m4/nl_langinfo.m4 \
+       $(top_srcdir)/gnulib/m4/nocrash.m4 \
+       $(top_srcdir)/gnulib/m4/off_t.m4 \
        $(top_srcdir)/gnulib/m4/onceonly.m4 \
        $(top_srcdir)/gnulib/m4/open.m4 \
        $(top_srcdir)/gnulib/m4/pathmax.m4 \
        $(top_srcdir)/gnulib/m4/printf.m4 \
        $(top_srcdir)/gnulib/m4/putenv.m4 \
+       $(top_srcdir)/gnulib/m4/rawmemchr.m4 \
        $(top_srcdir)/gnulib/m4/readlink.m4 \
        $(top_srcdir)/gnulib/m4/realloc.m4 \
        $(top_srcdir)/gnulib/m4/regex.m4 \
@@ -136,13 +200,18 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
        $(top_srcdir)/gnulib/m4/stdlib_h.m4 \
        $(top_srcdir)/gnulib/m4/stpcpy.m4 \
        $(top_srcdir)/gnulib/m4/stpncpy.m4 \
+       $(top_srcdir)/gnulib/m4/strchrnul.m4 \
        $(top_srcdir)/gnulib/m4/string_h.m4 \
        $(top_srcdir)/gnulib/m4/strndup.m4 \
        $(top_srcdir)/gnulib/m4/strnlen.m4 \
        $(top_srcdir)/gnulib/m4/strstr.m4 \
        $(top_srcdir)/gnulib/m4/symlink.m4 \
+       $(top_srcdir)/gnulib/m4/sys_socket_h.m4 \
        $(top_srcdir)/gnulib/m4/sys_stat_h.m4 \
+       $(top_srcdir)/gnulib/m4/sys_time_h.m4 \
+       $(top_srcdir)/gnulib/m4/sys_types_h.m4 \
        $(top_srcdir)/gnulib/m4/sys_wait_h.m4 \
+       $(top_srcdir)/gnulib/m4/tempname.m4 \
        $(top_srcdir)/gnulib/m4/thread.m4 \
        $(top_srcdir)/gnulib/m4/threadlib.m4 \
        $(top_srcdir)/gnulib/m4/time_h.m4 \
@@ -166,14 +235,20 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
 am_fatest_OBJECTS = fatest.$(OBJEXT) cutest.$(OBJEXT) memory.$(OBJEXT)
 fatest_OBJECTS = $(am_fatest_OBJECTS)
 am__DEPENDENCIES_1 =
-fatest_DEPENDENCIES = $(top_builddir)/src/libaugeas.la \
+fatest_DEPENDENCIES = $(top_builddir)/src/libfa.la \
        $(am__DEPENDENCIES_1) $(GNULIB)
-AM_V_lt = $(am__v_lt_$(V))
-am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+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 = 
+am_leak_OBJECTS = leak.$(OBJEXT)
+leak_OBJECTS = $(am_leak_OBJECTS)
+leak_DEPENDENCIES = $(top_builddir)/src/libaugeas.la \
+       $(am__DEPENDENCIES_1) $(GNULIB)
 am_test_api_OBJECTS = test-api.$(OBJEXT) cutest.$(OBJEXT) \
        memory.$(OBJEXT)
 test_api_OBJECTS = $(am_test_api_OBJECTS)
@@ -194,13 +269,26 @@ am_test_save_OBJECTS = test-save.$(OBJEXT) cutest.$(OBJEXT) \
 test_save_OBJECTS = $(am_test_save_OBJECTS)
 test_save_DEPENDENCIES = $(top_builddir)/src/libaugeas.la \
        $(am__DEPENDENCIES_1) $(GNULIB)
-am_test_xpath_OBJECTS = test-xpath.$(OBJEXT) memory.$(OBJEXT)
+am_test_xpath_OBJECTS = test-xpath.$(OBJEXT) cutest.$(OBJEXT) \
+       memory.$(OBJEXT)
 test_xpath_OBJECTS = $(am_test_xpath_OBJECTS)
 test_xpath_DEPENDENCIES = $(top_builddir)/src/libaugeas.la \
        $(am__DEPENDENCIES_1) $(GNULIB)
 SCRIPTS = $(noinst_SCRIPTS)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/build/aux/depcomp
+depcomp = $(SHELL) $(top_srcdir)/build/ac-aux/depcomp
 am__depfiles_maybe = depfiles
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -209,43 +297,69 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
        $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
        $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_$(V))
-am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
-am__v_CC_0 = @echo "  CC    " $@;
-AM_V_at = $(am__v_at_$(V))
-am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
-am__v_at_0 = @
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_$(V))
-am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
-am__v_CCLD_0 = @echo "  CCLD  " $@;
-AM_V_GEN = $(am__v_GEN_$(V))
-am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
-am__v_GEN_0 = @echo "  GEN   " $@;
-SOURCES = $(fatest_SOURCES) $(test_api_SOURCES) $(test_load_SOURCES) \
-       $(test_run_SOURCES) $(test_save_SOURCES) $(test_xpath_SOURCES)
-DIST_SOURCES = $(fatest_SOURCES) $(test_api_SOURCES) \
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = $(fatest_SOURCES) $(leak_SOURCES) $(test_api_SOURCES) \
+       $(test_load_SOURCES) $(test_run_SOURCES) $(test_save_SOURCES) \
+       $(test_xpath_SOURCES)
+DIST_SOURCES = $(fatest_SOURCES) $(leak_SOURCES) $(test_api_SOURCES) \
        $(test_load_SOURCES) $(test_run_SOURCES) $(test_save_SOURCES) \
        $(test_xpath_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)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
-# If stdout is a non-dumb tty, use colors.  If test -t is not supported,
-# then this fails; a conservative approach.  Of course do not redirect
-# stdout here, just stderr.
-am__tty_colors = \
-red=; grn=; lgn=; blu=; std=; \
-test "X$(AM_COLOR_TESTS)" != Xno \
-&& test "X$$TERM" != Xdumb \
-&& { test "X$(AM_COLOR_TESTS)" = Xalways || test -t 1 2>/dev/null; } \
-&& { \
-  red='\e[0;31m'; \
-  grn='\e[0;32m'; \
-  lgn='\e[1;32m'; \
-  blu='\e[1;34m'; \
-  std='\e[m'; \
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+am__tty_colors = { \
+  $(am__tty_colors_dummy); \
+  if test "X$(AM_COLOR_TESTS)" = Xno; then \
+    am__color_tests=no; \
+  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+    am__color_tests=yes; \
+  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+    am__color_tests=yes; \
+  fi; \
+  if test $$am__color_tests = yes; then \
+    red='\e[0;31m'; \
+    grn='\e[0;32m'; \
+    lgn='\e[1;32m'; \
+    blu='\e[1;34m'; \
+    mgn='\e[0;35m'; \
+    brg='\e[1m'; \
+    std='\e[m'; \
+  fi; \
 }
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
@@ -268,55 +382,167 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-# Restructured Text title and section.
-am__rst_title = sed 's/.*/   &   /;h;s/./=/g;p;x;p;g;p;s/.*//'
-am__rst_section = sed 'p;s/./=/g;p;g'
-# Put stdin (possibly several lines separated by ".  ") in a box.
-am__text_box = $(AWK) '{                               \
-  n = split($$0, lines, "\\.  "); max = 0;             \
-  for (i = 1; i <= n; ++i)                             \
-    if (max < length(lines[i]))                                \
-      max = length(lines[i]);                          \
-  for (i = 0; i < max; ++i) line = line "=";           \
-  print line;                                          \
-  for (i = 1; i <= n; ++i) if (lines[i]) print lines[i];\
-  print line;                                          \
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__recheck_rx = ^[    ]*:recheck:[    ]*
+am__global_test_result_rx = ^[         ]*:global-test-result:[         ]*
+am__copy_in_global_log_rx = ^[         ]*:copy-in-global-log:[         ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+  recheck = 1; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+        { \
+          if ((getline line2 < ($$0 ".log")) < 0) \
+           recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+        { \
+          recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+        { \
+          break; \
+        } \
+    }; \
+  if (recheck) \
+    print $$0; \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+  print "fatal: making $@: " msg | "cat >&2"; \
+  exit 1; \
+} \
+function rst_section(header) \
+{ \
+  print header; \
+  len = length(header); \
+  for (i = 1; i <= len; i = i + 1) \
+    printf "="; \
+  printf "\n\n"; \
+} \
+{ \
+  copy_in_global_log = 1; \
+  global_test_result = "RUN"; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+         fatal("failed to read from " $$0 ".trs"); \
+      if (line ~ /$(am__global_test_result_rx)/) \
+        { \
+          sub("$(am__global_test_result_rx)", "", line); \
+          sub("[       ]*$$", "", line); \
+          global_test_result = line; \
+        } \
+      else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+        copy_in_global_log = 0; \
+    }; \
+  if (copy_in_global_log) \
+    { \
+      rst_section(global_test_result ": " $$0); \
+      while ((rc = (getline line < ($$0 ".log"))) != 0) \
+      { \
+        if (rc < 0) \
+          fatal("failed to read from " $$0 ".log"); \
+        print line; \
+      }; \
+      printf "\n"; \
+    }; \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
 }'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/   &   /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
 # Solaris 10 'make', and several other traditional 'make' implementations,
-# pass "-e" to $(SHELL).  This contradicts POSIX.  Work around the problem
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this.  Work around it
 # by disabling -e (using the XSI extension "set +e") if it's set.
 am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+  --color-tests "$$am__color_tests" \
+  --enable-hard-errors "$$am__enable_hard_errors" \
+  --expect-failure "$$am__expect_failure"
 # To be inserted before the command running the test.  Creates the
 # directory for the log if needed.  Stores in $dir the directory
-# containing $f, in $tst the test, in $log the log, and passes
-# TESTS_ENVIRONMENT.  Save and restore TERM around use of
-# TESTS_ENVIRONMENT, in case that unsets it.
+# containing $f, in $tst the test, in $log the log.  Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT.  Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
 am__check_pre = \
 $(am__sh_e_setup);                                     \
 $(am__vpath_adj_setup) $(am__vpath_adj)                        \
+$(am__tty_colors);                                     \
 srcdir=$(srcdir); export srcdir;                       \
-rm -f $@-t;                                            \
-trap 'st=$$?; rm -f '\''$(abs_builddir)/$@-t'\''; (exit $$st); exit $$st' \
-  1 2 13 15;                                           \
-am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;           \
-test "x$$am__odir" = x. || $(MKDIR_P) "$$am__odir" || exit $$?;        \
+case "$@" in                                           \
+  */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;;   \
+    *) am__odir=.;;                                    \
+esac;                                                  \
+test "x$$am__odir" = x"." || test -d "$$am__odir"      \
+  || $(MKDIR_P) "$$am__odir" || exit $$?;              \
 if test -f "./$$f"; then dir=./;                       \
 elif test -f "$$f"; then dir=;                         \
 else dir="$(srcdir)/"; fi;                             \
-tst=$$dir$$f; log='$@'; __SAVED_TERM=$$TERM;           \
-$(TESTS_ENVIRONMENT)
+tst=$$dir$$f; log='$@';                                \
+if test -n '$(DISABLE_HARD_ERRORS)'; then              \
+  am__enable_hard_errors=no;                           \
+else                                                   \
+  am__enable_hard_errors=yes;                          \
+fi;                                                    \
+case " $(XFAIL_TESTS) " in                             \
+  *[\ \        ]$$f[\ \        ]* | *[\ \      ]$$dir$$f[\ \   ]*) \
+    am__expect_failure=yes;;                           \
+  *)                                                   \
+    am__expect_failure=no;;                            \
+esac;                                                  \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed).  The result is saved in the shell variable
+# '$bases'.  This honors runtime overriding of TESTS and TEST_LOGS.  Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+  bases='$(TEST_LOGS)'; \
+  bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+  bases=`echo $$bases`
 RECHECK_LOGS = $(TEST_LOGS)
-AM_RECURSIVE_TARGETS = check check-html recheck recheck-html
+AM_RECURSIVE_TARGETS = check recheck
 TEST_SUITE_LOG = test-suite.log
-TEST_SUITE_HTML = $(TEST_SUITE_LOG:.log=.html)
 TEST_EXTENSIONS = @EXEEXT@ .test
+LOG_DRIVER = $(SHELL) $(top_srcdir)/build/ac-aux/test-driver
 LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
+am__set_b = \
+  case '$@' in \
+    */*) \
+      case '$*' in \
+        */*) b='$*';; \
+          *) b=`echo '$@' | sed 's/\.log$$//'`; \
+       esac;; \
+    *) \
+      b='$*';; \
+  esac
 am__test_logs1 = $(TESTS:=.log)
 am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
 TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build/ac-aux/test-driver
 TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
        $(TEST_LOG_FLAGS)
-TEST_LOGS_TMP = $(TEST_LOGS:.log=.log-t)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 pkglibexecdir = @pkglibexecdir@
 ACLOCAL = @ACLOCAL@
@@ -326,6 +552,7 @@ AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
 AR = @AR@
+ARFLAGS = @ARFLAGS@
 ARGZ_H = @ARGZ_H@
 AUGEAS_CFLAGS = @AUGEAS_CFLAGS@
 AUTOCONF = @AUTOCONF@
@@ -369,9 +596,11 @@ GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
 GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
+GNULIB_CHDIR = @GNULIB_CHDIR@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
+GNULIB_DUP = @GNULIB_DUP@
 GNULIB_DUP2 = @GNULIB_DUP2@
 GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
@@ -383,16 +612,25 @@ 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_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FFSL = @GNULIB_FFSL@
+GNULIB_FFSLL = @GNULIB_FFSLL@
+GNULIB_FGETC = @GNULIB_FGETC@
+GNULIB_FGETS = @GNULIB_FGETS@
 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_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@
@@ -400,6 +638,8 @@ 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@
@@ -412,8 +652,14 @@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
 GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
+GNULIB_IMAXABS = @GNULIB_IMAXABS@
+GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
+GNULIB_ISATTY = @GNULIB_ISATTY@
 GNULIB_ISBLANK = @GNULIB_ISBLANK@
 GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
 GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
@@ -421,6 +667,7 @@ GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
 GNULIB_LINK = @GNULIB_LINK@
 GNULIB_LINKAT = @GNULIB_LINKAT@
+GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
 GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
@@ -461,25 +708,31 @@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
 GNULIB_MKTIME = @GNULIB_MKTIME@
 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_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_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
 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_RANDOM = @GNULIB_RANDOM@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
 GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
+GNULIB_READ = @GNULIB_READ@
 GNULIB_READLINK = @GNULIB_READLINK@
 GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
@@ -489,12 +742,15 @@ GNULIB_RENAME = @GNULIB_RENAME@
 GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
 GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
+GNULIB_SCANF = @GNULIB_SCANF@
 GNULIB_SETENV = @GNULIB_SETENV@
+GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
 GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
 GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
 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@
@@ -512,9 +768,11 @@ 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@
@@ -524,7 +782,7 @@ GNULIB_TIME_R = @GNULIB_TIME_R@
 GNULIB_TMPFILE = @GNULIB_TMPFILE@
 GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
 GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
-GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
+GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
 GNULIB_UNLINK = @GNULIB_UNLINK@
 GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
@@ -536,8 +794,10 @@ 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@
@@ -586,6 +846,7 @@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
 HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
 HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
 HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
 HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
@@ -596,18 +857,23 @@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 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_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
 HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
 HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
 HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
@@ -623,7 +889,10 @@ HAVE_FCHDIR = @HAVE_FCHDIR@
 HAVE_FCHMODAT = @HAVE_FCHMODAT@
 HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
 HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
 HAVE_FSEEKO = @HAVE_FSEEKO@
 HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
@@ -637,7 +906,9 @@ HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
 HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
 HAVE_ISBLANK = @HAVE_ISBLANK@
 HAVE_ISWBLANK = @HAVE_ISWBLANK@
@@ -671,15 +942,21 @@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
 HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
 HAVE_MKSTEMP = @HAVE_MKSTEMP@
 HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
 HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OPENAT = @HAVE_OPENAT@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
 HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
 HAVE_PREAD = @HAVE_PREAD@
 HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
 HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_RANDOM = @HAVE_RANDOM@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
 HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -689,6 +966,7 @@ HAVE_REALPATH = @HAVE_REALPATH@
 HAVE_RENAMEAT = @HAVE_RENAMEAT@
 HAVE_RPMATCH = @HAVE_RPMATCH@
 HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
@@ -705,6 +983,7 @@ HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
 HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
 HAVE_SYMLINK = @HAVE_SYMLINK@
 HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
@@ -712,6 +991,7 @@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
 HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
 HAVE_TIMEGM = @HAVE_TIMEGM@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
@@ -753,6 +1033,7 @@ HAVE_WCSXFRM = @HAVE_WCSXFRM@
 HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
 HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
 HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
 HAVE_WMEMCHR = @HAVE_WMEMCHR@
 HAVE_WMEMCMP = @HAVE_WMEMCMP@
@@ -769,6 +1050,8 @@ INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 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@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
@@ -814,6 +1097,7 @@ 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_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
 NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
 NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H = @NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H@
@@ -823,6 +1107,8 @@ 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_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_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@
@@ -833,6 +1119,7 @@ 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_INTTYPES_H = @NEXT_INTTYPES_H@
 NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_LOCALE_H = @NEXT_LOCALE_H@
 NEXT_SELINUX_SELINUX_H = @NEXT_SELINUX_SELINUX_H@
@@ -842,6 +1129,8 @@ NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
 NEXT_STRING_H = @NEXT_STRING_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_WAIT_H = @NEXT_SYS_WAIT_H@
 NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
@@ -868,6 +1157,8 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 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@
@@ -884,6 +1175,7 @@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
 REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
@@ -895,6 +1187,7 @@ REPLACE_FSTAT = @REPLACE_FSTAT@
 REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
 REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
 REPLACE_GETDELIM = @REPLACE_GETDELIM@
@@ -903,11 +1196,15 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISATTY = @REPLACE_ISATTY@
 REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ITOLD = @REPLACE_ITOLD@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
 REPLACE_LINK = @REPLACE_LINK@
 REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALECONV = @REPLACE_LOCALECONV@
 REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
@@ -936,8 +1233,11 @@ REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
 REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
 REPLACE_REALLOC = @REPLACE_REALLOC@
 REPLACE_REALPATH = @REPLACE_REALPATH@
@@ -951,9 +1251,11 @@ REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
 REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
 REPLACE_STPNCPY = @REPLACE_STPNCPY@
 REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
 REPLACE_STRDUP = @REPLACE_STRDUP@
 REPLACE_STRERROR = @REPLACE_STRERROR@
 REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
@@ -963,10 +1265,14 @@ REPLACE_STRNLEN = @REPLACE_STRNLEN@
 REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
 REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
 REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
+REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
 REPLACE_SYMLINK = @REPLACE_SYMLINK@
 REPLACE_TIMEGM = @REPLACE_TIMEGM@
 REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
 REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
 REPLACE_UNLINK = @REPLACE_UNLINK@
 REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
@@ -999,6 +1305,8 @@ STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+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_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
@@ -1006,6 +1314,8 @@ VERSION = @VERSION@
 VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@
 WARN_CFLAGS = @WARN_CFLAGS@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 YACC = @YACC@
 YFLAGS = @YFLAGS@
@@ -1073,22 +1383,42 @@ GNULIB_CFLAGS = -I $(top_srcdir)/gnulib/lib
 AM_CFLAGS = $(AUGEAS_CFLAGS) $(WARN_CFLAGS) $(GNULIB_CFLAGS) \
         $(LIBXML_CFLAGS) -I $(top_builddir)/src
 
+VALGRIND = libtool --mode=execute valgrind --quiet --leak-check=full
 lens_tests = \
   lens-sudoers.sh              \
   lens-access.sh               \
+  lens-activemq_conf.sh                \
+  lens-activemq_xml.sh         \
   lens-aliases.sh              \
+  lens-anacron.sh              \
   lens-approx.sh               \
+  lens-apt_update_manager.sh           \
+  lens-aptcacherngsecurity.sh          \
   lens-aptpreferences.sh       \
   lens-aptconf.sh      \
   lens-aptsource.sh            \
+  lens-authorized_keys.sh      \
+  lens-automaster.sh   \
+  lens-automounter.sh  \
+  lens-avahi.sh        \
   lens-backuppchosts.sh                \
   lens-bbhosts.sh              \
+  lens-bootconf.sh             \
+  lens-build.sh                \
+  lens-cachefilesd.sh          \
+  lens-carbon.sh       \
   lens-cgconfig.sh             \
   lens-cgrules.sh              \
+  lens-channels.sh             \
+  lens-chrony.sh               \
   lens-cobblersettings.sh      \
   lens-cobblermodules.sh       \
+  lens-collectd.sh     \
+  lens-cpanel.sh       \
   lens-cron.sh                 \
   lens-crypttab.sh             \
+  lens-cyrus_imapd.sh          \
+  lens-cups.sh         \
   lens-darkice.sh              \
   lens-debctrl.sh              \
   lens-desktop.sh      \
@@ -1096,50 +1426,82 @@ lens_tests = \
   lens-dhclient.sh             \
   lens-dhcpd.sh                \
   lens-dnsmasq.sh              \
+  lens-dovecot.sh              \
   lens-dpkg.sh                 \
   lens-dput.sh                 \
+  lens-erlang.sh               \
   lens-ethers.sh               \
   lens-exports.sh              \
   lens-fai_diskconfig.sh       \
+  lens-fonts.sh        \
   lens-fstab.sh                        \
+  lens-fuse.sh                 \
   lens-gdm.sh                  \
   lens-group.sh                        \
+  lens-gshadow.sh                      \
+  lens-gtkbookmarks.sh                 \
   lens-json.sh          \
   lens-hostname.sh                     \
   lens-hosts.sh                        \
   lens-hosts_access.sh                 \
   lens-host_conf.sh                    \
+  lens-htpasswd.sh         \
   lens-httpd.sh         \
   lens-inetd.sh         \
   lens-inifile.sh              \
   lens-inittab.sh              \
+  lens-inputrc.sh              \
   lens-interfaces.sh           \
   lens-iptables.sh             \
+  lens-iproute2.sh             \
+  lens-jettyrealm.sh           \
+  lens-jmxaccess.sh            \
+  lens-jmxpassword.sh          \
   lens-kdump.sh                        \
   lens-keepalived.sh   \
+  lens-known_hosts.sh  \
+  lens-koji.sh                 \
   lens-krb5.sh                 \
+  lens-jaas.sh          \
   lens-ldap.sh                 \
+  lens-ldif.sh                 \
+  lens-ldso.sh                 \
+  lens-lightdm.sh              \
   lens-limits.sh               \
   lens-login_defs.sh   \
   lens-logrotate.sh            \
+  lens-logwatch.sh             \
   lens-lokkit.sh               \
+  lens-lvm.sh                  \
+  lens-mcollective.sh  \
   lens-mdadm_conf.sh   \
+  lens-memcached.sh            \
   lens-mke2fs.sh               \
   lens-modprobe.sh             \
   lens-modules.sh              \
   lens-modules_conf.sh \
+  lens-mongodbserver.sh                \
   lens-monit.sh                        \
   lens-multipath.sh     \
   lens-mysql.sh                        \
   lens-nagioscfg.sh     \
   lens-nagiosobjects.sh     \
+  lens-netmasks.sh     \
+  lens-networkmanager.sh     \
   lens-networks.sh     \
+  lens-nginx.sh     \
   lens-ntp.sh                  \
+  lens-ntpd.sh                 \
   lens-nrpe.sh          \
   lens-nsswitch.sh             \
   lens-odbc.sh          \
+  lens-openshift_config.sh     \
+  lens-openshift_http.sh       \
+  lens-openshift_quickstarts.sh        \
   lens-openvpn.sh              \
+  lens-pagekite.sh             \
   lens-pam.sh                  \
+  lens-pamconf.sh              \
   lens-passwd.sh               \
   lens-pbuilder.sh             \
   lens-pg_hba.sh               \
@@ -1148,37 +1510,67 @@ lens_tests = \
   lens-postfix_access.sh \
   lens-postfix_main.sh         \
   lens-postfix_master.sh       \
+  lens-postfix_transport.sh    \
+  lens-postfix_virtual.sh      \
+  lens-postgresql.sh \
   lens-properties.sh    \
+  lens-protocols.sh    \
   lens-puppet.sh               \
+  lens-puppet_auth.sh          \
   lens-puppetfileserver.sh             \
+  lens-pythonpaste.sh  \
+  lens-qpid.sh         \
+  lens-quote.sh                \
+  lens-rabbitmq.sh             \
+  lens-redis.sh                \
   lens-reprepro_uploaders.sh           \
   lens-resolv.sh               \
+  lens-rmt.sh                  \
   lens-rsyncd.sh               \
+  lens-rsyslog.sh              \
   lens-rx.sh                   \
   lens-samba.sh                        \
   lens-securetty.sh     \
   lens-services.sh             \
+  lens-shadow.sh               \
   lens-shells.sh               \
   lens-shellvars.sh            \
   lens-shellvars_list.sh       \
+  lens-simplelines.sh  \
+  lens-simplevars.sh   \
+  lens-sip_conf.sh         \
   lens-slapd.sh                        \
+  lens-smbusers.sh                     \
   lens-solaris_system.sh               \
   lens-soma.sh                 \
   lens-spacevars.sh            \
+  lens-splunk.sh               \
   lens-squid.sh                        \
   lens-ssh.sh                  \
   lens-sshd.sh                 \
+  lens-sssd.sh                 \
   lens-stunnel.sh                      \
+  lens-subversion.sh           \
   lens-sysconfig.sh            \
+  lens-sysconfig_route.sh              \
   lens-syslog.sh               \
   lens-sysctl.sh               \
+  lens-systemd.sh              \
+  lens-thttpd.sh               \
+  lens-tuned.sh                        \
+  lens-up2date.sh              \
+  lens-updatedb.sh             \
   lens-util.sh         \
+  lens-vfstab.sh               \
+  lens-vmware_config.sh                \
   lens-vsftpd.sh               \
   lens-webmin.sh               \
   lens-wine.sh                 \
   lens-xinetd.sh               \
   lens-xml.sh                  \
   lens-xorg.sh                 \
+  lens-xymon.sh                        \
+  lens-xymon_alerting.sh \
   lens-grub.sh                 \
   lens-schroot.sh                      \
   lens-xendconfsxp.sh  \
@@ -1191,8 +1583,10 @@ check_SCRIPTS = \
   test-interpreter.sh \
   $(lens_tests) \
   test-get.sh test-augtool.sh \
-  test-put-symlink.sh test-save-empty.sh \
-  test-bug-1.sh test-idempotent.sh test-preserve.sh \
+  test-put-symlink.sh test-put-symlink-augnew.sh \
+  test-put-symlink-augsave.sh test-put-symlink-augtemp.sh \
+  test-put-mount.sh test-put-mount-augnew.sh test-put-mount-augsave.sh \
+  test-save-empty.sh test-bug-1.sh test-idempotent.sh test-preserve.sh \
   test-events-saved.sh test-save-mode.sh test-unlink-error.sh \
   test-augtool-empty-line.sh test-augtool-modify-root.sh
 
@@ -1210,8 +1604,8 @@ TESTS_ENVIRONMENT = \
 TESTS = $(check_SCRIPTS) $(check_PROGRAMS)
 INCLUDES = -I$(top_srcdir)/src
 fatest_SOURCES = fatest.c cutest.c cutest.h $(top_srcdir)/src/memory.c $(top_srcdir)/src/memory.h
-fatest_LDADD = $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
-test_xpath_SOURCES = test-xpath.c $(top_srcdir)/src/memory.c
+fatest_LDADD = $(top_builddir)/src/libfa.la $(LIBXML_LIBS) $(GNULIB)
+test_xpath_SOURCES = test-xpath.c cutest.c cutest.h $(top_srcdir)/src/memory.c
 test_xpath_LDADD = $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
 test_load_SOURCES = test-load.c cutest.c cutest.h $(top_srcdir)/src/memory.c $(top_srcdir)/src/memory.h
 test_load_LDADD = $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
@@ -1221,10 +1615,12 @@ test_api_SOURCES = test-api.c cutest.c cutest.h $(top_srcdir)/src/memory.c $(top
 test_api_LDADD = $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
 test_run_SOURCES = test-run.c cutest.c cutest.h $(top_srcdir)/src/memory.c $(top_srcdir)/src/memory.h
 test_run_LDADD = $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
+leak_SOURCES = leak.c
+leak_LDADD = $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .c .html .lo .log .o .obj .test .test$(EXEEXT)
+.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/Makefile.inc $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -1246,6 +1642,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
            echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
            cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
        esac;
+$(top_srcdir)/Makefile.inc:
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -1264,22 +1661,41 @@ clean-checkPROGRAMS:
        list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
        echo " rm -f" $$list; \
        rm -f $$list
-fatest$(EXEEXT): $(fatest_OBJECTS) $(fatest_DEPENDENCIES) 
+
+clean-noinstPROGRAMS:
+       @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+
+fatest$(EXEEXT): $(fatest_OBJECTS) $(fatest_DEPENDENCIES) $(EXTRA_fatest_DEPENDENCIES) 
        @rm -f fatest$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(fatest_OBJECTS) $(fatest_LDADD) $(LIBS)
-test-api$(EXEEXT): $(test_api_OBJECTS) $(test_api_DEPENDENCIES) 
+
+leak$(EXEEXT): $(leak_OBJECTS) $(leak_DEPENDENCIES) $(EXTRA_leak_DEPENDENCIES) 
+       @rm -f leak$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(leak_OBJECTS) $(leak_LDADD) $(LIBS)
+
+test-api$(EXEEXT): $(test_api_OBJECTS) $(test_api_DEPENDENCIES) $(EXTRA_test_api_DEPENDENCIES) 
        @rm -f test-api$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_api_OBJECTS) $(test_api_LDADD) $(LIBS)
-test-load$(EXEEXT): $(test_load_OBJECTS) $(test_load_DEPENDENCIES) 
+
+test-load$(EXEEXT): $(test_load_OBJECTS) $(test_load_DEPENDENCIES) $(EXTRA_test_load_DEPENDENCIES) 
        @rm -f test-load$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_load_OBJECTS) $(test_load_LDADD) $(LIBS)
-test-run$(EXEEXT): $(test_run_OBJECTS) $(test_run_DEPENDENCIES) 
+
+test-run$(EXEEXT): $(test_run_OBJECTS) $(test_run_DEPENDENCIES) $(EXTRA_test_run_DEPENDENCIES) 
        @rm -f test-run$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_run_OBJECTS) $(test_run_LDADD) $(LIBS)
-test-save$(EXEEXT): $(test_save_OBJECTS) $(test_save_DEPENDENCIES) 
+
+test-save$(EXEEXT): $(test_save_OBJECTS) $(test_save_DEPENDENCIES) $(EXTRA_test_save_DEPENDENCIES) 
        @rm -f test-save$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_save_OBJECTS) $(test_save_LDADD) $(LIBS)
-test-xpath$(EXEEXT): $(test_xpath_OBJECTS) $(test_xpath_DEPENDENCIES) 
+
+test-xpath$(EXEEXT): $(test_xpath_OBJECTS) $(test_xpath_DEPENDENCIES) $(EXTRA_test_xpath_DEPENDENCIES) 
        @rm -f test-xpath$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_xpath_OBJECTS) $(test_xpath_LDADD) $(LIBS)
 
@@ -1291,6 +1707,7 @@ distclean-compile:
 
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cutest.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fatest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/leak.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-api.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-load.Po@am__quote@
@@ -1301,42 +1718,37 @@ distclean-compile:
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
 
 .c.obj:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
 
 memory.o: $(top_srcdir)/src/memory.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT memory.o -MD -MP -MF $(DEPDIR)/memory.Tpo -c -o memory.o `test -f '$(top_srcdir)/src/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/src/memory.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/memory.Tpo $(DEPDIR)/memory.Po
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(top_srcdir)/src/memory.c' object='memory.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$(top_srcdir)/src/memory.c' object='memory.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.o `test -f '$(top_srcdir)/src/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/src/memory.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.o `test -f '$(top_srcdir)/src/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/src/memory.c
 
 memory.obj: $(top_srcdir)/src/memory.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT memory.obj -MD -MP -MF $(DEPDIR)/memory.Tpo -c -o memory.obj `if test -f '$(top_srcdir)/src/memory.c'; then $(CYGPATH_W) '$(top_srcdir)/src/memory.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/memory.c'; fi`
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/memory.Tpo $(DEPDIR)/memory.Po
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$(top_srcdir)/src/memory.c' object='memory.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$(top_srcdir)/src/memory.c' object='memory.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.obj `if test -f '$(top_srcdir)/src/memory.c'; then $(CYGPATH_W) '$(top_srcdir)/src/memory.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/memory.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.obj `if test -f '$(top_srcdir)/src/memory.c'; then $(CYGPATH_W) '$(top_srcdir)/src/memory.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/memory.c'; fi`
 
 mostlyclean-libtool:
        -rm -f *.lo
@@ -1344,26 +1756,15 @@ mostlyclean-libtool:
 clean-libtool:
        -rm -rf .libs _libs
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       $(am__define_uniq_tagged_files); \
        shift; \
        if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          test -n "$$unique" || unique=$$empty_fix; \
@@ -1375,15 +1776,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              $$unique; \
          fi; \
        fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-       unique=`for i in $$list; do \
-           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-         done | \
-         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-             END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
        test -z "$(CTAGS_ARGS)$$unique" \
          || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
             $$unique
@@ -1392,422 +1789,1685 @@ GTAGS:
        here=`$(am__cd) $(top_builddir) && pwd` \
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
 
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-# To be appended to the command running the test.  Handle the stdout
-# and stderr redirection, and catch the exit status.
-am__check_post =                                       \
->$@-t 2>&1;                                            \
-estatus=$$?;                                           \
-if test -n '$(DISABLE_HARD_ERRORS)'                    \
-   && test $$estatus -eq 99; then                      \
-  estatus=1;                                           \
-fi;                                                    \
-TERM=$$__SAVED_TERM; export TERM;                      \
-$(am__tty_colors);                                     \
-xfailed=PASS;                                          \
-case " $(XFAIL_TESTS) " in                             \
-  *[\ \        ]$$f[\ \        ]* | *[\ \      ]$$dir$$f[\ \   ]*) \
-    xfailed=XFAIL;;                                    \
-esac;                                                  \
-case $$estatus:$$xfailed in                            \
-    0:XFAIL) col=$$red; res=XPASS;;                    \
-    0:*)     col=$$grn; res=PASS ;;                    \
-    77:*)    col=$$blu; res=SKIP ;;                    \
-    99:*)    col=$$red; res=FAIL ;;                    \
-    *:XFAIL) col=$$lgn; res=XFAIL;;                    \
-    *:*)     col=$$red; res=FAIL ;;                    \
-esac;                                                  \
-echo "$${col}$$res$${std}: $$f";                       \
-echo "$$res: $$f (exit: $$estatus)" |                  \
-  $(am__rst_section) >$@;                              \
-cat $@-t >>$@;                                         \
-rm -f $@-t
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'.  Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+       rm -f $< $@
+       $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+       @:
 
 $(TEST_SUITE_LOG): $(TEST_LOGS)
-       @$(am__sh_e_setup);                                             \
-       list='$(TEST_LOGS)';                                            \
-       results=`for f in $$list; do                                    \
-                  read line < $$f && echo "$$line" || echo FAIL;       \
-                done`;                                                 \
-       all=`echo "$$results" | sed '/^$$/d' | wc -l | sed -e 's/^[      ]*//'`; \
-       fail=`echo "$$results" | grep -c '^FAIL'`;                      \
-       pass=`echo "$$results" | grep -c '^PASS'`;                      \
-       skip=`echo "$$results" | grep -c '^SKIP'`;                      \
-       xfail=`echo "$$results" | grep -c '^XFAIL'`;                    \
-       xpass=`echo "$$results" | grep -c '^XPASS'`;                    \
-       failures=`expr $$fail + $$xpass`;                               \
-       all=`expr $$all - $$skip`;                                      \
-       if test "$$all" -eq 1; then tests=test; All=;                   \
-       else tests=tests; All="All "; fi;                               \
-       case fail=$$fail:xpass=$$xpass:xfail=$$xfail in                 \
-         fail=0:xpass=0:xfail=0)                                       \
-           msg="$$All$$all $$tests passed.  ";                         \
-           exit=true;;                                                 \
-         fail=0:xpass=0:xfail=*)                                       \
-           msg="$$All$$all $$tests behaved as expected";               \
-           if test "$$xfail" -eq 1; then xfailures=failure;            \
-           else xfailures=failures; fi;                                \
-           msg="$$msg ($$xfail expected $$xfailures).  ";              \
-           exit=true;;                                                 \
-         fail=*:xpass=0:xfail=*)                                       \
-           msg="$$fail of $$all $$tests failed.  ";                    \
-           exit=false;;                                                \
-         fail=*:xpass=*:xfail=*)                                       \
-           msg="$$failures of $$all $$tests did not behave as expected"; \
-           if test "$$xpass" -eq 1; then xpasses=pass;                 \
-           else xpasses=passes; fi;                                    \
-           msg="$$msg ($$xpass unexpected $$xpasses).  ";              \
-           exit=false;;                                                \
-         *)                                                            \
-           echo >&2 "incorrect case"; exit 4;;                         \
-       esac;                                                           \
-       if test "$$skip" -ne 0; then                                    \
-         if test "$$skip" -eq 1; then                                  \
-           msg="$$msg($$skip test was not run).  ";                    \
-         else                                                          \
-           msg="$$msg($$skip tests were not run).  ";                  \
-         fi;                                                           \
-       fi;                                                             \
+       @$(am__set_TESTS_bases); \
+       am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+       redo_bases=`for i in $$bases; do \
+                     am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+                   done`; \
+       if test -n "$$redo_bases"; then \
+         redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+         redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+         if $(am__make_dryrun); then :; else \
+           rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+         fi; \
+       fi; \
+       if test -n "$$am__remaking_logs"; then \
+         echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+              "recursion detected" >&2; \
+       else \
+         am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+       fi; \
+       if $(am__make_dryrun); then :; else \
+         st=0;  \
+         errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+         for i in $$redo_bases; do \
+           test -f $$i.trs && test -r $$i.trs \
+             || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+           test -f $$i.log && test -r $$i.log \
+             || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+         done; \
+         test $$st -eq 0 || exit 1; \
+       fi
+       @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+       ws='[   ]'; \
+       results=`for b in $$bases; do echo $$b.trs; done`; \
+       test -n "$$results" || results=/dev/null; \
+       all=`  grep "^$$ws*:test-result:"           $$results | wc -l`; \
+       pass=` grep "^$$ws*:test-result:$$ws*PASS"  $$results | wc -l`; \
+       fail=` grep "^$$ws*:test-result:$$ws*FAIL"  $$results | wc -l`; \
+       skip=` grep "^$$ws*:test-result:$$ws*SKIP"  $$results | wc -l`; \
+       xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+       xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+       error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+       if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+         success=true; \
+       else \
+         success=false; \
+       fi; \
+       br='==================='; br=$$br$$br$$br$$br; \
+       result_count () \
+       { \
+           if test x"$$1" = x"--maybe-color"; then \
+             maybe_colorize=yes; \
+           elif test x"$$1" = x"--no-color"; then \
+             maybe_colorize=no; \
+           else \
+             echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+           fi; \
+           shift; \
+           desc=$$1 count=$$2; \
+           if test $$maybe_colorize = yes && test $$count -gt 0; then \
+             color_start=$$3 color_end=$$std; \
+           else \
+             color_start= color_end=; \
+           fi; \
+           echo "$${color_start}# $$desc $$count$${color_end}"; \
+       }; \
+       create_testsuite_report () \
+       { \
+         result_count $$1 "TOTAL:" $$all   "$$brg"; \
+         result_count $$1 "PASS: " $$pass  "$$grn"; \
+         result_count $$1 "SKIP: " $$skip  "$$blu"; \
+         result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+         result_count $$1 "FAIL: " $$fail  "$$red"; \
+         result_count $$1 "XPASS:" $$xpass "$$red"; \
+         result_count $$1 "ERROR:" $$error "$$mgn"; \
+       }; \
        {                                                               \
          echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" |       \
            $(am__rst_title);                                           \
-         echo "$$msg";                                                 \
+         create_testsuite_report --no-color;                           \
          echo;                                                         \
          echo ".. contents:: :depth: 2";                               \
          echo;                                                         \
-         for f in $$list; do                                           \
-           read line < $$f;                                            \
-           case $$line in                                              \
-             PASS:*|XFAIL:*);;                                         \
-             *) echo; cat $$f;;                                        \
-           esac;                                                       \
-         done;                                                         \
-       } >$(TEST_SUITE_LOG).tmp;                                       \
+         for b in $$bases; do echo $$b; done                           \
+           | $(am__create_global_log);                                 \
+       } >$(TEST_SUITE_LOG).tmp || exit 1;                             \
        mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG);                     \
-       if test "$$failures" -ne 0; then                                \
-         msg="$${msg}See $(subdir)/$(TEST_SUITE_LOG).  ";              \
+       if $$success; then                                              \
+         col="$$grn";                                                  \
+        else                                                           \
+         col="$$red";                                                  \
+         test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG);               \
+       fi;                                                             \
+       echo "$${col}$$br$${std}";                                      \
+       echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}";   \
+       echo "$${col}$$br$${std}";                                      \
+       create_testsuite_report --maybe-color;                          \
+       echo "$$col$$br$$std";                                          \
+       if $$success; then :; else                                      \
+         echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}";         \
          if test -n "$(PACKAGE_BUGREPORT)"; then                       \
-           msg="$${msg}Please report to $(PACKAGE_BUGREPORT).  ";      \
+           echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
          fi;                                                           \
+         echo "$$col$$br$$std";                                        \
        fi;                                                             \
-       test x"$$VERBOSE" = x || $$exit || cat $(TEST_SUITE_LOG);       \
-       $(am__tty_colors);                                              \
-       if $$exit; then                                                 \
-         echo $(ECHO_N) "$$grn$(ECHO_C)";                              \
-        else                                                           \
-         echo $(ECHO_N) "$$red$(ECHO_C)";                              \
-       fi;                                                             \
-       echo "$$msg" | $(am__text_box);                                 \
-       echo $(ECHO_N) "$$std$(ECHO_C)";                                \
-       $$exit
+       $$success || exit 1
 
-# Run all the tests.
 check-TESTS:
-       @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
+       @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)
-       @list='$(TEST_LOGS)';                                           \
-       list=`for f in $$list; do                                       \
-         test .log = $$f || echo $$f;                                  \
-       done | tr '\012\015' '  '`;                                     \
-       $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$list"
-
-.log.html:
-       @list='$(RST2HTML) $$RST2HTML rst2html rst2html.py';            \
-       for r2h in $$list; do                                           \
-         if ($$r2h --version) >/dev/null 2>&1; then                    \
-           R2H=$$r2h;                                                  \
-         fi;                                                           \
-       done;                                                           \
-       if test -z "$$R2H"; then                                        \
-         echo >&2 "cannot find rst2html, cannot create $@";            \
-         exit 2;                                                       \
-       fi;                                                             \
-       $$R2H $< >$@.tmp
-       @mv $@.tmp $@
-
-# Be sure to run check first, and then to convert the result.
-# Beware of concurrent executions.  Run "check" not "check-TESTS", as
-# check-SCRIPTS and other dependencies are rebuilt by the former only.
-# And expect check to fail.
-check-html:
-       @if $(MAKE) $(AM_MAKEFLAGS) check; then                 \
-         rv=0; else rv=$$?;                                    \
-       fi;                                                     \
-       $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_HTML) || exit 4;   \
-       exit $$rv
-recheck recheck-html:
-       @target=`echo $@ | sed 's,^re,,'`;                              \
-       list='$(TEST_LOGS)';                                            \
-       list=`for f in $$list; do                                       \
-               test -f $$f || continue;                                \
-               if read line < $$f; then                                \
-                 case $$line in FAIL*|XPASS*) echo $$f;; esac;         \
-               else echo $$f; fi;                                      \
-             done | tr '\012\015' '  '`;                               \
-       $(MAKE) $(AM_MAKEFLAGS) $$target AM_MAKEFLAGS='$(AM_MAKEFLAGS) TEST_LOGS="'"$$list"'"'
+       @set +e; $(am__set_TESTS_bases); \
+       log_list=`for i in $$bases; do echo $$i.log; done`; \
+       trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+       log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+       $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+       exit $$?;
+recheck: all $(check_PROGRAMS) $(check_SCRIPTS)
+       @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 \
+                | $(am__list_recheck_tests)` || exit 1; \
+       log_list=`for i in $$bases; do echo $$i.log; done`; \
+       log_list=`echo $$log_list`; \
+       $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+               am__force_recheck=am--force-recheck \
+               TEST_LOGS="$$log_list"; \
+       exit $$?
 test-interpreter.sh.log: test-interpreter.sh
-       @p='test-interpreter.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-interpreter.sh'; \
+       b='test-interpreter.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)
 lens-sudoers.sh.log: lens-sudoers.sh
-       @p='lens-sudoers.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-sudoers.sh'; \
+       b='lens-sudoers.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)
 lens-access.sh.log: lens-access.sh
-       @p='lens-access.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-access.sh'; \
+       b='lens-access.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)
+lens-activemq_conf.sh.log: lens-activemq_conf.sh
+       @p='lens-activemq_conf.sh'; \
+       b='lens-activemq_conf.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)
+lens-activemq_xml.sh.log: lens-activemq_xml.sh
+       @p='lens-activemq_xml.sh'; \
+       b='lens-activemq_xml.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)
 lens-aliases.sh.log: lens-aliases.sh
-       @p='lens-aliases.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-aliases.sh'; \
+       b='lens-aliases.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)
+lens-anacron.sh.log: lens-anacron.sh
+       @p='lens-anacron.sh'; \
+       b='lens-anacron.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)
 lens-approx.sh.log: lens-approx.sh
-       @p='lens-approx.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-approx.sh'; \
+       b='lens-approx.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)
+lens-apt_update_manager.sh.log: lens-apt_update_manager.sh
+       @p='lens-apt_update_manager.sh'; \
+       b='lens-apt_update_manager.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)
+lens-aptcacherngsecurity.sh.log: lens-aptcacherngsecurity.sh
+       @p='lens-aptcacherngsecurity.sh'; \
+       b='lens-aptcacherngsecurity.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)
 lens-aptpreferences.sh.log: lens-aptpreferences.sh
-       @p='lens-aptpreferences.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-aptpreferences.sh'; \
+       b='lens-aptpreferences.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)
 lens-aptconf.sh.log: lens-aptconf.sh
-       @p='lens-aptconf.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-aptconf.sh'; \
+       b='lens-aptconf.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)
 lens-aptsource.sh.log: lens-aptsource.sh
-       @p='lens-aptsource.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-aptsource.sh'; \
+       b='lens-aptsource.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)
+lens-authorized_keys.sh.log: lens-authorized_keys.sh
+       @p='lens-authorized_keys.sh'; \
+       b='lens-authorized_keys.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)
+lens-automaster.sh.log: lens-automaster.sh
+       @p='lens-automaster.sh'; \
+       b='lens-automaster.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)
+lens-automounter.sh.log: lens-automounter.sh
+       @p='lens-automounter.sh'; \
+       b='lens-automounter.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)
+lens-avahi.sh.log: lens-avahi.sh
+       @p='lens-avahi.sh'; \
+       b='lens-avahi.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)
 lens-backuppchosts.sh.log: lens-backuppchosts.sh
-       @p='lens-backuppchosts.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-backuppchosts.sh'; \
+       b='lens-backuppchosts.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)
 lens-bbhosts.sh.log: lens-bbhosts.sh
-       @p='lens-bbhosts.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-bbhosts.sh'; \
+       b='lens-bbhosts.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)
+lens-bootconf.sh.log: lens-bootconf.sh
+       @p='lens-bootconf.sh'; \
+       b='lens-bootconf.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)
+lens-build.sh.log: lens-build.sh
+       @p='lens-build.sh'; \
+       b='lens-build.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)
+lens-cachefilesd.sh.log: lens-cachefilesd.sh
+       @p='lens-cachefilesd.sh'; \
+       b='lens-cachefilesd.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)
+lens-carbon.sh.log: lens-carbon.sh
+       @p='lens-carbon.sh'; \
+       b='lens-carbon.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)
 lens-cgconfig.sh.log: lens-cgconfig.sh
-       @p='lens-cgconfig.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-cgconfig.sh'; \
+       b='lens-cgconfig.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)
 lens-cgrules.sh.log: lens-cgrules.sh
-       @p='lens-cgrules.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-cgrules.sh'; \
+       b='lens-cgrules.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)
+lens-channels.sh.log: lens-channels.sh
+       @p='lens-channels.sh'; \
+       b='lens-channels.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)
+lens-chrony.sh.log: lens-chrony.sh
+       @p='lens-chrony.sh'; \
+       b='lens-chrony.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)
 lens-cobblersettings.sh.log: lens-cobblersettings.sh
-       @p='lens-cobblersettings.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-cobblersettings.sh'; \
+       b='lens-cobblersettings.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)
 lens-cobblermodules.sh.log: lens-cobblermodules.sh
-       @p='lens-cobblermodules.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-cobblermodules.sh'; \
+       b='lens-cobblermodules.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)
+lens-collectd.sh.log: lens-collectd.sh
+       @p='lens-collectd.sh'; \
+       b='lens-collectd.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)
+lens-cpanel.sh.log: lens-cpanel.sh
+       @p='lens-cpanel.sh'; \
+       b='lens-cpanel.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)
 lens-cron.sh.log: lens-cron.sh
-       @p='lens-cron.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-cron.sh'; \
+       b='lens-cron.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)
 lens-crypttab.sh.log: lens-crypttab.sh
-       @p='lens-crypttab.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-crypttab.sh'; \
+       b='lens-crypttab.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)
+lens-cyrus_imapd.sh.log: lens-cyrus_imapd.sh
+       @p='lens-cyrus_imapd.sh'; \
+       b='lens-cyrus_imapd.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)
+lens-cups.sh.log: lens-cups.sh
+       @p='lens-cups.sh'; \
+       b='lens-cups.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)
 lens-darkice.sh.log: lens-darkice.sh
-       @p='lens-darkice.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-darkice.sh'; \
+       b='lens-darkice.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)
 lens-debctrl.sh.log: lens-debctrl.sh
-       @p='lens-debctrl.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-debctrl.sh'; \
+       b='lens-debctrl.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)
 lens-desktop.sh.log: lens-desktop.sh
-       @p='lens-desktop.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-desktop.sh'; \
+       b='lens-desktop.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)
 lens-device_map.sh.log: lens-device_map.sh
-       @p='lens-device_map.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-device_map.sh'; \
+       b='lens-device_map.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)
 lens-dhclient.sh.log: lens-dhclient.sh
-       @p='lens-dhclient.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-dhclient.sh'; \
+       b='lens-dhclient.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)
 lens-dhcpd.sh.log: lens-dhcpd.sh
-       @p='lens-dhcpd.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-dhcpd.sh'; \
+       b='lens-dhcpd.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)
 lens-dnsmasq.sh.log: lens-dnsmasq.sh
-       @p='lens-dnsmasq.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-dnsmasq.sh'; \
+       b='lens-dnsmasq.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)
+lens-dovecot.sh.log: lens-dovecot.sh
+       @p='lens-dovecot.sh'; \
+       b='lens-dovecot.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)
 lens-dpkg.sh.log: lens-dpkg.sh
-       @p='lens-dpkg.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-dpkg.sh'; \
+       b='lens-dpkg.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)
 lens-dput.sh.log: lens-dput.sh
-       @p='lens-dput.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-dput.sh'; \
+       b='lens-dput.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)
+lens-erlang.sh.log: lens-erlang.sh
+       @p='lens-erlang.sh'; \
+       b='lens-erlang.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)
 lens-ethers.sh.log: lens-ethers.sh
-       @p='lens-ethers.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-ethers.sh'; \
+       b='lens-ethers.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)
 lens-exports.sh.log: lens-exports.sh
-       @p='lens-exports.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-exports.sh'; \
+       b='lens-exports.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)
 lens-fai_diskconfig.sh.log: lens-fai_diskconfig.sh
-       @p='lens-fai_diskconfig.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-fai_diskconfig.sh'; \
+       b='lens-fai_diskconfig.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)
+lens-fonts.sh.log: lens-fonts.sh
+       @p='lens-fonts.sh'; \
+       b='lens-fonts.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)
 lens-fstab.sh.log: lens-fstab.sh
-       @p='lens-fstab.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-fstab.sh'; \
+       b='lens-fstab.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)
+lens-fuse.sh.log: lens-fuse.sh
+       @p='lens-fuse.sh'; \
+       b='lens-fuse.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)
 lens-gdm.sh.log: lens-gdm.sh
-       @p='lens-gdm.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-gdm.sh'; \
+       b='lens-gdm.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)
 lens-group.sh.log: lens-group.sh
-       @p='lens-group.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-group.sh'; \
+       b='lens-group.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)
+lens-gshadow.sh.log: lens-gshadow.sh
+       @p='lens-gshadow.sh'; \
+       b='lens-gshadow.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)
+lens-gtkbookmarks.sh.log: lens-gtkbookmarks.sh
+       @p='lens-gtkbookmarks.sh'; \
+       b='lens-gtkbookmarks.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)
 lens-json.sh.log: lens-json.sh
-       @p='lens-json.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-json.sh'; \
+       b='lens-json.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)
 lens-hostname.sh.log: lens-hostname.sh
-       @p='lens-hostname.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-hostname.sh'; \
+       b='lens-hostname.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)
 lens-hosts.sh.log: lens-hosts.sh
-       @p='lens-hosts.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-hosts.sh'; \
+       b='lens-hosts.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)
 lens-hosts_access.sh.log: lens-hosts_access.sh
-       @p='lens-hosts_access.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-hosts_access.sh'; \
+       b='lens-hosts_access.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)
 lens-host_conf.sh.log: lens-host_conf.sh
-       @p='lens-host_conf.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-host_conf.sh'; \
+       b='lens-host_conf.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)
+lens-htpasswd.sh.log: lens-htpasswd.sh
+       @p='lens-htpasswd.sh'; \
+       b='lens-htpasswd.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)
 lens-httpd.sh.log: lens-httpd.sh
-       @p='lens-httpd.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-httpd.sh'; \
+       b='lens-httpd.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)
 lens-inetd.sh.log: lens-inetd.sh
-       @p='lens-inetd.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-inetd.sh'; \
+       b='lens-inetd.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)
 lens-inifile.sh.log: lens-inifile.sh
-       @p='lens-inifile.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-inifile.sh'; \
+       b='lens-inifile.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)
 lens-inittab.sh.log: lens-inittab.sh
-       @p='lens-inittab.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-inittab.sh'; \
+       b='lens-inittab.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)
+lens-inputrc.sh.log: lens-inputrc.sh
+       @p='lens-inputrc.sh'; \
+       b='lens-inputrc.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)
 lens-interfaces.sh.log: lens-interfaces.sh
-       @p='lens-interfaces.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-interfaces.sh'; \
+       b='lens-interfaces.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)
 lens-iptables.sh.log: lens-iptables.sh
-       @p='lens-iptables.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-iptables.sh'; \
+       b='lens-iptables.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)
+lens-iproute2.sh.log: lens-iproute2.sh
+       @p='lens-iproute2.sh'; \
+       b='lens-iproute2.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)
+lens-jettyrealm.sh.log: lens-jettyrealm.sh
+       @p='lens-jettyrealm.sh'; \
+       b='lens-jettyrealm.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)
+lens-jmxaccess.sh.log: lens-jmxaccess.sh
+       @p='lens-jmxaccess.sh'; \
+       b='lens-jmxaccess.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)
+lens-jmxpassword.sh.log: lens-jmxpassword.sh
+       @p='lens-jmxpassword.sh'; \
+       b='lens-jmxpassword.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)
 lens-kdump.sh.log: lens-kdump.sh
-       @p='lens-kdump.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-kdump.sh'; \
+       b='lens-kdump.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)
 lens-keepalived.sh.log: lens-keepalived.sh
-       @p='lens-keepalived.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-keepalived.sh'; \
+       b='lens-keepalived.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)
+lens-known_hosts.sh.log: lens-known_hosts.sh
+       @p='lens-known_hosts.sh'; \
+       b='lens-known_hosts.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)
+lens-koji.sh.log: lens-koji.sh
+       @p='lens-koji.sh'; \
+       b='lens-koji.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)
 lens-krb5.sh.log: lens-krb5.sh
-       @p='lens-krb5.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-krb5.sh'; \
+       b='lens-krb5.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)
+lens-jaas.sh.log: lens-jaas.sh
+       @p='lens-jaas.sh'; \
+       b='lens-jaas.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)
 lens-ldap.sh.log: lens-ldap.sh
-       @p='lens-ldap.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-ldap.sh'; \
+       b='lens-ldap.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)
+lens-ldif.sh.log: lens-ldif.sh
+       @p='lens-ldif.sh'; \
+       b='lens-ldif.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)
+lens-ldso.sh.log: lens-ldso.sh
+       @p='lens-ldso.sh'; \
+       b='lens-ldso.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)
+lens-lightdm.sh.log: lens-lightdm.sh
+       @p='lens-lightdm.sh'; \
+       b='lens-lightdm.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)
 lens-limits.sh.log: lens-limits.sh
-       @p='lens-limits.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-limits.sh'; \
+       b='lens-limits.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)
 lens-login_defs.sh.log: lens-login_defs.sh
-       @p='lens-login_defs.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-login_defs.sh'; \
+       b='lens-login_defs.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)
 lens-logrotate.sh.log: lens-logrotate.sh
-       @p='lens-logrotate.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-logrotate.sh'; \
+       b='lens-logrotate.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)
+lens-logwatch.sh.log: lens-logwatch.sh
+       @p='lens-logwatch.sh'; \
+       b='lens-logwatch.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)
 lens-lokkit.sh.log: lens-lokkit.sh
-       @p='lens-lokkit.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-lokkit.sh'; \
+       b='lens-lokkit.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)
+lens-lvm.sh.log: lens-lvm.sh
+       @p='lens-lvm.sh'; \
+       b='lens-lvm.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)
+lens-mcollective.sh.log: lens-mcollective.sh
+       @p='lens-mcollective.sh'; \
+       b='lens-mcollective.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)
 lens-mdadm_conf.sh.log: lens-mdadm_conf.sh
-       @p='lens-mdadm_conf.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-mdadm_conf.sh'; \
+       b='lens-mdadm_conf.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)
+lens-memcached.sh.log: lens-memcached.sh
+       @p='lens-memcached.sh'; \
+       b='lens-memcached.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)
 lens-mke2fs.sh.log: lens-mke2fs.sh
-       @p='lens-mke2fs.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-mke2fs.sh'; \
+       b='lens-mke2fs.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)
 lens-modprobe.sh.log: lens-modprobe.sh
-       @p='lens-modprobe.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-modprobe.sh'; \
+       b='lens-modprobe.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)
 lens-modules.sh.log: lens-modules.sh
-       @p='lens-modules.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-modules.sh'; \
+       b='lens-modules.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)
 lens-modules_conf.sh.log: lens-modules_conf.sh
-       @p='lens-modules_conf.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-modules_conf.sh'; \
+       b='lens-modules_conf.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)
+lens-mongodbserver.sh.log: lens-mongodbserver.sh
+       @p='lens-mongodbserver.sh'; \
+       b='lens-mongodbserver.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)
 lens-monit.sh.log: lens-monit.sh
-       @p='lens-monit.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-monit.sh'; \
+       b='lens-monit.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)
 lens-multipath.sh.log: lens-multipath.sh
-       @p='lens-multipath.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-multipath.sh'; \
+       b='lens-multipath.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)
 lens-mysql.sh.log: lens-mysql.sh
-       @p='lens-mysql.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-mysql.sh'; \
+       b='lens-mysql.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)
 lens-nagioscfg.sh.log: lens-nagioscfg.sh
-       @p='lens-nagioscfg.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-nagioscfg.sh'; \
+       b='lens-nagioscfg.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)
 lens-nagiosobjects.sh.log: lens-nagiosobjects.sh
-       @p='lens-nagiosobjects.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-nagiosobjects.sh'; \
+       b='lens-nagiosobjects.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)
+lens-netmasks.sh.log: lens-netmasks.sh
+       @p='lens-netmasks.sh'; \
+       b='lens-netmasks.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)
+lens-networkmanager.sh.log: lens-networkmanager.sh
+       @p='lens-networkmanager.sh'; \
+       b='lens-networkmanager.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)
 lens-networks.sh.log: lens-networks.sh
-       @p='lens-networks.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-networks.sh'; \
+       b='lens-networks.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)
+lens-nginx.sh.log: lens-nginx.sh
+       @p='lens-nginx.sh'; \
+       b='lens-nginx.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)
 lens-ntp.sh.log: lens-ntp.sh
-       @p='lens-ntp.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-ntp.sh'; \
+       b='lens-ntp.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)
+lens-ntpd.sh.log: lens-ntpd.sh
+       @p='lens-ntpd.sh'; \
+       b='lens-ntpd.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)
 lens-nrpe.sh.log: lens-nrpe.sh
-       @p='lens-nrpe.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-nrpe.sh'; \
+       b='lens-nrpe.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)
 lens-nsswitch.sh.log: lens-nsswitch.sh
-       @p='lens-nsswitch.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-nsswitch.sh'; \
+       b='lens-nsswitch.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)
 lens-odbc.sh.log: lens-odbc.sh
-       @p='lens-odbc.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-odbc.sh'; \
+       b='lens-odbc.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)
+lens-openshift_config.sh.log: lens-openshift_config.sh
+       @p='lens-openshift_config.sh'; \
+       b='lens-openshift_config.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)
+lens-openshift_http.sh.log: lens-openshift_http.sh
+       @p='lens-openshift_http.sh'; \
+       b='lens-openshift_http.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)
+lens-openshift_quickstarts.sh.log: lens-openshift_quickstarts.sh
+       @p='lens-openshift_quickstarts.sh'; \
+       b='lens-openshift_quickstarts.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)
 lens-openvpn.sh.log: lens-openvpn.sh
-       @p='lens-openvpn.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-openvpn.sh'; \
+       b='lens-openvpn.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)
+lens-pagekite.sh.log: lens-pagekite.sh
+       @p='lens-pagekite.sh'; \
+       b='lens-pagekite.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)
 lens-pam.sh.log: lens-pam.sh
-       @p='lens-pam.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-pam.sh'; \
+       b='lens-pam.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)
+lens-pamconf.sh.log: lens-pamconf.sh
+       @p='lens-pamconf.sh'; \
+       b='lens-pamconf.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)
 lens-passwd.sh.log: lens-passwd.sh
-       @p='lens-passwd.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-passwd.sh'; \
+       b='lens-passwd.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)
 lens-pbuilder.sh.log: lens-pbuilder.sh
-       @p='lens-pbuilder.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-pbuilder.sh'; \
+       b='lens-pbuilder.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)
 lens-pg_hba.sh.log: lens-pg_hba.sh
-       @p='lens-pg_hba.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-pg_hba.sh'; \
+       b='lens-pg_hba.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)
 lens-php.sh.log: lens-php.sh
-       @p='lens-php.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-php.sh'; \
+       b='lens-php.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)
 lens-phpvars.sh.log: lens-phpvars.sh
-       @p='lens-phpvars.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-phpvars.sh'; \
+       b='lens-phpvars.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)
 lens-postfix_access.sh.log: lens-postfix_access.sh
-       @p='lens-postfix_access.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-postfix_access.sh'; \
+       b='lens-postfix_access.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)
 lens-postfix_main.sh.log: lens-postfix_main.sh
-       @p='lens-postfix_main.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-postfix_main.sh'; \
+       b='lens-postfix_main.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)
 lens-postfix_master.sh.log: lens-postfix_master.sh
-       @p='lens-postfix_master.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-postfix_master.sh'; \
+       b='lens-postfix_master.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)
+lens-postfix_transport.sh.log: lens-postfix_transport.sh
+       @p='lens-postfix_transport.sh'; \
+       b='lens-postfix_transport.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)
+lens-postfix_virtual.sh.log: lens-postfix_virtual.sh
+       @p='lens-postfix_virtual.sh'; \
+       b='lens-postfix_virtual.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)
+lens-postgresql.sh.log: lens-postgresql.sh
+       @p='lens-postgresql.sh'; \
+       b='lens-postgresql.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)
 lens-properties.sh.log: lens-properties.sh
-       @p='lens-properties.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-properties.sh'; \
+       b='lens-properties.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)
+lens-protocols.sh.log: lens-protocols.sh
+       @p='lens-protocols.sh'; \
+       b='lens-protocols.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)
 lens-puppet.sh.log: lens-puppet.sh
-       @p='lens-puppet.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-puppet.sh'; \
+       b='lens-puppet.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)
+lens-puppet_auth.sh.log: lens-puppet_auth.sh
+       @p='lens-puppet_auth.sh'; \
+       b='lens-puppet_auth.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)
 lens-puppetfileserver.sh.log: lens-puppetfileserver.sh
-       @p='lens-puppetfileserver.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-puppetfileserver.sh'; \
+       b='lens-puppetfileserver.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)
+lens-pythonpaste.sh.log: lens-pythonpaste.sh
+       @p='lens-pythonpaste.sh'; \
+       b='lens-pythonpaste.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)
+lens-qpid.sh.log: lens-qpid.sh
+       @p='lens-qpid.sh'; \
+       b='lens-qpid.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)
+lens-quote.sh.log: lens-quote.sh
+       @p='lens-quote.sh'; \
+       b='lens-quote.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)
+lens-rabbitmq.sh.log: lens-rabbitmq.sh
+       @p='lens-rabbitmq.sh'; \
+       b='lens-rabbitmq.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)
+lens-redis.sh.log: lens-redis.sh
+       @p='lens-redis.sh'; \
+       b='lens-redis.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)
 lens-reprepro_uploaders.sh.log: lens-reprepro_uploaders.sh
-       @p='lens-reprepro_uploaders.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-reprepro_uploaders.sh'; \
+       b='lens-reprepro_uploaders.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)
 lens-resolv.sh.log: lens-resolv.sh
-       @p='lens-resolv.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-resolv.sh'; \
+       b='lens-resolv.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)
+lens-rmt.sh.log: lens-rmt.sh
+       @p='lens-rmt.sh'; \
+       b='lens-rmt.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)
 lens-rsyncd.sh.log: lens-rsyncd.sh
-       @p='lens-rsyncd.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-rsyncd.sh'; \
+       b='lens-rsyncd.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)
+lens-rsyslog.sh.log: lens-rsyslog.sh
+       @p='lens-rsyslog.sh'; \
+       b='lens-rsyslog.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)
 lens-rx.sh.log: lens-rx.sh
-       @p='lens-rx.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-rx.sh'; \
+       b='lens-rx.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)
 lens-samba.sh.log: lens-samba.sh
-       @p='lens-samba.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-samba.sh'; \
+       b='lens-samba.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)
 lens-securetty.sh.log: lens-securetty.sh
-       @p='lens-securetty.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-securetty.sh'; \
+       b='lens-securetty.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)
 lens-services.sh.log: lens-services.sh
-       @p='lens-services.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-services.sh'; \
+       b='lens-services.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)
+lens-shadow.sh.log: lens-shadow.sh
+       @p='lens-shadow.sh'; \
+       b='lens-shadow.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)
 lens-shells.sh.log: lens-shells.sh
-       @p='lens-shells.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-shells.sh'; \
+       b='lens-shells.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)
 lens-shellvars.sh.log: lens-shellvars.sh
-       @p='lens-shellvars.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-shellvars.sh'; \
+       b='lens-shellvars.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)
 lens-shellvars_list.sh.log: lens-shellvars_list.sh
-       @p='lens-shellvars_list.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-shellvars_list.sh'; \
+       b='lens-shellvars_list.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)
+lens-simplelines.sh.log: lens-simplelines.sh
+       @p='lens-simplelines.sh'; \
+       b='lens-simplelines.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)
+lens-simplevars.sh.log: lens-simplevars.sh
+       @p='lens-simplevars.sh'; \
+       b='lens-simplevars.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)
+lens-sip_conf.sh.log: lens-sip_conf.sh
+       @p='lens-sip_conf.sh'; \
+       b='lens-sip_conf.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)
 lens-slapd.sh.log: lens-slapd.sh
-       @p='lens-slapd.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-slapd.sh'; \
+       b='lens-slapd.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)
+lens-smbusers.sh.log: lens-smbusers.sh
+       @p='lens-smbusers.sh'; \
+       b='lens-smbusers.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)
 lens-solaris_system.sh.log: lens-solaris_system.sh
-       @p='lens-solaris_system.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-solaris_system.sh'; \
+       b='lens-solaris_system.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)
 lens-soma.sh.log: lens-soma.sh
-       @p='lens-soma.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-soma.sh'; \
+       b='lens-soma.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)
 lens-spacevars.sh.log: lens-spacevars.sh
-       @p='lens-spacevars.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-spacevars.sh'; \
+       b='lens-spacevars.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)
+lens-splunk.sh.log: lens-splunk.sh
+       @p='lens-splunk.sh'; \
+       b='lens-splunk.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)
 lens-squid.sh.log: lens-squid.sh
-       @p='lens-squid.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-squid.sh'; \
+       b='lens-squid.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)
 lens-ssh.sh.log: lens-ssh.sh
-       @p='lens-ssh.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-ssh.sh'; \
+       b='lens-ssh.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)
 lens-sshd.sh.log: lens-sshd.sh
-       @p='lens-sshd.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-sshd.sh'; \
+       b='lens-sshd.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)
+lens-sssd.sh.log: lens-sssd.sh
+       @p='lens-sssd.sh'; \
+       b='lens-sssd.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)
 lens-stunnel.sh.log: lens-stunnel.sh
-       @p='lens-stunnel.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-stunnel.sh'; \
+       b='lens-stunnel.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)
+lens-subversion.sh.log: lens-subversion.sh
+       @p='lens-subversion.sh'; \
+       b='lens-subversion.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)
 lens-sysconfig.sh.log: lens-sysconfig.sh
-       @p='lens-sysconfig.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-sysconfig.sh'; \
+       b='lens-sysconfig.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)
+lens-sysconfig_route.sh.log: lens-sysconfig_route.sh
+       @p='lens-sysconfig_route.sh'; \
+       b='lens-sysconfig_route.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)
 lens-syslog.sh.log: lens-syslog.sh
-       @p='lens-syslog.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-syslog.sh'; \
+       b='lens-syslog.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)
 lens-sysctl.sh.log: lens-sysctl.sh
-       @p='lens-sysctl.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-sysctl.sh'; \
+       b='lens-sysctl.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)
+lens-systemd.sh.log: lens-systemd.sh
+       @p='lens-systemd.sh'; \
+       b='lens-systemd.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)
+lens-thttpd.sh.log: lens-thttpd.sh
+       @p='lens-thttpd.sh'; \
+       b='lens-thttpd.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)
+lens-tuned.sh.log: lens-tuned.sh
+       @p='lens-tuned.sh'; \
+       b='lens-tuned.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)
+lens-up2date.sh.log: lens-up2date.sh
+       @p='lens-up2date.sh'; \
+       b='lens-up2date.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)
+lens-updatedb.sh.log: lens-updatedb.sh
+       @p='lens-updatedb.sh'; \
+       b='lens-updatedb.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)
 lens-util.sh.log: lens-util.sh
-       @p='lens-util.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-util.sh'; \
+       b='lens-util.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)
+lens-vfstab.sh.log: lens-vfstab.sh
+       @p='lens-vfstab.sh'; \
+       b='lens-vfstab.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)
+lens-vmware_config.sh.log: lens-vmware_config.sh
+       @p='lens-vmware_config.sh'; \
+       b='lens-vmware_config.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)
 lens-vsftpd.sh.log: lens-vsftpd.sh
-       @p='lens-vsftpd.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-vsftpd.sh'; \
+       b='lens-vsftpd.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)
 lens-webmin.sh.log: lens-webmin.sh
-       @p='lens-webmin.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-webmin.sh'; \
+       b='lens-webmin.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)
 lens-wine.sh.log: lens-wine.sh
-       @p='lens-wine.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-wine.sh'; \
+       b='lens-wine.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)
 lens-xinetd.sh.log: lens-xinetd.sh
-       @p='lens-xinetd.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-xinetd.sh'; \
+       b='lens-xinetd.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)
 lens-xml.sh.log: lens-xml.sh
-       @p='lens-xml.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-xml.sh'; \
+       b='lens-xml.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)
 lens-xorg.sh.log: lens-xorg.sh
-       @p='lens-xorg.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-xorg.sh'; \
+       b='lens-xorg.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)
+lens-xymon.sh.log: lens-xymon.sh
+       @p='lens-xymon.sh'; \
+       b='lens-xymon.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)
+lens-xymon_alerting.sh.log: lens-xymon_alerting.sh
+       @p='lens-xymon_alerting.sh'; \
+       b='lens-xymon_alerting.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)
 lens-grub.sh.log: lens-grub.sh
-       @p='lens-grub.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-grub.sh'; \
+       b='lens-grub.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)
 lens-schroot.sh.log: lens-schroot.sh
-       @p='lens-schroot.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-schroot.sh'; \
+       b='lens-schroot.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)
 lens-xendconfsxp.sh.log: lens-xendconfsxp.sh
-       @p='lens-xendconfsxp.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-xendconfsxp.sh'; \
+       b='lens-xendconfsxp.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)
 lens-yum.sh.log: lens-yum.sh
-       @p='lens-yum.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='lens-yum.sh'; \
+       b='lens-yum.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-get.sh.log: test-get.sh
-       @p='test-get.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-get.sh'; \
+       b='test-get.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-augtool.sh.log: test-augtool.sh
-       @p='test-augtool.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-augtool.sh'; \
+       b='test-augtool.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-put-symlink.sh.log: test-put-symlink.sh
-       @p='test-put-symlink.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-put-symlink.sh'; \
+       b='test-put-symlink.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-put-symlink-augnew.sh.log: test-put-symlink-augnew.sh
+       @p='test-put-symlink-augnew.sh'; \
+       b='test-put-symlink-augnew.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-put-symlink-augsave.sh.log: test-put-symlink-augsave.sh
+       @p='test-put-symlink-augsave.sh'; \
+       b='test-put-symlink-augsave.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-put-symlink-augtemp.sh.log: test-put-symlink-augtemp.sh
+       @p='test-put-symlink-augtemp.sh'; \
+       b='test-put-symlink-augtemp.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-put-mount.sh.log: test-put-mount.sh
+       @p='test-put-mount.sh'; \
+       b='test-put-mount.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-put-mount-augnew.sh.log: test-put-mount-augnew.sh
+       @p='test-put-mount-augnew.sh'; \
+       b='test-put-mount-augnew.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-put-mount-augsave.sh.log: test-put-mount-augsave.sh
+       @p='test-put-mount-augsave.sh'; \
+       b='test-put-mount-augsave.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-save-empty.sh.log: test-save-empty.sh
-       @p='test-save-empty.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-save-empty.sh'; \
+       b='test-save-empty.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-bug-1.sh.log: test-bug-1.sh
-       @p='test-bug-1.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-bug-1.sh'; \
+       b='test-bug-1.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-idempotent.sh.log: test-idempotent.sh
-       @p='test-idempotent.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-idempotent.sh'; \
+       b='test-idempotent.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-preserve.sh.log: test-preserve.sh
-       @p='test-preserve.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-preserve.sh'; \
+       b='test-preserve.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-events-saved.sh.log: test-events-saved.sh
-       @p='test-events-saved.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-events-saved.sh'; \
+       b='test-events-saved.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-save-mode.sh.log: test-save-mode.sh
-       @p='test-save-mode.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-save-mode.sh'; \
+       b='test-save-mode.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-unlink-error.sh.log: test-unlink-error.sh
-       @p='test-unlink-error.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-unlink-error.sh'; \
+       b='test-unlink-error.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-augtool-empty-line.sh.log: test-augtool-empty-line.sh
-       @p='test-augtool-empty-line.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-augtool-empty-line.sh'; \
+       b='test-augtool-empty-line.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-augtool-modify-root.sh.log: test-augtool-modify-root.sh
-       @p='test-augtool-modify-root.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-augtool-modify-root.sh'; \
+       b='test-augtool-modify-root.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)
 fatest.log: fatest$(EXEEXT)
-       @p='fatest$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='fatest$(EXEEXT)'; \
+       b='fatest'; \
+       $(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-xpath.log: test-xpath$(EXEEXT)
-       @p='test-xpath$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-xpath$(EXEEXT)'; \
+       b='test-xpath'; \
+       $(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-load.log: test-load$(EXEEXT)
-       @p='test-load$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-load$(EXEEXT)'; \
+       b='test-load'; \
+       $(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-save.log: test-save$(EXEEXT)
-       @p='test-save$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-save$(EXEEXT)'; \
+       b='test-save'; \
+       $(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-api.log: test-api$(EXEEXT)
-       @p='test-api$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-api$(EXEEXT)'; \
+       b='test-api'; \
+       $(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-run.log: test-run$(EXEEXT)
-       @p='test-run$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='test-run$(EXEEXT)'; \
+       b='test-run'; \
+       $(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.log:
-       @p='$<'; $(am__check_pre) $(TEST_LOG_COMPILE) "$$tst" $(am__check_post)
+       @p='$<'; \
+       $(am__set_b); \
+       $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 @am__EXEEXT_TRUE@.test$(EXEEXT).log:
-@am__EXEEXT_TRUE@      @p='$<'; $(am__check_pre) $(TEST_LOG_COMPILE) "$$tst" $(am__check_post)
+@am__EXEEXT_TRUE@      @p='$<'; \
+@am__EXEEXT_TRUE@      $(am__set_b); \
+@am__EXEEXT_TRUE@      $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@      --log-file $$b.log --trs-file $$b.trs \
+@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)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -1843,7 +3503,7 @@ check-am: all-am
        $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_SCRIPTS)
        $(MAKE) $(AM_MAKEFLAGS) check-TESTS
 check: check-am
-all-am: Makefile $(SCRIPTS)
+all-am: Makefile $(PROGRAMS) $(SCRIPTS)
 installdirs:
 install: install-am
 install-exec: install-exec-am
@@ -1855,14 +3515,18 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
 mostlyclean-generic:
        -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
-       -test -z "$(TEST_LOGS_TMP)" || rm -f $(TEST_LOGS_TMP)
-       -test -z "$(TEST_SUITE_HTML)" || rm -f $(TEST_SUITE_HTML)
+       -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
        -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
 
 clean-generic:
@@ -1878,7 +3542,7 @@ maintainer-clean-generic:
 clean: clean-am
 
 clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
-       mostlyclean-am
+       clean-noinstPROGRAMS mostlyclean-am
 
 distclean: distclean-am
        -rm -rf ./$(DEPDIR)
@@ -1946,30 +3610,32 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: check-am check-html install-am install-strip recheck \
-       recheck-html
-
-.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am check-html \
-       clean clean-checkPROGRAMS clean-generic clean-libtool ctags \
-       distclean distclean-compile distclean-generic \
-       distclean-libtool 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 maintainer-clean \
-       maintainer-clean-generic mostlyclean mostlyclean-compile \
-       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-       recheck recheck-html tags uninstall uninstall-am
-
+.MAKE: check-am install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \
+       clean-checkPROGRAMS clean-generic clean-libtool \
+       clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
+       distclean-compile distclean-generic distclean-libtool \
+       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 \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am recheck tags tags-am uninstall \
+       uninstall-am
 
 valgrind:
        make check \
-         VALGRIND="libtool --mode=execute valgrind --quiet --leak-check=full" \
+         VALGRIND="$(VALGRIND)" \
          AUGPARSE=$(abs_top_builddir)/src/augparse \
          AUGTOOL=$(abs_top_builddir)/src/augtool
-       libtool --mode=execute valgrind --quiet --leak-check=full ./fatest
+       $(VALGRIND) ./fatest
+
+valgrind-leak: leak
+       $(TESTS_ENVIRONMENT) $(VALGRIND) ./leak
 
 # Ensure that the above list stays up to date:
 # Construct two lists: list of lens-*.sh from lens_tests = ... above,
index 3c8962c..af0e7a9 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <config.h>
 
+#include <sys/wait.h>
 #include <assert.h>
 #include <setjmp.h>
 #include <stdlib.h>
@@ -339,6 +340,15 @@ void run(CuTest *tc, const char *format, ...) {
     free(command);
 }
 
+int should_run(const char *name, int argc, char **argv) {
+    if (argc == 0)
+        return 1;
+    for (int i=0; i < argc; i++)
+        if (STREQ(argv[i], name))
+            return 1;
+    return 0;
+}
+
 /*
  * Local variables:
  *  indent-tabs-mode: nil
index 99e2d34..1f3b02e 100644 (file)
@@ -130,6 +130,10 @@ void CuSuiteDetails(CuSuite* testSuite, char **details);
 
 /* Run a command */
 void run(CuTest *tc, const char *format, ...);
+
+/* Return 1 if NAME is one of the ARGV, or if ARGC == 0; return 0 otherwise */
+int should_run(const char *name, int argc, char **argv);
+
 #endif /* CU_TEST_H */
 
 /*
index 79cd94c..b63bade 100644 (file)
@@ -599,6 +599,48 @@ static void testNoCaseComplement(CuTest *tc) {
     CuAssertIntEquals(tc, 1, fa_is_basic(isect, FA_EMPTY));
 }
 
+static void testEnumerate(CuTest *tc) {
+    struct fa *fa1 = make_good_fa(tc, "[ab](cc|dd)");
+    static const char *const fa1_expected[] =
+        { "acc", "add", "bcc", "bdd" };
+    struct fa *fa_inf = make_good_fa(tc, "a(b*|d)c");
+    struct fa *fa_empty = make_good_fa(tc, "a?");
+
+    char **words;
+    int r;
+
+    r = fa_enumerate(fa1, 2, &words);
+    CuAssertIntEquals(tc, -2, r);
+    CuAssertPtrEquals(tc, NULL, words);
+
+    r = fa_enumerate(fa1, 10, &words);
+    CuAssertIntEquals(tc, 4, r);
+    CuAssertPtrNotNull(tc, words);
+
+    for (int i=0; i < r; i++) {
+        int found = 0;
+        for (int j=0; j < ARRAY_CARDINALITY(fa1_expected); j++) {
+            if (STREQ(words[i], fa1_expected[j]))
+                found = 1;
+        }
+        if (!found) {
+            char *msg;
+            asprintf(&msg, "Generated word %s not expected", words[i]);
+            CuFail(tc, msg);
+        }
+    }
+
+    r = fa_enumerate(fa_inf, 100, &words);
+    CuAssertIntEquals(tc, -2, r);
+    CuAssertPtrEquals(tc, NULL, words);
+
+    r = fa_enumerate(fa_empty, 10, &words);
+    CuAssertIntEquals(tc, 2, r);
+    CuAssertPtrNotNull(tc, words);
+    CuAssertStrEquals(tc, "", words[0]);
+    CuAssertStrEquals(tc, "a", words[1]);
+}
+
 int main(int argc, char **argv) {
     if (argc == 1) {
         char *output = NULL;
@@ -624,6 +666,7 @@ int main(int argc, char **argv) {
         SUITE_ADD_TEST(suite, testNoCase);
         SUITE_ADD_TEST(suite, testExpandNoCase);
         SUITE_ADD_TEST(suite, testNoCaseComplement);
+        SUITE_ADD_TEST(suite, testEnumerate);
 
         CuSuiteRun(suite);
         CuSuiteSummary(suite, &output);
diff --git a/tests/leak.c b/tests/leak.c
new file mode 100644 (file)
index 0000000..09d68fd
--- /dev/null
@@ -0,0 +1,46 @@
+#include <config.h>
+#include "augeas.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+
+const char *abs_top_srcdir;
+const char *abs_top_builddir;
+char *root = NULL, *src_root = NULL, *lensdir = NULL;
+struct augeas *aug = NULL;
+
+
+#define die(msg)                                                    \
+    do {                                                            \
+        fprintf(stderr, "%s:%d: Fatal error: %s\n", __FILE__, __LINE__, msg); \
+        exit(EXIT_FAILURE);                                         \
+    } while(0)
+
+
+int main (void)
+{
+  abs_top_srcdir = getenv("abs_top_srcdir");
+  if (abs_top_srcdir == NULL)
+    die("env var abs_top_srcdir must be set");
+
+  abs_top_builddir = getenv("abs_top_builddir");
+  if (abs_top_builddir == NULL)
+    die("env var abs_top_builddir must be set");
+
+  if (asprintf(&src_root, "%s/tests/root", abs_top_srcdir) < 0) {
+    die("failed to set src_root");
+  }
+
+  if (asprintf(&lensdir, "%s/lenses", abs_top_srcdir) < 0)
+    die("asprintf lensdir failed");
+
+
+  aug = aug_init (src_root, lensdir, AUG_NO_STDINC);
+  if (!aug) { perror ("aug_init"); exit (1); }
+  aug_close (aug);
+
+  free(root);
+  free(src_root);
+  free(lensdir);
+  return 0;
+}
diff --git a/tests/lens-activemq_conf.sh b/tests/lens-activemq_conf.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-activemq_xml.sh b/tests/lens-activemq_xml.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-anacron.sh b/tests/lens-anacron.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-apt_update_manager.sh b/tests/lens-apt_update_manager.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-aptcacherngsecurity.sh b/tests/lens-aptcacherngsecurity.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-authorized_keys.sh b/tests/lens-authorized_keys.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-automaster.sh b/tests/lens-automaster.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-automounter.sh b/tests/lens-automounter.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-avahi.sh b/tests/lens-avahi.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-bootconf.sh b/tests/lens-bootconf.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-build.sh b/tests/lens-build.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-cachefilesd.sh b/tests/lens-cachefilesd.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-carbon.sh b/tests/lens-carbon.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-channels.sh b/tests/lens-channels.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-chrony.sh b/tests/lens-chrony.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-collectd.sh b/tests/lens-collectd.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-cpanel.sh b/tests/lens-cpanel.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-cups.sh b/tests/lens-cups.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-cyrus_imapd.sh b/tests/lens-cyrus_imapd.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-dovecot.sh b/tests/lens-dovecot.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-erlang.sh b/tests/lens-erlang.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-fonts.sh b/tests/lens-fonts.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-fuse.sh b/tests/lens-fuse.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-gshadow.sh b/tests/lens-gshadow.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-gtkbookmarks.sh b/tests/lens-gtkbookmarks.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-htpasswd.sh b/tests/lens-htpasswd.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-inputrc.sh b/tests/lens-inputrc.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-iproute2.sh b/tests/lens-iproute2.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-jaas.sh b/tests/lens-jaas.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-jettyrealm.sh b/tests/lens-jettyrealm.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-jmxaccess.sh b/tests/lens-jmxaccess.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-jmxpassword.sh b/tests/lens-jmxpassword.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-known_hosts.sh b/tests/lens-known_hosts.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-koji.sh b/tests/lens-koji.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-ldif.sh b/tests/lens-ldif.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-ldso.sh b/tests/lens-ldso.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-lightdm.sh b/tests/lens-lightdm.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-logwatch.sh b/tests/lens-logwatch.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-lvm.sh b/tests/lens-lvm.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-mcollective.sh b/tests/lens-mcollective.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-memcached.sh b/tests/lens-memcached.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-mongodbserver.sh b/tests/lens-mongodbserver.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-netmasks.sh b/tests/lens-netmasks.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-networkmanager.sh b/tests/lens-networkmanager.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-nginx.sh b/tests/lens-nginx.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-ntpd.sh b/tests/lens-ntpd.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-openshift_config.sh b/tests/lens-openshift_config.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-openshift_http.sh b/tests/lens-openshift_http.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-openshift_quickstarts.sh b/tests/lens-openshift_quickstarts.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-pagekite.sh b/tests/lens-pagekite.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-pamconf.sh b/tests/lens-pamconf.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-postfix_transport.sh b/tests/lens-postfix_transport.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-postfix_virtual.sh b/tests/lens-postfix_virtual.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-postgresql.sh b/tests/lens-postgresql.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-protocols.sh b/tests/lens-protocols.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-puppet_auth.sh b/tests/lens-puppet_auth.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-pythonpaste.sh b/tests/lens-pythonpaste.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-qpid.sh b/tests/lens-qpid.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-quote.sh b/tests/lens-quote.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-rabbitmq.sh b/tests/lens-rabbitmq.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-redis.sh b/tests/lens-redis.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-rmt.sh b/tests/lens-rmt.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-rsyslog.sh b/tests/lens-rsyslog.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-shadow.sh b/tests/lens-shadow.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-simplelines.sh b/tests/lens-simplelines.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-simplevars.sh b/tests/lens-simplevars.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-sip_conf.sh b/tests/lens-sip_conf.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-smbusers.sh b/tests/lens-smbusers.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-splunk.sh b/tests/lens-splunk.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-sssd.sh b/tests/lens-sssd.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-subversion.sh b/tests/lens-subversion.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-sysconfig_route.sh b/tests/lens-sysconfig_route.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-systemd.sh b/tests/lens-systemd.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-thttpd.sh b/tests/lens-thttpd.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-tuned.sh b/tests/lens-tuned.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-up2date.sh b/tests/lens-up2date.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-updatedb.sh b/tests/lens-updatedb.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-vfstab.sh b/tests/lens-vfstab.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-vmware_config.sh b/tests/lens-vmware_config.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-xymon.sh b/tests/lens-xymon.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
diff --git a/tests/lens-xymon_alerting.sh b/tests/lens-xymon_alerting.sh
new file mode 100755 (executable)
index 0000000..2916ac0
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+# Run one lens test.
+# Derive names of inputs from the name of this script.
+
+[ -n "$abs_top_srcdir" ] || abs_top_srcdir=$TOPDIR
+LENS_DIR=$abs_top_srcdir/lenses
+
+me=`echo "$0"|sed 's,.*/lens-\(.*\)\.sh$,\1,'`
+
+t=$LENS_DIR/tests/test_$me.aug
+
+if [ -n "$VALGRIND" ] ; then
+  exec $VALGRIND $AUGPARSE --nostdinc -I "$LENS_DIR" "$t"
+else
+  exec augparse --nostdinc -I "$LENS_DIR" "$t"
+fi
index aa63690..7fc4784 100644 (file)
@@ -1,5 +1,5 @@
 module Fail_shadow_union =
-  let lns = store /[a-z]+/ | del /(abc|xyz)/ "never used"
+  let lns = store /[a-z]+/ | del /(abc|xyz)/ "abc"
 
 (* Local Variables: *)
 (* mode: caml       *)
diff --git a/tests/modules/fail_square_consistency.aug b/tests/modules/fail_square_consistency.aug
new file mode 100644 (file)
index 0000000..b1cc3db
--- /dev/null
@@ -0,0 +1,6 @@
+module Fail_square_consistency =
+
+let left = key "a"
+let right = del "b" "b"
+let body = del "x" "x"
+let s = square left body right
diff --git a/tests/modules/fail_square_consistency_del.aug b/tests/modules/fail_square_consistency_del.aug
new file mode 100644 (file)
index 0000000..bff74e8
--- /dev/null
@@ -0,0 +1,6 @@
+module Fail_square_consistency_del =
+
+let left = del /[ab]/ "a"
+let right = del /[ab]/ "b"
+let body = del "x" "x"
+let s = square left body right
diff --git a/tests/modules/fail_square_dup_key.aug b/tests/modules/fail_square_dup_key.aug
new file mode 100644 (file)
index 0000000..0e540da
--- /dev/null
@@ -0,0 +1,6 @@
+module Fail_square_dup_key =
+
+let left = key "a"
+let right = del "a" "a"
+let body = key "a"
+let s = square left body right
diff --git a/tests/modules/fail_square_lens_type.aug b/tests/modules/fail_square_lens_type.aug
new file mode 100644 (file)
index 0000000..f1099e3
--- /dev/null
@@ -0,0 +1,6 @@
+module Fail_square_lens_type =
+
+let left = [ key "a" ]
+let right = [ key "a" ]
+let body = del "x" "x"
+let s = square left body right
index 0795999..d7cf9c3 100644 (file)
@@ -1,8 +1,12 @@
 module Pass_Compose_Func =
 
-  let g (x:string) = ()
+  (* string -> regexp *)
+  let f (x:string) = x . /[a-z]/
 
-  (* Should yield a function string -> unit *)
-  let f = () ; g
+  (* regexp -> lens *)
+  let g (x:regexp) = key x
 
-  let _ = g "a"
+  (* string -> lens *)
+  let h = f ; g
+
+  let _ = h "a"
index ef248f4..33be2b9 100644 (file)
@@ -17,3 +17,9 @@ test lns2 get "Key" = { "2" = "Key" }
 test lns2 get "key" = { "2" = "key" }
 test lns2 get "KEY" = { "2" = "KEY" }
 test lns2 get "KeY" = { "2" = "KeY" }
+
+let lns3 =
+  let rx = /type/i|/flags/i in
+  [ key rx . del "=" "=" . store /[0-9]+/ ]
+
+test lns3 get "FLAGS=1" = { "FLAGS" = "1" }
index 0185031..9262bc8 100644 (file)
@@ -8,17 +8,24 @@ let dels (s:string) = del s s
  *************************************************************************)
 
 (* Simplest square lens *)
-let s = store /[yz]/
-let sqr0 = [ square "x" s ] *
-test sqr0 get "xyxxyxxyx" = { "x" = "y" }{ "x" = "y" }{ "x" = "y" }
-test sqr0 put "xyx" after set "/x[3]" "z" = "xyxxzx"
+let s = store /[ab]/
+let sqr0 =
+       let k = key "x" in
+       let d = dels "x" in
+       [ square k s d ] *
+test sqr0 get "xaxxbxxax" = { "x" = "a" }{ "x" = "b" }{ "x" = "a" }
+test sqr0 put "xax" after set "/x[3]" "b" = "xaxxbx"
 
 (* test mismatch tag *)
 test sqr0 get "xya" = *
 
 (* Test regular expression matching with multiple groups *)
 let body = del /([f]+)([f]+)/ "ff" . del /([g]+)([g]+)/ "gg"
-let sqr1 = [ square /([a-b]*)([a-b]*)([a-b]*)/ body . del /([x]+)([x]+)/ "xx" ] *
+let sqr1 =
+       let k = key /([a-b]*)([a-b]*)([a-b]*)/ in
+       let d1 = del /([a-b]*)([a-b]*)([a-b]*)/ "a" in
+       let d2 = del /([x]+)([x]+)/ "xx" in
+       [ square k body d1 . d2 ] *
 
 test sqr1 get "aaffggaaxxbbffggbbxx" = { "aa" }{ "bb" }
 test sqr1 get "affggaxx" = { "a" }
@@ -26,10 +33,12 @@ test sqr1 put "affggaxx" after clear "/b" = "affggaxxbffggbxx"
 
 (* Test XML like elements up to depth 2 *)
 let b = del ">" ">" . del /[a-z ]*/ "" . del "</" "</"
-let xml = [ del "<" "<" . square /[a-z]+/ b . del ">" ">" ] *
+let open_tag = key /[a-z]+/
+let close_tag = del /[a-z]+/ "a"
+let xml = [ del "<" "<" . square open_tag b close_tag . del ">" ">" ] *
 
 let b2 = del ">" ">" . xml . del "</" "</"
-let xml2 = [ del "<" "<" . square /[a-z]+/ b2 . del ">" ">" ] *
+let xml2 = [ del "<" "<" . square open_tag b2 close_tag . del ">" ">" ] *
 
 test xml get "<a></a><b></b>" = { "a" }{ "b" }
 
@@ -49,66 +58,65 @@ test xml2 put "<a></a>" after clear "/x/y" = "<a></a><x><y></y></x>"
 (* test nested put of depth 3 : should fail *)
 test xml2 put "<a></a>" after clear "/x/y/z" = *
 
-(************************************************************************
- *                        Recursive square lens
- *************************************************************************)
-
-(* Basic element *)
-let xml_element (body:lens) =
-    let g = del ">" ">" . body . del "</" "</" in
-        [ del "<" "<" . square /[a-z]+/ g . del ">" ">" ] *
-
-let rec xml_rec = xml_element xml_rec
-
-test xml_rec get "<a><b><c><d><e></e></d></c></b></a>" =
-  { "a"
-    { "b"
-      { "c"
-        { "d"
-          { "e" }
-        }
-      }
-    }
-  }
-
-test xml_rec get "<a><b></b><c></c><d></d><e></e></a>" =
-  { "a"
-    { "b" }
-    { "c" }
-    { "d" }
-    { "e" }
-  }
-
-test xml_rec put "<a></a><b><c></c></b>" after clear "/x/y/z" = "<a></a><b><c></c></b><x><y><z></z></y></x>"
-
-(* mismatch tag *)
-test xml_rec get "<a></c>" = *
-test xml_rec get "<a><b></b></c>" = *
-test xml_rec get "<a><b></c></a>" = *
-
-(* test ctype_nullable and typecheck *)
-let rec z = [ square "ab" z? ]
-test z get "abab" = { "ab" }
-
-(* test tip handling when using store inside body *)
-let c (body:lens) =
-    let sto = store "c" . body* in
-        [ square "ab" sto ]
-
-let rec cc = c cc
-
-test cc get "abcabcabab" =
-  { "ab" = "c"
-    { "ab" = "c" }
-  }
-
-(* test correct put behavior *)
-let input3 = "aaxyxbbaaaxyxbb"
-let b3 = dels "y"
-let sqr3 = [ del /[a]*/ "a" . square /[x]/ b3 . del /[b]*/ "b" ]*
-test sqr3 get input3 = { "x" }{ "x" }
-test sqr3 put input3 after clear "/x[1]" = input3
-
-let b4 = del "x" "x"
-let rec sqr4 = [ del /[a]+/ "a" . square /[b]|[c]/ (b4|sqr4) ]
-test sqr4 put "aabaaacxcb" after rm "x" = "aabaaacxcb"
+(* matches can be case-insensitive *)
+let s5 = store /[yz]/
+let sqr5 =
+       let k = key /x/i in
+       let d = del /x/i "x" in
+       [ square k s5 d ] *
+test sqr5 get "xyX" = { "x" = "y" }
+test sqr5 get "xyXXyxXyx" = { "x" = "y" }{ "X" = "y" }{ "X" = "y" }
+test sqr5 put "xyX" after set "/x[3]" "z" = "xyxxzx"
+
+(* test concat multiple squares *)
+let rex = /[a-z]/
+let csqr =
+       let k = key rex in
+       let d = del rex "a" in
+       let e = dels "" in
+       [ square k e d . square d e d ] *
+
+test csqr get "aabbccdd" = { "a" } { "c" }
+test csqr put "aabb" after insa "z" "/a" = "aabbzzaa"
+
+(* test default square create values *)
+let create_square =
+       let d = dels "a" in
+       [ key "x" . square d d d ]*
+
+test create_square put "" after clear "/x" = "xaaa"
+
+(* test optional quotes *)
+let word = /[A-Za-z0-9_.-]+/
+let entry =
+  let k = key word in
+  let quote = del /"?/ "\"" (* " *) in
+  let body = store /[a-z]+/ in
+  let v = square quote body quote in
+  [ k . dels "=" . v ]
+
+test entry get "key=\"value\"" = { "key" = "value" }
+test entry get "key=value" = { "key" = "value" }
+
+test entry put "key=value" after
+  set "/key" "other" = "key=other"
+
+test entry put "key=\"value\"" after
+  set "/key" "other" = "key=\"other\""
+
+(* create with square *)
+(* Passing this test successfully requires that the skeleton from the get *)
+(* is correctly detected as not matching the skeleton for the second lens *)
+(* in hte union - the reason for the mismatch is that the quote is        *)
+(* optional in the first branch of the union, and the skeleton therefore  *)
+(* does not have "@" in the right places, triggering a create             *)
+let sq_create =
+  let word = store /[a-z]+/ in
+  let number = store /[0-9]+/ in
+  let quot = dels "@" in
+  let quot_opt = del /@?/ "@" in
+    [ label "t" . square quot_opt word quot_opt ]
+  | [ label "t" . square quot number quot ]
+
+test sq_create put "abc" after
+  set "/t" "42" = "@42@"
diff --git a/tests/modules/pass_square_rec.aug b/tests/modules/pass_square_rec.aug
new file mode 100644 (file)
index 0000000..42bff7b
--- /dev/null
@@ -0,0 +1,139 @@
+module Pass_square_rec =
+
+(*  Utilities lens *)
+let dels (s:string) = del s s
+
+(************************************************************************
+ *                        Recursive square lens
+ *************************************************************************)
+(* test square with left and right as dels *)
+let lr (body:lens) =
+    let k = key "c" . body* in
+    let d = dels "ab" in
+        [ square d k d ]
+
+let rec lr2 = lr lr2
+
+test lr2 get "abcabcabab" =
+  { "c"
+    { "c" }
+  }
+
+let open_tag = key /[a-z]+/
+let close_tag = del /[a-z]+/ "a"
+
+(* Basic element *)
+let xml_element (body:lens) =
+    let g = del ">" ">" . body . del "</" "</" in
+        [ del "<" "<" . square open_tag g close_tag . del ">" ">" ] *
+
+let rec xml_rec = xml_element xml_rec
+
+test xml_rec get "<a><b><c><d><e></e></d></c></b></a>" =
+  { "a"
+    { "b"
+      { "c"
+        { "d"
+          { "e" }
+        }
+      }
+    }
+  }
+
+test xml_rec get "<a><b></b><c></c><d></d><e></e></a>" =
+  { "a"
+    { "b" }
+    { "c" }
+    { "d" }
+    { "e" }
+  }
+
+test xml_rec put "<a></a><b><c></c></b>" after clear "/x/y/z" = "<a></a><b><c></c></b><x><y><z></z></y></x>"
+
+(* mismatch tag *)
+test xml_rec get "<a></c>" = *
+test xml_rec get "<a><b></b></c>" = *
+test xml_rec get "<a><b></c></a>" = *
+
+
+(* test ctype_nullable and typecheck *)
+let rec z =
+       let k = key "ab" in
+       let d = dels "ab" in
+       [ square k z? d ]
+test z get "abab" = { "ab" }
+
+(* test tip handling when using store inside body *)
+let c (body:lens) =
+    let sto = store "c" . body* in
+    let d = dels "ab" in
+    let k = key "ab" in
+        [ square k sto d ]
+
+let rec cc = c cc
+
+test cc get "abcabcabab" =
+  { "ab" = "c"
+    { "ab" = "c" }
+  }
+
+(* test mixing regular and recursive lenses *)
+
+let reg1 =
+       let k = key "y" in
+       let d = dels "y" in
+       let e = dels "" in
+       [ square k e d ]
+
+let reg2 =
+       let k = key "y" in
+       let d = dels "y" in
+       [ square k reg1 d ]
+
+let rec rec2 =
+       let d1 = dels "x" in
+       let k1 = key "x" in
+       let body = reg2 | rec2 in
+       [ square k1 body d1 ]?
+
+test rec2 get "xyyyyx" =
+  { "x"
+    { "y"
+      { "y" }
+    }
+  }
+
+test rec2 put "" after clear "/x/y/y" = "xyyyyx"
+
+(* test correct put behavior *)
+let input3 = "aaxyxbbaaaxyxbb"
+let b3 = dels "y"
+let sqr3 =
+       let k = key /[x]/ in
+       let d = dels "x" in
+       [ del /[a]*/ "a" . square k b3 d . del /[b]*/ "b" ]*
+test sqr3 get input3 = { "x" }{ "x" }
+test sqr3 put input3 after clear "/x[1]" = input3
+
+let b4 = dels "x"
+let rec sqr4 =
+       let k = key /[b]|[c]/ in
+       let d = del /[b]|[c]/ "b" in
+       [ del /[a]+/ "a" . square k (b4|sqr4) d ]
+test sqr4 put "aabaaacxcb" after rm "x" = "aabaaacxcb"
+
+(* test concat multiple squares *)
+let rex = /[a-z]/
+let rec csqr =
+       let k = key rex in
+       let d = del rex "a" in
+       let e = dels "" in
+       [ square k e d . csqr* . square d e d ]
+
+test csqr get "aabbccdd" =
+  { "a"
+    { "b" }
+  }
+
+test csqr put "aabbccdd" after clear "/a" = "aabbccdd"
+test csqr put "aabb" after clear "/a/z" = "aazzaabb"
diff --git a/tests/root/etc/crontab b/tests/root/etc/crontab
deleted file mode 100644 (file)
index 1ac6d26..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-0 0 * * * root echo hello
-1 0 * * * root echo hi
diff --git a/tests/root/etc/gshadow b/tests/root/etc/gshadow
new file mode 100644 (file)
index 0000000..2b11f30
--- /dev/null
@@ -0,0 +1,26 @@
+root:x::root
+bin:x::root,bin,daemon
+daemon:x::root,bin,daemon
+sys:x::root,bin,adm
+adm:x:root,adm:root,adm,daemon
+tty:x::
+disk:x::root
+lp:x::daemon,lp
+mem:x::
+kmem:x::
+wheel:x::root
+mail:x::mail,postfix
+uucp:x::uucp
+man:x::
+games:x::
+gopher:x::
+dip:x::
+ftp:x::
+lock:x::
+nobody:x::
+users:x::
+floppy:x::
+vcsa:x::
+rpc:x::
+rpcuser:x::
+nfsnobody:x::
diff --git a/tests/root/etc/shadow b/tests/root/etc/shadow
new file mode 100644 (file)
index 0000000..fe6fd3f
--- /dev/null
@@ -0,0 +1,19 @@
+root:$5$rounds=1000$TMTRLLOM$h24vGZsHaf6aNdz3dsUuE4z/fy5at1Luuu.FBI6D6M:16200::999999:7:::
+bin:x:16200::999999:7:::
+daemon:x:16200::999999:7:::
+adm:x:16200::999999:7:::
+lp:x:16200::999999:7:::
+sync:x:16200::999999:7:::
+shutdown:x:16200::999999:7:::
+halt:x:16200::999999:7:::
+mail:x:16200::999999:7:::
+uucp:x:16200::999999:7:::
+operator:x:16200::999999:7:::
+games:x:16200::999999:7:::
+gopher:x:16200::999999:7:::
+ftp:x:16200::999999:7:::
+nobody:x:16200::999999:7:::
+vcsa:x:16200::999999:7:::
+rpc:x:16200::999999:7:::
+rpcuser:x:16200::999999:7:::
+nfsnobody:x:16200::999999:7:::
diff --git a/tests/root/etc/squirrelmail/config.php b/tests/root/etc/squirrelmail/config.php
deleted file mode 100644 (file)
index acb6c35..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-<?php
-?>
diff --git a/tests/root/etc/sysconfig/network-scripts/ifcfg-Auto-ALICE-WLAN38_(automatisch) b/tests/root/etc/sysconfig/network-scripts/ifcfg-Auto-ALICE-WLAN38_(automatisch)
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/root/etc/sysconfig/network-scripts/ifcfg-Auto_FRITZ!Box_Fon_WLAN_7112 b/tests/root/etc/sysconfig/network-scripts/ifcfg-Auto_FRITZ!Box_Fon_WLAN_7112
new file mode 100644 (file)
index 0000000..9dde9f5
--- /dev/null
@@ -0,0 +1,14 @@
+ESSID="FRITZ!Box Fon WLAN 7112"
+MODE=Managed
+KEY_MGMT=WPA-PSK
+WPA_PSK_FLAGS=user
+TYPE=Wireless
+BOOTPROTO=dhcp
+DEFROUTE=yes
+IPV4_FAILURE_FATAL=yes
+NAME="Auto FRITZ!Box Fon WLAN 7112"
+ONBOOT=yes
+PEERDNS=yes
+PEERROUTES=yes
+IPV6INIT=no
+USERS=lutter
diff --git a/tests/root/etc/sysconfig/network-scripts/ifcfg-lo.rpmsave b/tests/root/etc/sysconfig/network-scripts/ifcfg-lo.rpmsave
new file mode 100644 (file)
index 0000000..cb4f3f9
--- /dev/null
@@ -0,0 +1,9 @@
+DEVICE=lo
+IPADDR=127.0.0.1
+NETMASK=255.0.0.0
+NETWORK=127.0.0.0
+# If you're having problems with gated making 127.0.0.0/8 a martian,
+# you can change this to something else (255.255.255.255, for example)
+BROADCAST=127.255.255.255
+ONBOOT=yes
+NAME=loopback
diff --git a/tests/root/etc/sysconfig/network-scripts/ifcfg-weird [!] (used to fail) b/tests/root/etc/sysconfig/network-scripts/ifcfg-weird [!] (used to fail)
new file mode 100644 (file)
index 0000000..08cf100
--- /dev/null
@@ -0,0 +1,4 @@
+# This file is only here to make sure augeas handles truly bizarre
+# file names gracefully. Looking this file up in the tree will require
+# escaping all the special chars in the file name
+DEVICE=weird
diff --git a/tests/root/lvm.conf~ b/tests/root/lvm.conf~
new file mode 100644 (file)
index 0000000..5cafa99
--- /dev/null
@@ -0,0 +1,59 @@
+# Generated by LVM2 version 2.02.95(2)-RHEL6 (2012-10-16): Tue Apr 23 22:51:14 2013
+
+contents = "Text Format Volume Group"
+version = 1
+
+description = "Created *before* executing '/sbin/vgs --noheadings -o name --config 'log{command_names=0 prefix=\"  \"}''"
+
+creation_host = "host.example.com"  # Linux host.example.com 2.6.32-279.11.1.el6.x86_64 #1 SMP Sat Sep 22 07:10:26 EDT 2012 x86_64
+creation_time = 1366757474  # Tue Apr 23 22:51:14 2013
+
+vg_system {
+    id = "5dtHTQ-pvA6-s1r0-Iqck-Cc34-GDdt-MJK782"
+    seqno = 2
+    format = "lvm2" # informational
+    status = ["RESIZEABLE", "READ", "WRITE"]
+    flags = []
+    extent_size = 8192      # 4 Megabytes
+    max_lv = 0
+    max_pv = 0
+    metadata_copies = 0
+
+    physical_volumes {
+
+        pv0 {
+            id = "AOXPQ6-hkrg-2z0g-FiJN-DvLk-aySL-0qrH5P"
+            device = "/dev/vda3"    # Hint only
+
+            status = ["ALLOCATABLE"]
+            flags = []
+            dev_size = 20445184 # 9.74902 Gigabytes
+            pe_start = 2048
+            pe_count = 2495 # 9.74609 Gigabytes
+        }
+    }
+
+    logical_volumes {
+
+        lv_root {
+            id = "pm03oc-AehK-DcvV-PvOj-1fzC-FWYc-qvDcAS"
+            status = ["READ", "WRITE", "VISIBLE"]
+            flags = []
+            creation_host = "host.example.com"
+            creation_time = 1366757292  # 2013-04-23 22:48:12 +0000
+            segment_count = 1
+
+            segment1 {
+                start_extent = 0
+                extent_count = 2495 # 9.74609 Gigabytes
+
+                type = "striped"
+                stripe_count = 1    # linear
+
+                stripes = [
+                    "pv0", 0
+                ]
+            }
+        }
+    }
+}
index c11f094..39f8153 100644 (file)
@@ -5,6 +5,7 @@
 #
 # The syntax for a test specification is
 #   test NAME RESULT ERRCODE
+#   [use MODULE]
 #     COMMANDS
 #   prints
 #     OUTPUT
@@ -16,6 +17,7 @@
 #   ERRCODE  - one of the error codes defined in enum errcode_t in augeas.h
 #              without the AUG_ prefix, i.e. NOERROR, EMMATCH etc. If ERRCODE
 #              is ommitted, it defaults to NOERROR
+#   MODULE   - the name of a module that should be loaded before the test
 #   COMMANDS - the commands to hand to aug_srun; can be multiple lines,
 #              which are passed as one string.
 #   OUTPUT   - the string that aug_srun should print on the OUT file stream
@@ -31,7 +33,8 @@
 # OUT stream.
 #
 # The test is run against a tree initialized with AUG_NO_STDINC|AUG_NO_LOAD
-# and file system root /dev/null
+# and file system root /dev/null. The Hosts module is loaded
+
 
 #
 # Various corner cases
@@ -210,6 +213,58 @@ prints
   /x/y/b/c = "value"
 
 #
+# test rename
+#
+test rename 1
+  rename /augeas/version version2
+prints
+  rename : /augeas/version to version2 1
+
+test rename-into-self 1
+  rename /augeas augeas
+prints
+  rename : /augeas to augeas 1
+
+test rename-tree1 3
+  set /a/b/c value
+  rename /a/b/c x
+  print /*[ label() != 'augeas' and label() != 'files']
+prints
+  rename : /a/b/c to x 1
+  /a
+  /a/b
+  /a/b/x = "value"
+
+test rename-tree2 4
+  set /a/b/c value
+  set /a/b/d value2
+  rename /a/b/c x
+  print /*[ label() != 'augeas' and label() != 'files']
+prints
+  rename : /a/b/c to x 1
+  /a
+  /a/b
+  /a/b/x = "value"
+  /a/b/d = "value2"
+
+test rename-multiple 4
+  set /a/b/d value
+  set /a/c/d value2
+  rename //d x
+  print /*[ label() != 'augeas' and label() != 'files']
+prints
+  rename : //d to x 2
+  /a
+  /a/b
+  /a/b/x = "value"
+  /a/c
+  /a/c/x = "value2"
+
+test rename-slash -1 ELABEL
+  set /a/b/c value
+  rename /a/b/c va/lue
+
+#
 # test set
 #
 test set-not-there 2
@@ -236,8 +291,99 @@ test set-bad-pathx -1 EPATHX
 test set-multiple -1 EMMATCH
   set /augeas/version/save/mode value
 
-test set-args -1 ECMDRUN
+test set-args 2
   set /files
+  get /files
+prints
+  /files (none)
+#
+# test clear
+#
+test clear-not-there 2
+  clear /foo
+  get /foo
+prints
+  /foo (none)
+
+test clear-existing 2
+  clear /files
+  get /files
+prints
+  /files (none)
+
+test clear-bad-pathx -1 EPATHX
+  clear /files[]
+
+test clear-multiple -1 EMMATCH
+  clear /augeas/version/save/mode
+
+test clear-args -1 ECMDRUN
+  clear /files value
+
+#
+# test get
+#
+test get-save-mode 1
+  get /augeas/version/save/mode[1]
+prints
+ /augeas/version/save/mode[1] = backup
+
+test get-too-many -1 EMMATCH
+  get /augeas/*
+
+test get-not-there 1
+  get /not-there
+prints
+  /not-there (o)
+
+test get-bad-pathx -1 EPATHX
+  get /files[]
+
+#
+# test transform
+#
+test transform-1 3
+  transform Test incl /tmp/bar
+  get /augeas/load/Test/lens
+  get /augeas/load/Test/incl
+prints
+  /augeas/load/Test/lens = Test.lns
+  /augeas/load/Test/incl = /tmp/bar
+
+test transform-2 4
+  transform Bar incl /tmp/foo/*
+  transform Bar incl /tmp/bar/*
+  transform Bar excl /tmp/foo/baz
+  print /augeas/load/Bar
+prints
+  /augeas/load/Bar
+  /augeas/load/Bar/lens = "Bar.lns"
+  /augeas/load/Bar/incl[1] = "/tmp/foo/*"
+  /augeas/load/Bar/incl[2] = "/tmp/bar/*"
+  /augeas/load/Bar/excl = "/tmp/foo/baz"
+
+test transform-3 2
+  transform Bar.lns incl /tmp/foo/*
+  print /augeas/load/Bar
+prints
+  /augeas/load/Bar
+  /augeas/load/Bar/lens = "Bar.lns"
+  /augeas/load/Bar/incl = "/tmp/foo/*"
+
+#
+# test print
+#
+test print-save 1
+  print /augeas/version/save
+prints
+  /augeas/version/save
+  /augeas/version/save/mode[1] = "backup"
+  /augeas/version/save/mode[2] = "newfile"
+  /augeas/version/save/mode[3] = "noop"
+  /augeas/version/save/mode[4] = "overwrite"
+
+test print-root 1
+  print /
 
 #
 # test set/get parsing with quoting, whitespace and escaping
@@ -266,6 +412,18 @@ test set-mixed-quotes2 2
 prints
   /files = a "mixed quotes" test
 
+test set-mixed-quotes-expr 2
+  clear /foo
+  print "/*[ label() != 'augeas' and label() != 'files']"
+prints
+  /foo
+
+test set-quote-concat 2
+  set "/fi"les test
+  get "/fi"les
+prints
+  /files = test
+
 test set-escaped-quotes 2
   set /files "''\"''"
   get /files
@@ -302,60 +460,345 @@ test set-dquote-escaped-path 2
 prints
   /white\ space = value
 
-#
-# test clear
-#
-test clear-not-there 2
-  clear /foo
-  get /foo
+test set-tabnline 2
+  set /files newl\ntab\tend
+  get /files
 prints
-  /foo (none)
+  /files = newl
+tab    end
 
-test clear-existing 2
-  clear /files
+test set-tabnline-squote 2
+  set /files 'newl\ntab\tend'
   get /files
 prints
-  /files (none)
+  /files = newl
+tab    end
 
-test clear-bad-pathx -1 EPATHX
-  clear /files[]
+test set-tabnline-dquote 2
+  set /files "newl\ntab\tend"
+  get /files
+prints
+  /files = newl
+tab    end
 
-test clear-multiple -1 EMMATCH
-  clear /augeas/version/save/mode
+# Combinations of quotes in values, some unmatched
+# Tests from David Schmitt (Puppet bug #12199)
+test quot_sq -1 ECMDRUN
+  set /test '
 
-test clear-args -1 ECMDRUN
-  clear /files value
+test quot_sq_sq -1 ECMDRUN
+  set /test '''
 
-#
-# test get
-#
-test get-save-mode 1
-  get /augeas/version/save/mode[1]
+test quot_sq_dq 2
+  set /test "'"
+  get /test
 prints
- /augeas/version/save/mode[1] = backup
+  /test = '
 
-test get-too-many -1 EMMATCH
-  get /augeas/*
+test quot_sqsq 2
+  set /test ''
+  get /test
+prints
+  /test = :
 
-test get-not-there 1
-  get /not-there
+test quot_sqsq_sq 2
+  set /test ''''
+  get /test
 prints
-  /not-there (o)
+  /test = :
 
-test get-bad-pathx -1 EPATHX
-  get /files[]
+test quot_sqsq_dq 2
+  set /test "''"
+  get /test
+prints
+  /test = ''
+
+test quot_sqsqsq -1 ECMDRUN
+  set /test '''
+
+test quot_sqsqsq_sq -1 ECMDRUN
+  set /test '''''
+
+test quot_sqsqsq_dq 2
+  set /test "'''"
+  get /test
+prints
+  /test = '''
+
+test quot_sqsqsqsq 2
+  set /test ''''
+  get /test
+prints
+  /test = :
+
+test quot_sqsqsqsq_sq 2
+  set /test ''''''
+  get /test
+prints
+  /test = :
+
+test quot_sqsqsqsq_dq 2
+  set /test "''''"
+  get /test
+prints
+  /test = ''''
+
+test quot_dq -1 ECMDRUN
+  set /test "
+
+test quot_dq_sq 2
+  set /test '"'
+  get /test
+prints
+  /test = "
+
+test quot_dq_dq -1 ECMDRUN
+  set /test """
+
+test quot_dqdq 2
+  set /test ""
+  get /test
+prints
+  /test = :
+
+test quot_dqdq_sq 2
+  set /test '""'
+  get /test
+prints
+  /test = ""
+
+test quot_dqdq_dq 2
+  set /test """"
+  get /test
+prints
+  /test = :
+
+test quot_dqdqdq -1 ECMDRUN
+  set /test """
+
+test quot_dqdqdq_sq 2
+  set /test '"""'
+  get /test
+prints
+  /test = """
+
+test quot_dqdqdq_dq -1 ECMDRUN
+  set /test """""
+
+test quot_dqdqdqdq 2
+  set /test """"
+  get /test
+prints
+  /test = :
+
+test quot_dqdqdqdq_sq 2
+  set /test '""""'
+  get /test
+prints
+  /test = """"
+
+test quot_dqdqdqdq_dq 2
+  set /test """"""
+  get /test
+prints
+  /test = :
+
+test quot_truncated_dq 2
+  set /test "s"bc"d"ef
+  get /test
+prints
+  /test = sbcdef
+
+test quot_truncated_dq_sq 2
+  set /test '"s"bc"d"ef'
+  get /test
+prints
+  /test = "s"bc"d"ef
+
+test quot_truncated_dq_dq 2
+  set /test ""s"bc"d"ef"
+  get /test
+prints
+  /test = sbcdef
+
+test quot_truncated_sq 2
+  set /test 's'bc'd'ef
+  get /test
+prints
+  /test = sbcdef
+
+test quot_truncated_sq_sq 2
+  set /test ''s'bc'd'ef'
+  get /test
+prints
+  /test = sbcdef
+
+test quot_truncated_sq_dq 2
+  set /test "'s'bc'd'ef"
+  get /test
+prints
+  /test = 's'bc'd'ef
+
+test quot_truncated_dq_mix 2
+  set /test "s"bc'd'ef
+  get /test
+prints
+  /test = sbcdef
+
+test quot_truncated_dq_mix_sq 2
+  set /test '"s"bc'd'ef'
+  get /test
+prints
+  /test = "s"bcdef
+
+test quot_truncated_dq_mix_dq 2
+  set /test ""s"bc'd'ef"
+  get /test
+prints
+  /test = sbc'd'ef
+
+test quot_truncated_sq_mix 2
+  set /test 's'bc"d"ef
+  get /test
+prints
+  /test = sbcdef
+
+test quot_truncated_sq_mix_sq 2
+  set /test ''s'bc"d"ef'
+  get /test
+prints
+  /test = sbc"d"ef
+
+test quot_truncated_sq_mix_dq 2
+  set /test "'s'bc"d"ef"
+  get /test
+prints
+  /test = 's'bcdef
+
+test quot_truncated_space -1 ECMDRUN
+  set /test before after
+
+test quot_truncated_space_sq 2
+  set /test 'before after'
+  get /test
+prints
+  /test = before after
+
+test quot_truncated_space_dq 2
+  set /test "before after"
+  get /test
+prints
+  /test = before after
+
+test quot_mix -1 ECMDRUN
+  set /test a"b'c"d'e
+
+test quot_mix_sq -1 ECMDRUN
+  set /test 'a"b'c"d'e'
+
+test quot_mix_dq -1 ECMDRUN
+  set /test "a"b'c"d'e"
 
 #
-# test print
+# Tests for aug_text_store
 #
-test print-save 1
-  print /augeas/version/save
-prints
-  /augeas/version/save
-  /augeas/version/save/mode[1] = "backup"
-  /augeas/version/save/mode[2] = "newfile"
-  /augeas/version/save/mode[3] = "noop"
-  /augeas/version/save/mode[4] = "overwrite"
+test store_hosts 3
+ use Hosts
+  set /text/in/t1 "192.168.0.1 rtr.example.com foo\n"
+  store Hosts.lns /text/in/t1 /text/tree/t1
+  print /text/tree/t1
+prints
+  /text/tree/t1
+  /text/tree/t1/1
+  /text/tree/t1/1/ipaddr = "192.168.0.1"
+  /text/tree/t1/1/canonical = "rtr.example.com"
+  /text/tree/t1/1/alias = "foo"
+
+test store_nolens -1 ENOLENS
+  set /text/in/t1 "192.168.0.1 rtr.example.com foo\n"
+  store Nomodule.lns /text/in/t1 /text/tree/t1
+
+test store_epathx_node -1 EPATHX
+ use Hosts
+  store Hosts.lns [garbage] /text/tree/t1
+
+test store_epathx_path -1 EPATHX
+ use Hosts
+  store Hosts.lns /text/in/t1 [garbage]
+
+test store_null_text -1 ENOMATCH
+ use Hosts
+  store Hosts.lns /text/in/t1 /text/tree/t1
+
+test store_esyntax 3
+ use Hosts
+  set /text/in/t1 "not a hosts file entry"
+  store Hosts.lns /text/in/t1 /text/tree/t1
+  match /augeas/text/text/tree/t1/error
+prints
+  /augeas/text/text/tree/t1/error = parse_failed
+
+# Bug #283; /text is actually NULL
+test store_null -1 ENOMATCH
+ use Hosts
+  set /text/1 "192.168.0.1 toto\n"
+  store Hosts.lns /text /hosts
 
-test print-root 1
-  print /
+#
+# Tests for aug_text_retrieve
+#
+test retrieve_hosts 5
+ use Hosts
+  set /text/in/t1 "192.168.0.1 rtr.example.com foo\n"
+  store Hosts.lns /text/in/t1 /text/tree/t1
+  set /text/tree/t1/1/alias[1] bar
+  retrieve Hosts.lns /text/in/t1 /text/tree/t1 /text/out/t1
+  print /text/out/t1
+prints
+  /text/out/t1 = "192.168.0.1 rtr.example.com bar\n"
+
+test retrieve_nolens -1 ENOLENS
+  set /text/in/t1 "192.168.0.1 rtr.example.com foo\n"
+  store Hosts.lns /text/in/t1 /text/tree/t1
+  retrieve Nomodule.lns /text/in/t1 /text/tree/t1 /text/out/t1
+
+test retrieve_epathx_node_in -1 EPATHX
+ use Hosts
+  retrieve Hosts.lns [garbage] /text/tree/t1 /text/out/t1
+
+test retrieve_epathx_path -1 EPATHX
+ use Hosts
+  retrieve Hosts.lns /text/in/t1 [garbage] /text/out/t1
+
+test retrieve_epathx_node_out -1 EPATHX
+ use Hosts
+  set /text/in/t1 "192.168.0.1 rtr.example.com foo\n"
+  retrieve Hosts.lns /text/in/t1 /text/tree/t1 [garbage]
+
+test retrieve_no_node_in -1 ENOMATCH
+ use Hosts
+  retrieve Hosts.lns /text/in/t1 /text/tree/t1 /text/out/t1
+
+test retrieve_no_tree 3
+ use Hosts
+  set /text/in/t1 "192.168.0.1 rtr.example.com foo\n"
+  retrieve Hosts.lns /text/in/t1 /text/tree/t1 /text/out/t1
+  print /text/out/t1
+prints
+  /text/out/t1 = ""
+
+test retrieve_esyntax 5
+ use Hosts
+  set /text/in/t1 "192.168.0.1 rtr.example.com foo\n"
+  store Hosts.lns /text/in/t1 /text/tree/t1
+  set /text/in/t1 "not a hosts file entry"
+  retrieve Hosts.lns /text/in/t1 /text/tree/t1 /text/out/t1
+  match /augeas//error
+prints
+  /augeas/text/text/tree/t1/error = parse_skel_failed
+
+# Bug #283; /text is actually NULL
+test retrieve_null -1 ENOMATCH
+ use Hosts
+  set /text/1 "192.168.0.1 toto\n"
+  retrieve Hosts.lns /text /hosts /out
index b8ad83a..9367c27 100644 (file)
@@ -44,6 +44,7 @@ static char *loadpath;
 static void testGet(CuTest *tc) {
     int r;
     const char *value;
+    const char *label;
     struct augeas *aug;
 
     aug = aug_init(root, loadpath, AUG_NO_STDINC|AUG_NO_LOAD);
@@ -73,6 +74,24 @@ static void testGet(CuTest *tc) {
     CuAssertPtrEquals(tc, NULL, value);
     CuAssertIntEquals(tc, AUG_EMMATCH, aug_error(aug));
 
+    /* aug_label returns 1 and the label if exactly one node matches */
+    r = aug_label(aug, "/augeas/version/save/*[1]", &label);
+    CuAssertIntEquals(tc, 1, r);
+    CuAssertPtrNotNull(tc, label);
+    CuAssertIntEquals(tc, AUG_NOERROR, aug_error(aug));
+
+    /* aug_label returns 0 and no label when no node matches */
+    r = aug_label(aug, "/augeas/version/save/*[ last() + 1 ]", &label);
+    CuAssertIntEquals(tc, 0, r);
+    CuAssertPtrEquals(tc, NULL, label);
+    CuAssertIntEquals(tc, AUG_NOERROR, aug_error(aug));
+
+    /* aug_label should return an error when multiple nodes match */
+    r = aug_label(aug, "/augeas/version/save/*", &label);
+    CuAssertIntEquals(tc, -1, r);
+    CuAssertPtrEquals(tc, NULL, label);
+    CuAssertIntEquals(tc, AUG_EMMATCH, aug_error(aug));
+
     /* augeas should prepend context if relative path given */
     r = aug_set(aug, "/augeas/context", "/augeas/version");
     r = aug_get(aug, "save/*[1]", &value);
@@ -94,6 +113,14 @@ static void testGet(CuTest *tc) {
     CuAssertPtrNotNull(tc, value);
     CuAssertIntEquals(tc, AUG_NOERROR, aug_error(aug));
 
+    /* augeas should create non-existent context path */
+    r = aug_set(aug, "/augeas/context", "/context/foo");
+    r = aug_set(aug, "bar", "value");
+    r = aug_get(aug, "/context/foo/bar", &value);
+    CuAssertIntEquals(tc, 1, r);
+    CuAssertPtrNotNull(tc, value);
+    CuAssertIntEquals(tc, AUG_NOERROR, aug_error(aug));
+
     aug_close(aug);
 }
 
@@ -407,6 +434,75 @@ static void testMv(CuTest *tc) {
     aug_close(aug);
 }
 
+static void testCp(CuTest *tc) {
+    struct augeas *aug;
+    int r;
+    const char *value;
+
+    aug = aug_init(root, loadpath, AUG_NO_STDINC|AUG_NO_LOAD);
+    CuAssertPtrNotNull(tc, aug);
+    r = aug_load(aug);
+    CuAssertRetSuccess(tc, r);
+
+    r = aug_set(aug, "/a/b/c", "value");
+    CuAssertRetSuccess(tc, r);
+
+    r = aug_cp(aug, "/a/b/c", "/a/b/c/d");
+    CuAssertIntEquals(tc, -1, r);
+    CuAssertIntEquals(tc, AUG_ECPDESC, aug_error(aug));
+
+    // Copy recursive tree with empty label
+    r = aug_cp(aug, "/files/etc/logrotate.d/rpm/rule/create", "/files/etc/logrotate.d/acpid/rule/create");
+    CuAssertRetSuccess(tc, r);
+
+    // Check empty label
+    r = aug_get(aug, "/files/etc/logrotate.d/rpm/rule/create", &value);
+    CuAssertIntEquals(tc, 1, r);
+    CuAssertStrEquals(tc, NULL, value);
+
+    // Check that copies are well separated
+    r = aug_set(aug, "/files/etc/logrotate.d/rpm/rule/create/mode", "1234");
+    CuAssertRetSuccess(tc, r);
+    r = aug_set(aug, "/files/etc/logrotate.d/acpid/rule/create/mode", "5678");
+    CuAssertRetSuccess(tc, r);
+    r = aug_get(aug, "/files/etc/logrotate.d/rpm/rule/create/mode", &value);
+    CuAssertIntEquals(tc, 1, r);
+    CuAssertStrEquals(tc, "1234", value);
+    r = aug_get(aug, "/files/etc/logrotate.d/acpid/rule/create/mode", &value);
+    CuAssertIntEquals(tc, 1, r);
+    CuAssertStrEquals(tc, "5678", value);
+
+    aug_close(aug);
+}
+
+
+static void testRename(CuTest *tc) {
+    struct augeas *aug;
+    int r;
+
+    aug = aug_init(root, loadpath, AUG_NO_STDINC|AUG_NO_LOAD);
+    CuAssertPtrNotNull(tc, aug);
+
+    r = aug_set(aug, "/a/b/c", "value");
+    CuAssertRetSuccess(tc, r);
+
+    r = aug_rename(aug, "/a/b/c", "d");
+    CuAssertIntEquals(tc, 1, r);
+
+    r = aug_set(aug, "/a/e/d", "value2");
+    CuAssertRetSuccess(tc, r);
+
+    // Multiple rename
+    r = aug_rename(aug, "/a//d", "x");
+    CuAssertIntEquals(tc, 2, r);
+
+    // Label with a /
+    r = aug_rename(aug, "/a/e/x", "a/b");
+    CuAssertIntEquals(tc, -1, r);
+    CuAssertIntEquals(tc, AUG_ELABEL, aug_error(aug));
+
+    aug_close(aug);
+}
 
 static void testToXml(CuTest *tc) {
     struct augeas *aug;
@@ -435,9 +531,100 @@ static void testToXml(CuTest *tc) {
     value = xmlGetProp(xmldoc, BAD_CAST "label");
     CuAssertStrEquals(tc, "root", (const char*)value);
 
+    /* Bug #239 */
+    r = aug_set(aug, "/augeas/context", "/files/etc/passwd");
+    CuAssertRetSuccess(tc, r);
+    r = aug_to_xml(aug, ".", &xmldoc, 0);
+    CuAssertRetSuccess(tc, r);
+    xmldoc = xmlFirstElementChild(xmldoc);
+    value = xmlGetProp(xmldoc, BAD_CAST "label");
+    CuAssertStrEquals(tc, "passwd", (const char*)value);
+
     aug_close(aug);
 }
 
+static void testTextStore(CuTest *tc) {
+    static const char *const hosts = "192.168.0.1 rtr.example.com router\n";
+    /* Not acceptable for Hosts.lns - missing canonical and \n */
+    static const char *const hosts_bad = "192.168.0.1";
+    const char *v;
+
+    struct augeas *aug;
+    int r;
+
+    aug = aug_init(root, loadpath, AUG_NO_STDINC|AUG_NO_LOAD);
+    CuAssertPtrNotNull(tc, aug);
+
+    r = aug_set(aug, "/raw/hosts", hosts);
+    CuAssertRetSuccess(tc, r);
+
+    r = aug_text_store(aug, "Hosts.lns", "/raw/hosts", "/t1");
+    CuAssertRetSuccess(tc, r);
+
+    r = aug_match(aug, "/t1/*", NULL);
+    CuAssertIntEquals(tc, 1, r);
+
+    /* Test bad lens name */
+    r = aug_text_store(aug, "Notthere.lns", "/raw/hosts", "/t2");
+    CuAssertIntEquals(tc, -1, r);
+    CuAssertIntEquals(tc, AUG_ENOLENS, aug_error(aug));
+
+    r = aug_match(aug, "/t2", NULL);
+    CuAssertIntEquals(tc, 0, r);
+
+    /* Test parse error */
+    r = aug_set(aug, "/raw/hosts_bad", hosts_bad);
+    CuAssertRetSuccess(tc, r);
+
+    r = aug_text_store(aug, "Hosts.lns", "/raw/hosts_bad", "/t3");
+    CuAssertIntEquals(tc, -1, r);
+
+    r = aug_match(aug, "/t3", NULL);
+    CuAssertIntEquals(tc, 0, r);
+
+    r = aug_get(aug, "/augeas/text/t3/error", &v);
+    CuAssertIntEquals(tc, 1, r);
+    CuAssertStrEquals(tc, "parse_failed", v);
+
+    r = aug_text_store(aug, "Hosts.lns", "/raw/hosts", "/t3");
+    CuAssertRetSuccess(tc, r);
+
+    r = aug_match(aug, "/augeas/text/t3/error", NULL);
+    CuAssertIntEquals(tc, 0, r);
+
+    /* Test invalid PATH */
+    r = aug_text_store(aug, "Hosts.lns", "/raw/hosts", "[garbage]");
+    CuAssertIntEquals(tc, -1, r);
+    CuAssertIntEquals(tc, AUG_EPATHX, aug_error(aug));
+
+    r = aug_match(aug, "/t2", NULL);
+    CuAssertIntEquals(tc, 0, r);
+}
+
+static void testTextRetrieve(CuTest *tc) {
+    static const char *const hosts = "192.168.0.1 rtr.example.com router\n";
+    const char *hosts_out;
+    struct augeas *aug;
+    int r;
+
+    aug = aug_init(root, loadpath, AUG_NO_STDINC|AUG_NO_LOAD);
+    CuAssertPtrNotNull(tc, aug);
+
+    r = aug_set(aug, "/raw/hosts", hosts);
+    CuAssertRetSuccess(tc, r);
+
+    r = aug_text_store(aug, "Hosts.lns", "/raw/hosts", "/t1");
+    CuAssertRetSuccess(tc, r);
+
+    r = aug_text_retrieve(aug, "Hosts.lns", "/raw/hosts", "/t1", "/out/hosts");
+    CuAssertRetSuccess(tc, r);
+
+    r = aug_get(aug, "/out/hosts", &hosts_out);
+    CuAssertIntEquals(tc, 1, r);
+
+    CuAssertStrEquals(tc, hosts, hosts_out);
+}
+
 int main(void) {
     char *output = NULL;
     CuSuite* suite = CuSuiteNew();
@@ -451,7 +638,11 @@ int main(void) {
     SUITE_ADD_TEST(suite, testDefNodeCreateMeta);
     SUITE_ADD_TEST(suite, testNodeInfo);
     SUITE_ADD_TEST(suite, testMv);
+    SUITE_ADD_TEST(suite, testCp);
+    SUITE_ADD_TEST(suite, testRename);
     SUITE_ADD_TEST(suite, testToXml);
+    SUITE_ADD_TEST(suite, testTextStore);
+    SUITE_ADD_TEST(suite, testTextRetrieve);
 
     abs_top_srcdir = getenv("abs_top_srcdir");
     if (abs_top_srcdir == NULL)
index b102965..4c92c83 100755 (executable)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 
 # Make sure changing the value of root works
 
index a0d11f3..560cbf5 100755 (executable)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 
 TOP_DIR=$(cd $(dirname $0)/.. && pwd)
 TOP_BUILDDIR="$abs_top_builddir"
@@ -13,6 +13,9 @@ export PATH="$TOP_BUILDDIR/src:${PATH}"
 export AUGEAS_ROOT="$TOP_BUILDDIR/build/test-augtool"
 export AUGEAS_LENS_LIB="$TOP_SRCDIR/lenses"
 
+GSED=sed
+type gsed >/dev/null 2>&1 && GSED=gsed
+
 fail() {
     [ -z "$failed" ] && echo FAIL
     failed=yes
@@ -66,14 +69,15 @@ quit"
     if [ ! -f "${abs_file}.augnew" ]; then
         fail "Expected file $file.augnew"
     else
+        safe_augeas_root=$(printf "%s\n" "$AUGEAS_ROOT" | sed 's/[][\.*^$(){}?+|/]/\\&/g')
         act=$(diff -u "$abs_file" "${abs_file}.augnew" \
-            | sed -r -e "s/^ $//;s!^(---|\+\+\+) ${AUGEAS_ROOT}($file(\.augnew)?)(.*)\$!\1 \2!;s/\\t/\\\\t/g")
+            | $GSED -r -e "s/^ $//;s!^(---|\+\+\+) ${safe_augeas_root}($file(\.augnew)?)(.*)\$!\1 \2!;s/\\t/\\\\t/g")
 
         if [ "$act" != "$diff" ] ; then
             fail "$act"
         fi
     fi
-    other_files=$(find "$AUGEAS_ROOT" -name \*.augnew -not -path "$abs_file.augnew")
+    other_files=$(find "$AUGEAS_ROOT" -name \*.augnew | grep -v "$abs_file.augnew")
     [ -n "$other_files" ] && fail "Unexpected file(s) $other_files"
     [ -z "$failed" ] && echo OK
 done
index ebddf10..0e90f5e 100755 (executable)
@@ -5,9 +5,11 @@
 # supplementary group
 
 run_augtool() {
+savemode=$1
 augtool --nostdinc -r $root -I $abs_top_srcdir/lenses <<EOF
+set /augeas/save $savemode
 set /files/etc/hosts/1/ipaddr 127.0.1.1
-set /files/etc/grub.conf/default 3
+set /files/boot/grub/menu.lst/default 3
 set /files/etc/inittab/1/action fake
 rm /files/etc/puppet/puppet.conf
 set /files/etc/yum.repos.d/fedora.repo/fedora/enabled 0
@@ -18,24 +20,28 @@ EOF
 
 root=$abs_top_builddir/build/test-events-saved
 
-rm -rf $root
-mkdir -p $root
-cp -pr $abs_top_srcdir/tests/root/* $root
-chmod -R u+w $root
+for savemode in overwrite backup newfile noop; do
+    rm -rf $root
+    mkdir -p $root
+    cp -pr $abs_top_srcdir/tests/root/* $root
+    chmod -R u+w $root
 
-saved=$(run_augtool | grep ^/augeas/events/saved | cut -d ' ' -f 3 | sort | tr '\n' ' ')
-exp="/files/etc/grub.conf /files/etc/hosts /files/etc/inittab /files/etc/puppet/puppet.conf /files/etc/yum.repos.d/fedora.repo "
+    saved=$(run_augtool $savemode | grep ^/augeas/events/saved | cut -d ' ' -f 3 | sort | tr '\n' ' ')
+    exp="/files/boot/grub/menu.lst /files/etc/hosts /files/etc/inittab /files/etc/puppet/puppet.conf /files/etc/yum.repos.d/fedora.repo "
 
-if [ -f "$root/etc/puppet/puppet.conf" ]
-then
-  echo "File /etc/puppet/puppet.conf should have been deleted"
-  exit 1
-fi
+    if [ -f "$root/etc/puppet/puppet.conf" -a "$savemode" != "noop" ]
+    then
+        echo "Save mode: $savemode"
+        echo "File /etc/puppet/puppet.conf should have been deleted"
+        exit 1
+    fi
 
-if [ "$saved" != "$exp" ]
-then
-    echo "Unexpected entries in /augeas/events/saved:"
-    echo "Expected: \"$exp\""
-    echo "Actual:   \"$saved\""
-    exit 1
-fi
+    if [ "$saved" != "$exp" ]
+    then
+        echo "Unexpected entries in /augeas/events/saved:"
+        echo "Expected: \"$exp\""
+        echo "Actual:   \"$saved\""
+        echo "Save mode: $savemode"
+        exit 1
+    fi
+done
index b1018e1..fb63a62 100644 (file)
@@ -21,6 +21,8 @@
  */
 
 #include <config.h>
+#include <sys/types.h>
+#include <unistd.h>
 
 #include "augeas.h"
 
@@ -38,10 +40,8 @@ static char *loadpath;
         exit(EXIT_FAILURE);                                         \
     } while(0)
 
-static struct augeas *setup_writable_hosts(CuTest *tc) {
+static char *setup_hosts(CuTest *tc) {
     char *etcdir, *build_root;
-    struct augeas *aug = NULL;
-    int r;
 
     if (asprintf(&build_root, "%s/build/test-load/%s",
                  abs_top_builddir, tc->name) < 0) {
@@ -51,11 +51,18 @@ static struct augeas *setup_writable_hosts(CuTest *tc) {
     if (asprintf(&etcdir, "%s/etc", build_root) < 0)
         CuFail(tc, "asprintf etcdir failed");
 
-    run(tc, "test -d %s && chmod -R u+w %s || :", build_root, build_root);
+    run(tc, "test -d %s && chmod -R u+rw %s || :", build_root, build_root);
     run(tc, "rm -rf %s", build_root);
     run(tc, "mkdir -p %s", etcdir);
     run(tc, "cp -pr %s/etc/hosts %s", root, etcdir);
-    run(tc, "chmod -R u+w %s", build_root);
+
+    free(etcdir);
+    return build_root;
+}
+
+static struct augeas *setup_hosts_aug(CuTest *tc, char *build_root) {
+    struct augeas *aug = NULL;
+    int r;
 
     aug = aug_init(build_root, loadpath, AUG_NO_MODL_AUTOLOAD);
     CuAssertPtrNotNull(tc, aug);
@@ -67,10 +74,21 @@ static struct augeas *setup_writable_hosts(CuTest *tc) {
     CuAssertRetSuccess(tc, r);
 
     free(build_root);
-    free(etcdir);
     return aug;
 }
 
+static struct augeas *setup_writable_hosts(CuTest *tc) {
+    char *build_root = setup_hosts(tc);
+    run(tc, "chmod -R u+w %s", build_root);
+    return setup_hosts_aug(tc, build_root);
+}
+
+static struct augeas *setup_unreadable_hosts(CuTest *tc) {
+    char *build_root = setup_hosts(tc);
+    run(tc, "chmod -R a-r %s/etc/hosts", build_root);
+    return setup_hosts_aug(tc, build_root);
+}
+
 static void testDefault(CuTest *tc) {
     augeas *aug = NULL;
     int nmatches, r;
@@ -437,7 +455,8 @@ static void testReloadExternalMod(CuTest *tc) {
     r = aug_get(aug, "/augeas/root", &aug_root);
     CuAssertIntEquals(tc, 1, r);
 
-    run(tc, "sed -i -e '1,2d' %setc/hosts", aug_root);
+    run(tc, "sed -e '1,2d' %setc/hosts > %setc/hosts.new", aug_root, aug_root);
+    run(tc, "mv %setc/hosts.new %setc/hosts", aug_root, aug_root);
 
     /* Reload and save again */
     r = aug_load(aug);
@@ -453,6 +472,36 @@ static void testReloadExternalMod(CuTest *tc) {
     CuAssertIntEquals(tc, 5, r);
 }
 
+/* Bug #259 - after save with /augeas/save = newfile, make sure we discard
+ * changes and reload files.
+ */
+static void testReloadAfterSaveNewfile(CuTest *tc) {
+    augeas *aug = NULL;
+    int r;
+
+    aug = setup_writable_hosts(tc);
+
+    r = aug_load(aug);
+    CuAssertRetSuccess(tc, r);
+
+    r = aug_set(aug, "/augeas/save", "newfile");
+    CuAssertRetSuccess(tc, r);
+
+    r = aug_set(aug, "/files/etc/hosts/1/ipaddr", "127.0.0.2");
+    CuAssertRetSuccess(tc, r);
+
+    r = aug_save(aug);
+    CuAssertRetSuccess(tc, r);
+
+    r = aug_load(aug);
+    CuAssertRetSuccess(tc, r);
+
+    r = aug_match(aug, "/files/etc/hosts/1[ipaddr = '127.0.0.1']", NULL);
+    CuAssertIntEquals(tc, 1, r);
+
+    aug_close(aug);
+}
+
 /* Make sure parse errors from applying a lens to a file that does not
  * match get reported under /augeas//error
  *
@@ -480,6 +529,80 @@ static void testParseErrorReported(CuTest *tc) {
     aug_close(aug);
 }
 
+/* Test failed file opening is reported, e.g. EACCES */
+static void testPermsErrorReported(CuTest *tc) {
+    if (getuid() == 0) {
+        puts("pending (testPermsErrorReported): can't test permissions under root account");
+        return;
+    }
+
+    augeas *aug = NULL;
+    int r;
+    const char *s;
+
+    aug = setup_unreadable_hosts(tc);
+
+    r = aug_load(aug);
+    CuAssertRetSuccess(tc, r);
+
+    r = aug_match(aug, "/files/etc/hosts", NULL);
+    CuAssertIntEquals(tc, 0, r);
+
+    r = aug_get(aug, "/augeas/files/etc/hosts/error", &s);
+    CuAssertIntEquals(tc, 1, r);
+    CuAssertStrEquals(tc, "read_failed", s);
+
+    r = aug_get(aug, "/augeas/files/etc/hosts/error/message", &s);
+    CuAssertIntEquals(tc, 1, r);
+}
+
+/* Test bug #252 - excl patterns have no effect when loading with a root */
+static void testLoadExclWithRoot(CuTest *tc) {
+    augeas *aug = NULL;
+    static const char *const cmds =
+        "set /augeas/context /augeas/load\n"
+        "set Hosts/lens Hosts.lns\n"
+        "set Hosts/incl /etc/hosts\n"
+        "set Fstab/lens Fstab.lns\n"
+        "set Fstab/incl /etc/ho*\n"
+        "set Fstab/excl /etc/hosts\n"
+        "load";
+    int r;
+
+    aug = aug_init(root, loadpath, AUG_NO_STDINC|AUG_NO_MODL_AUTOLOAD);
+    CuAssertPtrNotNull(tc, aug);
+
+    r = aug_srun(aug, stderr, cmds);
+    CuAssertIntEquals(tc, 7, r);
+
+    r = aug_match(aug, "/augeas//error", NULL);
+    CuAssertIntEquals(tc, 0, r);
+}
+
+/* Test excl patterns matching the end of a filename work, e.g. *.bak */
+static void testLoadTrailingExcl(CuTest *tc) {
+    augeas *aug = NULL;
+    static const char *const cmds =
+        "set /augeas/context /augeas/load/Shellvars\n"
+        "set lens Shellvars.lns\n"
+        "set incl /etc/sysconfig/network-scripts/ifcfg-lo*\n"
+        "set excl *.rpmsave\n"
+        "load";
+    int r;
+
+    aug = aug_init(root, loadpath, AUG_NO_STDINC|AUG_NO_MODL_AUTOLOAD);
+    CuAssertPtrNotNull(tc, aug);
+
+    r = aug_srun(aug, stderr, cmds);
+    CuAssertIntEquals(tc, 5, r);
+
+    r = aug_match(aug, "/augeas/files/etc/sysconfig/network-scripts/ifcfg-lo", NULL);
+    CuAssertIntEquals(tc, 1, r);
+
+    r = aug_match(aug, "/augeas/files/etc/sysconfig/network-scripts/ifcfg-lo.rpmsave", NULL);
+    CuAssertIntEquals(tc, 0, r);
+}
+
 int main(void) {
     char *output = NULL;
     CuSuite* suite = CuSuiteNew();
@@ -496,7 +619,11 @@ int main(void) {
     SUITE_ADD_TEST(suite, testReloadDeleted);
     SUITE_ADD_TEST(suite, testReloadDeletedMeta);
     SUITE_ADD_TEST(suite, testReloadExternalMod);
+    SUITE_ADD_TEST(suite, testReloadAfterSaveNewfile);
     SUITE_ADD_TEST(suite, testParseErrorReported);
+    SUITE_ADD_TEST(suite, testPermsErrorReported);
+    SUITE_ADD_TEST(suite, testLoadExclWithRoot);
+    SUITE_ADD_TEST(suite, testLoadTrailingExcl);
 
     abs_top_srcdir = getenv("abs_top_srcdir");
     if (abs_top_srcdir == NULL)
index daafea3..a6e8312 100755 (executable)
@@ -13,7 +13,7 @@ mkdir -p $(dirname $hosts)
 }
 
 stat_inode() {
-ls -il $1 | cut -d ' ' -f 1
+ls -il $1 | awk '{ print $1 }'
 }
 
 AUGTOOL="augtool --nostdinc -r $root -I $abs_top_srcdir/lenses"
@@ -26,6 +26,7 @@ group=$(groups | tr ' ' '\n' | tail -1)
 chgrp $group $hosts
 
 [ -x /usr/bin/chcon ] && selinux=yes || selinux=no
+[ x$SKIP_TEST_PRESERVE_SELINUX = x1 ] && selinux=no
 if [ $selinux = yes ] ; then
   /usr/bin/chcon -t etc_t $hosts > /dev/null 2>/dev/null || selinux=no
 fi
@@ -59,9 +60,12 @@ if [ $selinux = yes -a xetc_t != "x$act_con" ] ; then
     exit 1
 fi
 
-# Check that we create new files without error
+# Check that we create new files without error and with permissions implied
+# from the umask
 init_dirs
 
+oldumask=$(umask)
+umask 0002
 $AUGTOOL > /dev/null <<EOF
 set /files/etc/hosts/1/ipaddr 127.0.0.1
 set /files/etc/hosts/1/canonical host.example.com
@@ -71,6 +75,16 @@ if [ $? != 0 ] ; then
     echo "augtool failed on new file"
     exit 1
 fi
+if [ ! -e $hosts ]; then
+    echo "augtool didn't create new /etc/hosts file"
+    exit 1
+fi
+act_mode=$(ls -l $hosts | cut -b 1-10)
+if [ x-rw-rw-r-- != "x$act_mode" ] ; then
+    echo "Expected mode 0664 due to $(umask) umask but got $act_mode"
+    exit 1
+fi
+umask $oldumask
 
 # Check that we create new files without error when backups are requested
 init_dirs
diff --git a/tests/test-put-mount-augnew.sh b/tests/test-put-mount-augnew.sh
new file mode 100755 (executable)
index 0000000..cb95bda
--- /dev/null
@@ -0,0 +1,69 @@
+#! /bin/bash
+
+# Test that we can write into a bind mount placed at PATH.augnew with the
+# copy_if_rename_fails flag.
+# This requires that EXDEV or EBUSY is returned from rename(2) to activate the
+# code path, so set up a bind mount on Linux.
+
+if [ $UID -ne 0 -o "$(uname -s)" != "Linux" ]; then
+    echo "Test can only be run as root on Linux to create bind mounts"
+    exit 77
+fi
+
+ROOT=$abs_top_builddir/build/test-put-mount-augnew
+LENSES=$abs_top_srcdir/lenses
+
+HOSTS=$ROOT/etc/hosts
+HOSTS_AUGNEW=${HOSTS}.augnew
+TARGET=$ROOT/other/real_hosts
+
+rm -rf $ROOT
+mkdir -p $(dirname $HOSTS)
+mkdir -p $(dirname $TARGET)
+
+echo 127.0.0.1 localhost > $HOSTS
+touch $TARGET $HOSTS_AUGNEW
+
+mount --bind $TARGET $HOSTS_AUGNEW
+Exit() {
+    umount $HOSTS_AUGNEW
+    exit $1
+}
+
+HOSTS_SUM=$(sum $HOSTS)
+
+augtool --nostdinc -I $LENSES -r $ROOT --new <<EOF
+set /augeas/save/copy_if_rename_fails 1
+set /files/etc/hosts/1/alias myhost
+save
+print /augeas//error
+EOF
+
+if [ ! -f $HOSTS ] ; then
+    echo "/etc/hosts is no longer a regular file"
+    Exit 1
+fi
+if [ ! "x${HOSTS_SUM}" = "x$(sum $HOSTS)" ]; then
+    echo "/etc/hosts has changed"
+    Exit 1
+fi
+if [ ! "x${HOSTS_SUM}" = "x$(sum $HOSTS)" ]; then
+    echo "/etc/hosts has changed"
+    Exit 1
+fi
+
+if [ ! -s $HOSTS_AUGNEW ]; then
+    echo "/etc/hosts.augnew is empty"
+    Exit 1
+fi
+if [ ! -s $TARGET ]; then
+    echo "/other/real_hosts is empty"
+    Exit 1
+fi
+
+if ! grep myhost $TARGET >/dev/null; then
+    echo "/other/real_hosts does not contain the modification"
+    Exit 1
+fi
+
+Exit 0
diff --git a/tests/test-put-mount-augsave.sh b/tests/test-put-mount-augsave.sh
new file mode 100755 (executable)
index 0000000..31fcfca
--- /dev/null
@@ -0,0 +1,62 @@
+#! /bin/bash
+
+# Test that we don't follow bind mounts when writing to .augsave.
+# This requires that EXDEV or EBUSY is returned from rename(2) to activate the
+# code path, so set up a bind mount on Linux.
+
+if [ $UID -ne 0 -o "$(uname -s)" != "Linux" ]; then
+    echo "Test can only be run as root on Linux to create bind mounts"
+    exit 77
+fi
+
+actual() {
+    (augtool --nostdinc -I $LENSES -r $ROOT --backup | grep ^/augeas) <<EOF
+    set /augeas/save/copy_if_rename_fails 1
+    set /files/etc/hosts/1/alias myhost
+    save
+    print /augeas//error
+EOF
+}
+
+expected() {
+    cat <<EOF
+/augeas/files/etc/hosts/error = "clone_unlink_dst_augsave"
+/augeas/files/etc/hosts/error/message = "Device or resource busy"
+EOF
+}
+
+ROOT=$abs_top_builddir/build/test-put-mount-augsave
+LENSES=$abs_top_srcdir/lenses
+
+HOSTS=$ROOT/etc/hosts
+HOSTS_AUGSAVE=${HOSTS}.augsave
+
+ATTACK_FILE=$ROOT/other/attack
+
+rm -rf $ROOT
+mkdir -p $(dirname $HOSTS)
+mkdir -p $(dirname $ATTACK_FILE)
+
+echo 127.0.0.1 localhost > $HOSTS
+touch $ATTACK_FILE $HOSTS_AUGSAVE
+
+mount --bind $ATTACK_FILE $HOSTS_AUGSAVE
+Exit() {
+    umount $HOSTS_AUGSAVE
+    exit $1
+}
+
+ACTUAL=$(actual)
+EXPECTED=$(expected)
+if [ "$ACTUAL" != "$EXPECTED" ]; then
+    echo "No error when trying to unlink augsave (a bind mount):"
+    echo "$ACTUAL"
+    exit 1
+fi
+
+if [ -s $ATTACK_FILE ]; then
+    echo "/other/attack now contains data, should be blank"
+    Exit 1
+fi
+
+Exit 0
diff --git a/tests/test-put-mount.sh b/tests/test-put-mount.sh
new file mode 100755 (executable)
index 0000000..210bc10
--- /dev/null
@@ -0,0 +1,55 @@
+#! /bin/bash
+
+# Test that we can write into a bind mount with the copy_if_rename_fails flag.
+# This requires that EXDEV or EBUSY is returned from rename(2) to activate the
+# code path, so set up a bind mount on Linux.
+
+if [ $UID -ne 0 -o "$(uname -s)" != "Linux" ]; then
+    echo "Test can only be run as root on Linux to create bind mounts"
+    exit 77
+fi
+
+ROOT=$abs_top_builddir/build/test-put-mount
+LENSES=$abs_top_srcdir/lenses
+
+HOSTS=$ROOT/etc/hosts
+TARGET=$ROOT/other/real_hosts
+
+rm -rf $ROOT
+mkdir -p $(dirname $HOSTS)
+mkdir -p $(dirname $TARGET)
+
+echo 127.0.0.1 localhost > $TARGET
+touch $HOSTS
+
+mount --bind $TARGET $HOSTS
+Exit() {
+    umount $HOSTS
+    exit $1
+}
+
+HOSTS_SUM=$(sum $HOSTS)
+
+augtool --nostdinc -I $LENSES -r $ROOT <<EOF
+set /augeas/save/copy_if_rename_fails 1
+set /files/etc/hosts/1/alias myhost
+save
+print /augeas//error
+EOF
+
+if [ ! "x${HOSTS_SUM}" != "x$(sum $HOSTS)" ]; then
+    echo "/etc/hosts hasn't changed"
+    Exit 1
+fi
+
+if [ ! "x${HOSTS_SUM}" != "x$(sum $TARGET)" ]; then
+    echo "/other/real_hosts hasn't changed"
+    Exit 1
+fi
+
+if ! grep myhost $TARGET >/dev/null; then
+    echo "/other/real_hosts does not contain the modification"
+    Exit 1
+fi
+
+Exit 0
diff --git a/tests/test-put-symlink-augnew.sh b/tests/test-put-symlink-augnew.sh
new file mode 100755 (executable)
index 0000000..e87fb63
--- /dev/null
@@ -0,0 +1,52 @@
+#! /bin/bash
+
+# Test that we don't follow symlinks when writing to .augnew
+
+ROOT=$abs_top_builddir/build/test-put-symlink-augnew
+LENSES=$abs_top_srcdir/lenses
+
+HOSTS=$ROOT/etc/hosts
+HOSTS_AUGNEW=${HOSTS}.augnew
+
+ATTACK_FILE=$ROOT/other/attack
+
+rm -rf $ROOT
+mkdir -p $(dirname $HOSTS)
+mkdir -p $(dirname $ATTACK_FILE)
+
+cat <<EOF > $HOSTS
+127.0.0.1 localhost
+EOF
+touch $ATTACK_FILE
+
+(cd $(dirname $HOSTS) && ln -s ../other/attack $(basename $HOSTS).augnew)
+
+HOSTS_SUM=$(sum $HOSTS)
+
+augtool --nostdinc -I $LENSES -r $ROOT --new > /dev/null <<EOF
+set /files/etc/hosts/1/alias myhost
+save
+EOF
+
+if [ ! -f $HOSTS  -o  -h $HOSTS ] ; then
+    echo "/etc/hosts is no longer a regular file"
+    exit 1
+fi
+if [ ! "x${HOSTS_SUM}" = "x$(sum $HOSTS)" ]; then
+    echo "/etc/hosts has changed"
+    exit 1
+fi
+
+if [ -h $HOSTS_AUGNEW ] ; then
+    echo "/etc/hosts.augnew is still a symlink, should be unlinked"
+    exit 1
+fi
+if ! grep myhost $HOSTS_AUGNEW >/dev/null; then
+    echo "/etc/hosts does not contain the modification"
+    exit 1
+fi
+
+if [ -s $ATTACK_FILE ]; then
+    echo "/other/attack now contains data, should be blank"
+    exit 1
+fi
diff --git a/tests/test-put-symlink-augsave.sh b/tests/test-put-symlink-augsave.sh
new file mode 100755 (executable)
index 0000000..c6a1d16
--- /dev/null
@@ -0,0 +1,52 @@
+#! /bin/bash
+
+# Test that we don't follow .augsave symlinks
+
+ROOT=$abs_top_builddir/build/test-put-symlink-augsave
+LENSES=$abs_top_srcdir/lenses
+
+HOSTS=$ROOT/etc/hosts
+HOSTS_AUGSAVE=${HOSTS}.augsave
+
+ATTACK_FILE=$ROOT/other/attack
+
+rm -rf $ROOT
+mkdir -p $(dirname $HOSTS)
+mkdir -p $(dirname $ATTACK_FILE)
+
+cat <<EOF > $HOSTS
+127.0.0.1 localhost
+EOF
+HOSTS_SUM=$(sum $HOSTS)
+
+touch $ATTACK_FILE
+(cd $(dirname $HOSTS) && ln -s ../other/attack $(basename $HOSTS).augsave)
+
+# Now ask for the original to be saved in .augsave
+augtool --nostdinc -I $LENSES -r $ROOT --backup > /dev/null <<EOF
+set /files/etc/hosts/1/alias myhost
+save
+EOF
+
+if [ ! -f $HOSTS  -o  -h $HOSTS ] ; then
+    echo "/etc/hosts is no longer a regular file"
+    exit 1
+fi
+if [ -h $HOSTS_AUGSAVE ] ; then
+    echo "/etc/hosts.augsave is still a symlink, should be unlinked"
+    exit 1
+fi
+
+if [ ! "x${HOSTS_SUM}" = "x$(sum $HOSTS_AUGSAVE)" ]; then
+    echo "/etc/hosts.augsave has changed from the original /etc/hosts"
+    exit 1
+fi
+if ! grep myhost $HOSTS >/dev/null; then
+    echo "/etc/hosts does not contain the modification"
+    exit 1
+fi
+
+if [ -s $ATTACK_FILE ]; then
+    echo "/other/attack now contains data, should be blank"
+    exit 1
+fi
diff --git a/tests/test-put-symlink-augtemp.sh b/tests/test-put-symlink-augtemp.sh
new file mode 100755 (executable)
index 0000000..0076e64
--- /dev/null
@@ -0,0 +1,52 @@
+#! /bin/bash
+
+# Test that we don't follow .augnew symlinks (regression test)
+
+ROOT=$abs_top_builddir/build/test-put-symlink-augtemp
+LENSES=$abs_top_srcdir/lenses
+
+HOSTS=$ROOT/etc/hosts
+HOSTS_AUGNEW=${HOSTS}.augnew
+
+ATTACK_FILE=$ROOT/other/attack
+
+rm -rf $ROOT
+mkdir -p $(dirname $HOSTS)
+mkdir -p $(dirname $ATTACK_FILE)
+
+cat <<EOF > $HOSTS
+127.0.0.1 localhost
+EOF
+touch $ATTACK_FILE
+
+(cd $(dirname $HOSTS) && ln -s ../other/attack $(basename $HOSTS).augnew)
+
+# Test the normal save code path which would use a temp augnew file
+augtool --nostdinc -I $LENSES -r $ROOT > /dev/null <<EOF
+set /files/etc/hosts/1/alias myhost1
+save
+EOF
+
+if [ -h $HOSTS ] ; then
+    echo "/etc/hosts is now a symlink, pointing to" $(readlink $HOSTS)
+    exit 1
+fi
+if ! grep myhost1 $HOSTS >/dev/null; then
+    echo "/etc/hosts does not contain the modification"
+    exit 1
+fi
+
+if [ ! -h $HOSTS_AUGNEW ] ; then
+    echo "/etc/hosts.augnew is not a symbolic link"
+    exit 1
+fi
+LINK=$(readlink $HOSTS_AUGNEW)
+if [ "x$LINK" != "x../other/attack" ] ; then
+    echo "/etc/hosts.augnew no longer links to ../other/attack"
+    exit 1
+fi
+
+if [ -s $ATTACK_FILE ]; then
+    echo "/other/attack now contains data, should be blank"
+    exit 1
+fi
index 6996b23..64749ea 100755 (executable)
@@ -41,3 +41,8 @@ if [ "x$LINK" != "x../other/hosts" ] ; then
     echo "/etc/hosts does not link to ../other/hosts"
     exit 1
 fi
+
+if ! grep myhost $REAL_HOSTS >/dev/null; then
+    echo "/other/hosts does not contain the modification"
+    exit 1
+fi
index 248e9fa..ba1b50d 100644 (file)
 #include <unistd.h>
 
 static const char *abs_top_srcdir;
+static char *lensdir;
 
 #define KW_TEST "test"
 #define KW_PRINTS "prints"
 #define KW_SOMETHING "something"
+#define KW_USE "use"
 
 /* This array needs to be kept in sync with aug_errcode_t, and
  * the entries need to be in the same order as in that enum; used
@@ -47,12 +49,13 @@ static const char *abs_top_srcdir;
 static const char *const errtokens[] = {
     "NOERROR", "ENOMEM", "EINTERNAL", "EPATHX", "ENOMATCH",
     "EMMATCH", "ESYNTAX", "ENOLENS", "EMXFM", "ENOSPAN",
-    "EMVDESC", "ECMDRUN"
+    "EMVDESC", "ECMDRUN", "EBADARG", "ELABEL"
 };
 
 struct test {
     struct test *next;
     char *name;
+    char *module;
     int  result;
     int  errcode;
     char *cmd;
@@ -149,6 +152,10 @@ static struct test *read_tests(void) {
             s = skipws(s + strlen(KW_PRINTS));
             t->out_present = looking_at(s, KW_SOMETHING);
             append_cmd = false;
+        } else if (looking_at(s, KW_USE)) {
+            if (t->module !=NULL)
+                die("Can use at most one module in a test");
+            s = token(s + strlen(KW_USE), &(t->module));
         } else {
             char **buf = append_cmd ? &(t->cmd) : &(t->out);
             if (*buf == NULL) {
@@ -175,19 +182,49 @@ static struct test *read_tests(void) {
         goto error;                             \
     }
 
+static int load_module(struct augeas *aug, struct test *test) {
+    char *fname, *fpath;
+    int r;
+
+    if (test->module == NULL)
+        return 0;
+
+    if (asprintf(&fname, "%s.aug", test->module) == -1)
+       fail(true, "asprintf test->module");
+
+    for (int i=0; i < strlen(fname); i++)
+        fname[i] = tolower(fname[i]);
+
+    if (asprintf(&fpath, "%s/%s", lensdir, fname) == -1)
+        fail(true, "asprintf lensdir");
+
+    r = __aug_load_module_file(aug, fpath);
+    fail(r < 0, "Could not load %s", fpath);
+
+    return 0;
+ error:
+    return -1;
+}
+
 static int run_one_test(struct test *test) {
     int r;
     struct augeas *aug = NULL;
     struct memstream ms;
     int result = 0;
 
-    aug = aug_init("/dev/null", NULL, AUG_NO_STDINC|AUG_NO_LOAD);
+    MEMZERO(&ms, 1);
+
+    aug = aug_init("/dev/null", lensdir, AUG_NO_STDINC|AUG_NO_MODL_AUTOLOAD);
     fail(aug == NULL, "aug_init");
     fail(aug_error(aug) != AUG_NOERROR, "aug_init: errcode was %d",
          aug_error(aug));
 
     printf("%-30s ... ", test->name);
 
+    r = load_module(aug, test);
+    if (r < 0)
+        goto error;
+
     r = init_memstream(&ms);
     fail(r < 0, "init_memstream");
 
@@ -222,25 +259,30 @@ static int run_one_test(struct test *test) {
     goto done;
 }
 
-static int run_tests(struct test *tests) {
+static int run_tests(struct test *tests, int argc, char **argv) {
     int result = EXIT_SUCCESS;
 
     list_for_each(t, tests) {
+        if (! should_run(t->name, argc, argv))
+            continue;
         if (run_one_test(t) < 0)
             result = EXIT_FAILURE;
     }
     return result;
 }
 
-int main(void) {
+int main(int argc, char **argv) {
     struct test *tests;
 
     abs_top_srcdir = getenv("abs_top_srcdir");
     if (abs_top_srcdir == NULL)
         die("env var abs_top_srcdir must be set");
 
+    if (asprintf(&lensdir, "%s/lenses", abs_top_srcdir) < 0)
+        die("out of memory setting lensdir");
+
     tests = read_tests();
-    return run_tests(tests);
+    return run_tests(tests, argc - 1, argv + 1);
 }
 
 /*
index 00741da..847fd69 100755 (executable)
@@ -15,7 +15,7 @@ EOF
 
 expected_errors() {
 cat <<EOF
-/augeas/files/etc/hosts/error = "open_augnew"
+/augeas/files/etc/hosts/error = "mk_augtemp"
 /augeas/files/etc/hosts/error/message = "No such file or directory"
 EOF
 }
@@ -30,7 +30,8 @@ EXPECTED=$(expected_errors)
 
 if [ "$ACTUAL" != "$EXPECTED" ]
 then
-    echo "No error on missing /etc directory"
+    echo "No error on missing /etc directory:"
+    echo "$ACTUAL"
     exit 1
 fi
 
index 04b86f7..698baf7 100644 (file)
 #include "cutest.h"
 
 #include <stdio.h>
+#include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/wait.h>
+#include <unistd.h>
 
 const char *abs_top_srcdir;
 const char *abs_top_builddir;
@@ -51,6 +53,7 @@ static void setup(CuTest *tc) {
     if (asprintf(&lensdir, "%s/lenses", abs_top_srcdir) < 0)
         CuFail(tc, "asprintf lensdir failed");
 
+    umask(0022);
     run(tc, "test -d %s && chmod -R u+w %s || :", root, root);
     run(tc, "rm -rf %s", root);
     run(tc, "mkdir -p %s", root);
@@ -62,12 +65,41 @@ static void setup(CuTest *tc) {
 }
 
 static void teardown(ATTRIBUTE_UNUSED CuTest *tc) {
+    /* testRemovePermission makes <root>/etc nonwritable. That leads
+       to an error from 'make distcheck' make sure that directory is
+       writable by the user after the test */
+    run(tc, "chmod u+w %s/etc", root);
+
     aug_close(aug);
     aug = NULL;
     free(root);
     root = NULL;
 }
 
+static void testRemoveNoPermission(CuTest *tc) {
+    if (getuid() == 0) {
+        puts("pending (testRemoveNoPermission): can't test permissions under root account");
+        return;
+    }
+
+    int r;
+    const char *errmsg;
+
+    // Prevent deletion of files
+    run(tc, "chmod 0500 %s/etc", root);
+
+    r = aug_rm(aug, "/files/etc/hosts");
+    CuAssertTrue(tc, r > 0);
+
+    r = aug_save(aug);
+    CuAssertIntEquals(tc, -1, r);
+
+    r = aug_get(aug, "/augeas/files/etc/hosts/error", &errmsg);
+    CuAssertIntEquals(tc, 1, r);
+    CuAssertPtrNotNull(tc, errmsg);
+    CuAssertStrEquals(tc, "unlink_orig", errmsg);
+}
+
 static void testSaveNewFile(CuTest *tc) {
     int r;
 
@@ -183,6 +215,87 @@ static void testRelPath(CuTest *tc) {
     CuAssertIntEquals(tc, 1, r);
 }
 
+/* Check that loading and saving a file with // in the incl pattern works.
+ * RHBZ#1031084
+ */
+static void testDoubleSlashPath(CuTest *tc) {
+    int r;
+
+    r = aug_rm(aug, "/augeas/load/*");
+    CuAssertPositive(tc, r);
+
+    r = aug_set(aug, "/augeas/load/Hosts/lens", "Hosts.lns");
+    CuAssertRetSuccess(tc, r);
+    r = aug_set(aug, "/augeas/load/Hosts/incl", "/etc//hosts");
+    CuAssertRetSuccess(tc, r);
+    r = aug_load(aug);
+    CuAssertRetSuccess(tc, r);
+
+    r = aug_match(aug, "/files/etc/hosts/1/alias[ . = 'new']", NULL);
+    CuAssertIntEquals(tc, 0, r);
+
+    r = aug_set(aug, "/files/etc/hosts/1/alias[last() + 1]", "new");
+    CuAssertRetSuccess(tc, r);
+
+    r = aug_save(aug);
+    CuAssertRetSuccess(tc, r);
+    r = aug_match(aug, "/augeas//error", NULL);
+    CuAssertIntEquals(tc, 0, r);
+
+    /* Force reloading the file */
+    r = aug_rm(aug, "/augeas/files//mtime");
+    CuAssertPositive(tc, r);
+
+    r = aug_load(aug);
+    CuAssertRetSuccess(tc, r);
+
+    r = aug_match(aug, "/files/etc/hosts/1/alias[. = 'new']", NULL);
+    CuAssertIntEquals(tc, 1, r);
+}
+
+/* Check the umask is followed when creating files
+ */
+static void testUmask(CuTest *tc, int tumask, mode_t expected_mode) {
+    int r;
+    struct stat buf;
+    char* fpath = NULL;
+
+    if (asprintf(&fpath, "%s/etc/test", root) < 0) {
+        CuFail(tc, "failed to set root");
+    }
+
+    umask(tumask);
+
+    r = aug_rm(aug, "/augeas/load/*");
+    CuAssertPositive(tc, r);
+
+    r = aug_set(aug, "/augeas/load/Test/lens", "Simplelines.lns");
+    CuAssertRetSuccess(tc, r);
+    r = aug_set(aug, "/augeas/load/Test/incl", "/etc/test");
+    CuAssertRetSuccess(tc, r);
+    r = aug_load(aug);
+    CuAssertRetSuccess(tc, r);
+    r = aug_set(aug, "/files/etc/test/1", "test");
+    CuAssertRetSuccess(tc, r);
+
+    r = aug_save(aug);
+    CuAssertRetSuccess(tc, r);
+    r = aug_match(aug, "/augeas//error", NULL);
+    CuAssertIntEquals(tc, 0, r);
+
+    CuAssertIntEquals(tc, 0, stat(fpath, &buf));
+    CuAssertIntEquals(tc, expected_mode, buf.st_mode & 0777);
+}
+static void testUmask077(CuTest *tc) {
+    testUmask(tc, 0077, 0600);
+}
+static void testUmask027(CuTest *tc) {
+    testUmask(tc, 0027, 0640);
+}
+static void testUmask022(CuTest *tc) {
+    testUmask(tc, 0022, 0644);
+}
+
 int main(void) {
     char *output = NULL;
     CuSuite* suite = CuSuiteNew();
@@ -202,10 +315,15 @@ int main(void) {
     CuSuiteSetup(suite, setup, teardown);
 
     SUITE_ADD_TEST(suite, testSaveNewFile);
+    SUITE_ADD_TEST(suite, testRemoveNoPermission);
     SUITE_ADD_TEST(suite, testNonExistentLens);
     SUITE_ADD_TEST(suite, testMultipleXfm);
     SUITE_ADD_TEST(suite, testMtime);
     SUITE_ADD_TEST(suite, testRelPath);
+    SUITE_ADD_TEST(suite, testDoubleSlashPath);
+    SUITE_ADD_TEST(suite, testUmask077);
+    SUITE_ADD_TEST(suite, testUmask027);
+    SUITE_ADD_TEST(suite, testUmask022);
 
     CuSuiteRun(suite);
     CuSuiteSummary(suite, &output);
index 42a4b91..335e7bf 100644 (file)
@@ -30,6 +30,8 @@
 #include <internal.h>
 #include <memory.h>
 
+#include "cutest.h"
+
 static const char *abs_top_srcdir;
 static char *root;
 
@@ -314,6 +316,21 @@ static int test_invalid_regexp(struct augeas *aug) {
     return -1;
 }
 
+static int test_wrong_regexp_flag(struct augeas *aug) {
+    int r;
+
+    printf("%-30s ... ", "wrong_regexp_flag");
+    r = aug_match(aug, "/files/*[ * =~ regexp('abc', 'o')]", NULL);
+    if (r >= 0)
+        goto fail;
+
+    printf("PASS\n");
+    return 0;
+ fail:
+    printf("FAIL\n");
+    return -1;
+}
+
 static int run_tests(struct test *tests, int argc, char **argv) {
     char *lensdir;
     struct augeas *aug = NULL;
@@ -336,11 +353,7 @@ static int run_tests(struct test *tests, int argc, char **argv) {
         die("aug_defvar $php");
 
     list_for_each(t, tests) {
-        int skip = (argc > 0);
-        for (int i=0; i < argc; i++)
-            if (STREQ(argv[i], t->name))
-                skip = 0;
-        if (skip)
+        if (! should_run(t->name, argc, argv))
             continue;
         if (run_one_test(aug, t) < 0)
             result = EXIT_FAILURE;
@@ -358,6 +371,9 @@ static int run_tests(struct test *tests, int argc, char **argv) {
 
         if (test_invalid_regexp(aug) < 0)
             result = EXIT_FAILURE;
+
+        if (test_wrong_regexp_flag(aug) < 0)
+            result = EXIT_FAILURE;
     }
     aug_close(aug);
 
index 742b9ff..41bb555 100644 (file)
@@ -233,6 +233,14 @@ test regexp3 /files/etc/hosts/*[ipaddr =~ regexp(/files/etc/hosts/*/ipaddr)]
 # Check that we don't crash when the nodeset contains all NULL's
 test regexp4 /files/etc/hosts/*[ipaddr =~ regexp(/files/etc/hosts/*[ipaddr])]
 
+# Check case-insensitive matches
+test regexp5 /files/etc/sysconfig/network-scripts/*[label() =~ regexp('.*-ETH0', 'i')]
+     /files/etc/sysconfig/network-scripts/ifcfg-eth0
+
+test regexp6 /files/etc/hosts/*[ipaddr =~ regexp(/files/etc/hosts/*/ipaddr, 'i')]
+     /files/etc/hosts/1
+     /files/etc/hosts/2
+
 test glob1 /files[ 'axxa' =~ glob('a*a') ]
      /files